From d047878333a168bdeab4a92cd4d9b562b632ecbf Mon Sep 17 00:00:00 2001
From: MichelJuillard <michel.juillard@mjui.fr>
Date: Fri, 10 Dec 2021 10:17:06 +0100
Subject: [PATCH] Julia specific interface for normcdf and normpdf

---
 src/ExprNode.cc | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/ExprNode.cc b/src/ExprNode.cc
index 83136997..de3cd447 100644
--- a/src/ExprNode.cc
+++ b/src/ExprNode.cc
@@ -5939,6 +5939,17 @@ TrinaryOpNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
           arg3->writeOutput(output, output_type, temporary_terms, temporary_terms_idxs, tef_terms);
           output << ")/M_SQRT2)))";
         }
+      else if (isJuliaOutput(output_type))
+	{
+	  // Julia API is normcdf(mu, sigma, x) !
+          output << "normcdf(";
+          arg2->writeOutput(output, output_type, temporary_terms, temporary_terms_idxs, tef_terms);
+          output << ",";
+          arg3->writeOutput(output, output_type, temporary_terms, temporary_terms_idxs, tef_terms);
+          output << ",";
+          arg1->writeOutput(output, output_type, temporary_terms, temporary_terms_idxs, tef_terms);
+          output << ")";
+        }
       else
         {
           output << "normcdf(";
@@ -5964,6 +5975,17 @@ TrinaryOpNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
           arg3->writeOutput(output, output_type, temporary_terms, temporary_terms_idxs, tef_terms);
           output << ",2)/2)))";
         }
+      else if (isJuliaOutput(output_type))
+	{
+	  // Julia API is normpdf(mu, sigma, x) !
+          output << "normpdf(";
+          arg2->writeOutput(output, output_type, temporary_terms, temporary_terms_idxs, tef_terms);
+          output << ",";
+          arg3->writeOutput(output, output_type, temporary_terms, temporary_terms_idxs, tef_terms);
+          output << ",";
+          arg1->writeOutput(output, output_type, temporary_terms, temporary_terms_idxs, tef_terms);
+          output << ")";
+        }
       else
         {
           output << "normpdf(";
-- 
GitLab