
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (pow (exp t) t)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((2.0 * z) * pow(exp(t), t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * 0.5d0) - y) * sqrt(((2.0d0 * z) * (exp(t) ** t)))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt(((2.0 * z) * Math.pow(Math.exp(t), t)));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((2.0 * z) * math.pow(math.exp(t), t)))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) * (exp(t) ^ t)))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) * (exp(t) ^ t))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[Power[N[Exp[t], $MachinePrecision], t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot {\left(e^{t}\right)}^{t}}
\end{array}
Initial program 99.4%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
pow299.7%
exp-prod99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (exp (pow t 2.0))))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((2.0 * z) * exp(pow(t, 2.0))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * 0.5d0) - y) * sqrt(((2.0d0 * z) * exp((t ** 2.0d0))))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt(((2.0 * z) * Math.exp(Math.pow(t, 2.0))));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((2.0 * z) * math.exp(math.pow(t, 2.0))))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) * exp((t ^ 2.0))))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) * exp((t ^ 2.0)))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[Exp[N[Power[t, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot e^{{t}^{2}}}
\end{array}
Initial program 99.4%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (* t t) 0.005) (not (<= (* t t) 5e+303))) (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (fma t t 1.0)))) (* (* y (sqrt (* 2.0 z))) (- (exp (/ (* t t) 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (((t * t) <= 0.005) || !((t * t) <= 5e+303)) {
tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) * fma(t, t, 1.0)));
} else {
tmp = (y * sqrt((2.0 * z))) * -exp(((t * t) / 2.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((Float64(t * t) <= 0.005) || !(Float64(t * t) <= 5e+303)) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) * fma(t, t, 1.0)))); else tmp = Float64(Float64(y * sqrt(Float64(2.0 * z))) * Float64(-exp(Float64(Float64(t * t) / 2.0)))); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(t * t), $MachinePrecision], 0.005], N[Not[LessEqual[N[(t * t), $MachinePrecision], 5e+303]], $MachinePrecision]], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(y * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * (-N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 0.005 \lor \neg \left(t \cdot t \leq 5 \cdot 10^{+303}\right):\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \sqrt{2 \cdot z}\right) \cdot \left(-e^{\frac{t \cdot t}{2}}\right)\\
\end{array}
\end{array}
if (*.f64 t t) < 0.0050000000000000001 or 4.9999999999999997e303 < (*.f64 t t) Initial program 99.7%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
sqrt-unprod99.7%
associate-*l*99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 99.2%
+-commutative56.0%
unpow256.0%
fma-define56.0%
Simplified99.2%
if 0.0050000000000000001 < (*.f64 t t) < 4.9999999999999997e303Initial program 98.1%
Taylor expanded in x around 0 67.2%
pow167.2%
*-commutative67.2%
*-commutative67.2%
associate-*r*67.2%
sqrt-prod67.2%
*-commutative67.2%
*-commutative67.2%
Applied egg-rr67.2%
unpow167.2%
Simplified67.2%
Final simplification92.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 1.0)
(* t_1 (sqrt (* 2.0 z)))
(if (or (<= t 3.1e+161) (not (<= t 2.9e+215)))
(* (* t (* t_1 (sqrt 2.0))) (sqrt z))
(* (sqrt (* z (* 2.0 (fma t t 1.0)))) (- y))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 1.0) {
tmp = t_1 * sqrt((2.0 * z));
} else if ((t <= 3.1e+161) || !(t <= 2.9e+215)) {
tmp = (t * (t_1 * sqrt(2.0))) * sqrt(z);
} else {
tmp = sqrt((z * (2.0 * fma(t, t, 1.0)))) * -y;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 1.0) tmp = Float64(t_1 * sqrt(Float64(2.0 * z))); elseif ((t <= 3.1e+161) || !(t <= 2.9e+215)) tmp = Float64(Float64(t * Float64(t_1 * sqrt(2.0))) * sqrt(z)); else tmp = Float64(sqrt(Float64(z * Float64(2.0 * fma(t, t, 1.0)))) * Float64(-y)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 1.0], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3.1e+161], N[Not[LessEqual[t, 2.9e+215]], $MachinePrecision]], N[(N[(t * N[(t$95$1 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(z * N[(2.0 * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 1:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+161} \lor \neg \left(t \leq 2.9 \cdot 10^{+215}\right):\\
\;\;\;\;\left(t \cdot \left(t\_1 \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z \cdot \left(2 \cdot \mathsf{fma}\left(t, t, 1\right)\right)} \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < 1Initial program 99.7%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
sqrt-unprod99.7%
associate-*l*99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 73.2%
if 1 < t < 3.10000000000000007e161 or 2.8999999999999999e215 < t Initial program 97.9%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod100.0%
Simplified100.0%
pow1100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp99.9%
pow299.9%
Applied egg-rr99.9%
unpow199.9%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 64.6%
+-commutative42.4%
unpow242.4%
fma-define42.4%
Simplified64.6%
Taylor expanded in t around inf 55.3%
if 3.10000000000000007e161 < t < 2.8999999999999999e215Initial program 100.0%
Taylor expanded in x around 0 75.0%
associate-*l*75.0%
mul-1-neg75.0%
*-commutative75.0%
*-commutative75.0%
associate-*r*75.0%
sqrt-prod75.0%
*-commutative75.0%
pow275.0%
div-inv75.0%
metadata-eval75.0%
*-commutative75.0%
*-un-lft-identity75.0%
pow-exp75.0%
associate-*l*87.5%
pow-exp87.5%
*-un-lft-identity87.5%
*-commutative87.5%
exp-prod87.5%
pow1/287.5%
Applied egg-rr87.5%
distribute-lft-neg-in87.5%
*-commutative87.5%
associate-*r*87.5%
Simplified87.5%
Taylor expanded in t around 0 87.5%
+-commutative87.5%
unpow287.5%
fma-define87.5%
Simplified87.5%
Final simplification70.1%
(FPCore (x y z t)
:precision binary64
(if (<= t 3.8e+115)
(* (- (* x 0.5) y) (sqrt (* 2.0 z)))
(if (or (<= t 2.35e+219) (not (<= t 1.7e+230)))
(* (sqrt z) (* (- y) (* t (sqrt 2.0))))
(* y (sqrt (* (* 2.0 z) (fma t t 1.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.8e+115) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else if ((t <= 2.35e+219) || !(t <= 1.7e+230)) {
tmp = sqrt(z) * (-y * (t * sqrt(2.0)));
} else {
tmp = y * sqrt(((2.0 * z) * fma(t, t, 1.0)));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 3.8e+115) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); elseif ((t <= 2.35e+219) || !(t <= 1.7e+230)) tmp = Float64(sqrt(z) * Float64(Float64(-y) * Float64(t * sqrt(2.0)))); else tmp = Float64(y * sqrt(Float64(Float64(2.0 * z) * fma(t, t, 1.0)))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.8e+115], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 2.35e+219], N[Not[LessEqual[t, 1.7e+230]], $MachinePrecision]], N[(N[Sqrt[z], $MachinePrecision] * N[((-y) * N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.8 \cdot 10^{+115}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{+219} \lor \neg \left(t \leq 1.7 \cdot 10^{+230}\right):\\
\;\;\;\;\sqrt{z} \cdot \left(\left(-y\right) \cdot \left(t \cdot \sqrt{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\\
\end{array}
\end{array}
if t < 3.8000000000000001e115Initial program 99.2%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
sqrt-unprod99.7%
associate-*l*99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 67.2%
if 3.8000000000000001e115 < t < 2.35000000000000007e219 or 1.69999999999999993e230 < t Initial program 100.0%
Taylor expanded in x around 0 84.4%
associate-*l*84.4%
mul-1-neg84.4%
*-commutative84.4%
*-commutative84.4%
associate-*r*84.4%
sqrt-prod84.4%
*-commutative84.4%
pow284.4%
div-inv84.4%
metadata-eval84.4%
*-commutative84.4%
*-un-lft-identity84.4%
pow-exp84.4%
associate-*l*87.5%
pow-exp87.5%
*-un-lft-identity87.5%
*-commutative87.5%
exp-prod87.5%
pow1/287.5%
Applied egg-rr87.5%
distribute-lft-neg-in87.5%
*-commutative87.5%
associate-*r*87.5%
Simplified87.5%
Taylor expanded in t around 0 78.5%
+-commutative78.5%
unpow278.5%
fma-define78.5%
Simplified78.5%
Taylor expanded in t around inf 54.6%
mul-1-neg54.6%
*-commutative54.6%
distribute-rgt-neg-in54.6%
*-commutative54.6%
associate-*r*54.6%
Simplified54.6%
if 2.35000000000000007e219 < t < 1.69999999999999993e230Initial program 100.0%
Taylor expanded in x around 0 20.0%
associate-*l*20.0%
mul-1-neg20.0%
*-commutative20.0%
*-commutative20.0%
associate-*r*20.0%
sqrt-prod20.0%
*-commutative20.0%
pow220.0%
div-inv20.0%
metadata-eval20.0%
*-commutative20.0%
*-un-lft-identity20.0%
pow-exp20.0%
associate-*l*20.0%
pow-exp20.0%
*-un-lft-identity20.0%
*-commutative20.0%
exp-prod20.0%
pow1/220.0%
Applied egg-rr20.0%
distribute-lft-neg-in20.0%
*-commutative20.0%
associate-*r*20.0%
Simplified20.0%
Taylor expanded in t around 0 20.0%
+-commutative20.0%
unpow220.0%
fma-define20.0%
Simplified20.0%
add-sqr-sqrt0.0%
sqrt-unprod20.0%
sqr-neg20.0%
sqrt-unprod60.0%
add-sqr-sqrt80.0%
pow180.0%
*-commutative80.0%
associate-*l*80.0%
*-commutative80.0%
associate-*l*80.0%
Applied egg-rr80.0%
unpow180.0%
associate-*r*80.0%
*-commutative80.0%
Simplified80.0%
Final simplification65.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* 2.0 z))))
(if (<= t 0.14)
(* t_1 (* t_2 (hypot 1.0 t)))
(if (<= t 3e+215)
(* (* y t_2) (- (exp (/ (* t t) 2.0))))
(* (* t (* t_1 (sqrt 2.0))) (sqrt z))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = sqrt((2.0 * z));
double tmp;
if (t <= 0.14) {
tmp = t_1 * (t_2 * hypot(1.0, t));
} else if (t <= 3e+215) {
tmp = (y * t_2) * -exp(((t * t) / 2.0));
} else {
tmp = (t * (t_1 * sqrt(2.0))) * sqrt(z);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = Math.sqrt((2.0 * z));
double tmp;
if (t <= 0.14) {
tmp = t_1 * (t_2 * Math.hypot(1.0, t));
} else if (t <= 3e+215) {
tmp = (y * t_2) * -Math.exp(((t * t) / 2.0));
} else {
tmp = (t * (t_1 * Math.sqrt(2.0))) * Math.sqrt(z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y t_2 = math.sqrt((2.0 * z)) tmp = 0 if t <= 0.14: tmp = t_1 * (t_2 * math.hypot(1.0, t)) elif t <= 3e+215: tmp = (y * t_2) * -math.exp(((t * t) / 2.0)) else: tmp = (t * (t_1 * math.sqrt(2.0))) * math.sqrt(z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) t_2 = sqrt(Float64(2.0 * z)) tmp = 0.0 if (t <= 0.14) tmp = Float64(t_1 * Float64(t_2 * hypot(1.0, t))); elseif (t <= 3e+215) tmp = Float64(Float64(y * t_2) * Float64(-exp(Float64(Float64(t * t) / 2.0)))); else tmp = Float64(Float64(t * Float64(t_1 * sqrt(2.0))) * sqrt(z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; t_2 = sqrt((2.0 * z)); tmp = 0.0; if (t <= 0.14) tmp = t_1 * (t_2 * hypot(1.0, t)); elseif (t <= 3e+215) tmp = (y * t_2) * -exp(((t * t) / 2.0)); else tmp = (t * (t_1 * sqrt(2.0))) * sqrt(z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 0.14], N[(t$95$1 * N[(t$95$2 * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+215], N[(N[(y * t$95$2), $MachinePrecision] * (-N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(t * N[(t$95$1 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t \leq 0.14:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \mathsf{hypot}\left(1, t\right)\right)\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+215}:\\
\;\;\;\;\left(y \cdot t\_2\right) \cdot \left(-e^{\frac{t \cdot t}{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \left(t\_1 \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\\
\end{array}
\end{array}
if t < 0.14000000000000001Initial program 99.7%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
sqrt-unprod99.7%
associate-*l*99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 89.0%
+-commutative47.8%
unpow247.8%
fma-define47.8%
Simplified89.0%
sqrt-prod88.6%
Applied egg-rr88.6%
*-commutative88.6%
fma-undefine88.6%
unpow288.6%
+-commutative88.6%
unpow288.6%
hypot-1-def85.2%
Simplified85.2%
if 0.14000000000000001 < t < 2.9999999999999999e215Initial program 97.0%
Taylor expanded in x around 0 65.6%
pow165.6%
*-commutative65.6%
*-commutative65.6%
associate-*r*65.6%
sqrt-prod65.6%
*-commutative65.6%
*-commutative65.6%
Applied egg-rr65.6%
unpow165.6%
Simplified65.6%
if 2.9999999999999999e215 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
pow1100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
unpow1100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
+-commutative70.8%
unpow270.8%
fma-define70.8%
Simplified100.0%
Taylor expanded in t around inf 84.2%
Final simplification82.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 4.1e+73)
(* t_1 (sqrt (* 2.0 z)))
(if (<= t 2.8e+215)
(* (sqrt (* z (* 2.0 (fma t t 1.0)))) (- y))
(* t (* t_1 (* (sqrt 2.0) (sqrt z))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 4.1e+73) {
tmp = t_1 * sqrt((2.0 * z));
} else if (t <= 2.8e+215) {
tmp = sqrt((z * (2.0 * fma(t, t, 1.0)))) * -y;
} else {
tmp = t * (t_1 * (sqrt(2.0) * sqrt(z)));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 4.1e+73) tmp = Float64(t_1 * sqrt(Float64(2.0 * z))); elseif (t <= 2.8e+215) tmp = Float64(sqrt(Float64(z * Float64(2.0 * fma(t, t, 1.0)))) * Float64(-y)); else tmp = Float64(t * Float64(t_1 * Float64(sqrt(2.0) * sqrt(z)))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 4.1e+73], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e+215], N[(N[Sqrt[N[(z * N[(2.0 * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision], N[(t * N[(t$95$1 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 4.1 \cdot 10^{+73}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+215}:\\
\;\;\;\;\sqrt{z \cdot \left(2 \cdot \mathsf{fma}\left(t, t, 1\right)\right)} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(t\_1 \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if t < 4.0999999999999998e73Initial program 99.2%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
sqrt-unprod99.7%
associate-*l*99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 68.9%
if 4.0999999999999998e73 < t < 2.8e215Initial program 100.0%
Taylor expanded in x around 0 70.0%
associate-*l*70.0%
mul-1-neg70.0%
*-commutative70.0%
*-commutative70.0%
associate-*r*70.0%
sqrt-prod70.0%
*-commutative70.0%
pow270.0%
div-inv70.0%
metadata-eval70.0%
*-commutative70.0%
*-un-lft-identity70.0%
pow-exp70.0%
associate-*l*75.0%
pow-exp75.0%
*-un-lft-identity75.0%
*-commutative75.0%
exp-prod75.0%
pow1/275.0%
Applied egg-rr75.0%
distribute-lft-neg-in75.0%
*-commutative75.0%
associate-*r*75.0%
Simplified75.0%
Taylor expanded in t around 0 51.2%
+-commutative51.2%
unpow251.2%
fma-define51.2%
Simplified51.2%
if 2.8e215 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
pow1100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
unpow1100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
+-commutative70.8%
unpow270.8%
fma-define70.8%
Simplified100.0%
Taylor expanded in t around inf 84.2%
associate-*l*73.0%
*-commutative73.0%
associate-*r*73.0%
*-commutative73.0%
Simplified73.0%
Final simplification67.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 5.1e+160)
(* t_1 (* (sqrt (* 2.0 z)) (hypot 1.0 t)))
(if (<= t 2.05e+215)
(* (sqrt (* z (* 2.0 (fma t t 1.0)))) (- y))
(* (* t (* t_1 (sqrt 2.0))) (sqrt z))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 5.1e+160) {
tmp = t_1 * (sqrt((2.0 * z)) * hypot(1.0, t));
} else if (t <= 2.05e+215) {
tmp = sqrt((z * (2.0 * fma(t, t, 1.0)))) * -y;
} else {
tmp = (t * (t_1 * sqrt(2.0))) * sqrt(z);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 5.1e+160) tmp = Float64(t_1 * Float64(sqrt(Float64(2.0 * z)) * hypot(1.0, t))); elseif (t <= 2.05e+215) tmp = Float64(sqrt(Float64(z * Float64(2.0 * fma(t, t, 1.0)))) * Float64(-y)); else tmp = Float64(Float64(t * Float64(t_1 * sqrt(2.0))) * sqrt(z)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 5.1e+160], N[(t$95$1 * N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.05e+215], N[(N[Sqrt[N[(z * N[(2.0 * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision], N[(N[(t * N[(t$95$1 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 5.1 \cdot 10^{+160}:\\
\;\;\;\;t\_1 \cdot \left(\sqrt{2 \cdot z} \cdot \mathsf{hypot}\left(1, t\right)\right)\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{+215}:\\
\;\;\;\;\sqrt{z \cdot \left(2 \cdot \mathsf{fma}\left(t, t, 1\right)\right)} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \left(t\_1 \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\\
\end{array}
\end{array}
if t < 5.1000000000000001e160Initial program 99.3%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
sqrt-unprod99.7%
associate-*l*99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 82.3%
+-commutative44.1%
unpow244.1%
fma-define44.1%
Simplified82.3%
sqrt-prod81.0%
Applied egg-rr81.0%
*-commutative81.0%
fma-undefine81.0%
unpow281.0%
+-commutative81.0%
unpow281.0%
hypot-1-def77.7%
Simplified77.7%
if 5.1000000000000001e160 < t < 2.0500000000000002e215Initial program 100.0%
Taylor expanded in x around 0 75.0%
associate-*l*75.0%
mul-1-neg75.0%
*-commutative75.0%
*-commutative75.0%
associate-*r*75.0%
sqrt-prod75.0%
*-commutative75.0%
pow275.0%
div-inv75.0%
metadata-eval75.0%
*-commutative75.0%
*-un-lft-identity75.0%
pow-exp75.0%
associate-*l*87.5%
pow-exp87.5%
*-un-lft-identity87.5%
*-commutative87.5%
exp-prod87.5%
pow1/287.5%
Applied egg-rr87.5%
distribute-lft-neg-in87.5%
*-commutative87.5%
associate-*r*87.5%
Simplified87.5%
Taylor expanded in t around 0 87.5%
+-commutative87.5%
unpow287.5%
fma-define87.5%
Simplified87.5%
if 2.0500000000000002e215 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
pow1100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
unpow1100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
+-commutative70.8%
unpow270.8%
fma-define70.8%
Simplified100.0%
Taylor expanded in t around inf 84.2%
Final simplification78.6%
(FPCore (x y z t) :precision binary64 (if (<= t 7.2e+73) (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (* (sqrt (* z (* 2.0 (fma t t 1.0)))) (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 7.2e+73) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else {
tmp = sqrt((z * (2.0 * fma(t, t, 1.0)))) * -y;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 7.2e+73) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); else tmp = Float64(sqrt(Float64(z * Float64(2.0 * fma(t, t, 1.0)))) * Float64(-y)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 7.2e+73], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(z * N[(2.0 * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7.2 \cdot 10^{+73}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z \cdot \left(2 \cdot \mathsf{fma}\left(t, t, 1\right)\right)} \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < 7.1999999999999998e73Initial program 99.2%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
sqrt-unprod99.7%
associate-*l*99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 68.9%
if 7.1999999999999998e73 < t Initial program 100.0%
Taylor expanded in x around 0 70.5%
associate-*l*70.5%
mul-1-neg70.5%
*-commutative70.5%
*-commutative70.5%
associate-*r*70.5%
sqrt-prod70.5%
*-commutative70.5%
pow270.5%
div-inv70.5%
metadata-eval70.5%
*-commutative70.5%
*-un-lft-identity70.5%
pow-exp70.5%
associate-*l*72.7%
pow-exp72.7%
*-un-lft-identity72.7%
*-commutative72.7%
exp-prod72.7%
pow1/272.7%
Applied egg-rr72.7%
distribute-lft-neg-in72.7%
*-commutative72.7%
associate-*r*72.7%
Simplified72.7%
Taylor expanded in t around 0 61.9%
+-commutative61.9%
unpow261.9%
fma-define61.9%
Simplified61.9%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (* (exp (/ (* t t) 2.0)) (* (- (* x 0.5) y) (sqrt (* 2.0 z)))))
double code(double x, double y, double z, double t) {
return exp(((t * t) / 2.0)) * (((x * 0.5) - y) * sqrt((2.0 * z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = exp(((t * t) / 2.0d0)) * (((x * 0.5d0) - y) * sqrt((2.0d0 * z)))
end function
public static double code(double x, double y, double z, double t) {
return Math.exp(((t * t) / 2.0)) * (((x * 0.5) - y) * Math.sqrt((2.0 * z)));
}
def code(x, y, z, t): return math.exp(((t * t) / 2.0)) * (((x * 0.5) - y) * math.sqrt((2.0 * z)))
function code(x, y, z, t) return Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z)))) end
function tmp = code(x, y, z, t) tmp = exp(((t * t) / 2.0)) * (((x * 0.5) - y) * sqrt((2.0 * z))); end
code[x_, y_, z_, t_] := N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{\frac{t \cdot t}{2}} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right)
\end{array}
Initial program 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (<= t 1.3e+112) (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (* t (* (sqrt z) (* y (- (sqrt 2.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.3e+112) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else {
tmp = t * (sqrt(z) * (y * -sqrt(2.0)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.3d+112) then
tmp = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
else
tmp = t * (sqrt(z) * (y * -sqrt(2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.3e+112) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else {
tmp = t * (Math.sqrt(z) * (y * -Math.sqrt(2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.3e+112: tmp = ((x * 0.5) - y) * math.sqrt((2.0 * z)) else: tmp = t * (math.sqrt(z) * (y * -math.sqrt(2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.3e+112) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); else tmp = Float64(t * Float64(sqrt(z) * Float64(y * Float64(-sqrt(2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.3e+112) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); else tmp = t * (sqrt(z) * (y * -sqrt(2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.3e+112], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[z], $MachinePrecision] * N[(y * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.3 \cdot 10^{+112}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\sqrt{z} \cdot \left(y \cdot \left(-\sqrt{2}\right)\right)\right)\\
\end{array}
\end{array}
if t < 1.3e112Initial program 99.2%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
sqrt-unprod99.7%
associate-*l*99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 67.2%
if 1.3e112 < t Initial program 100.0%
Taylor expanded in x around 0 75.7%
associate-*l*75.7%
mul-1-neg75.7%
*-commutative75.7%
*-commutative75.7%
associate-*r*75.7%
sqrt-prod75.7%
*-commutative75.7%
pow275.7%
div-inv75.7%
metadata-eval75.7%
*-commutative75.7%
*-un-lft-identity75.7%
pow-exp75.7%
associate-*l*78.4%
pow-exp78.4%
*-un-lft-identity78.4%
*-commutative78.4%
exp-prod78.4%
pow1/278.4%
Applied egg-rr78.4%
distribute-lft-neg-in78.4%
*-commutative78.4%
associate-*r*78.4%
Simplified78.4%
Taylor expanded in t around 0 70.6%
+-commutative70.6%
unpow270.6%
fma-define70.6%
Simplified70.6%
Taylor expanded in t around inf 47.4%
mul-1-neg47.4%
associate-*l*37.4%
*-commutative37.4%
*-commutative37.4%
Simplified37.4%
Final simplification62.9%
(FPCore (x y z t) :precision binary64 (if (<= t 1.35e+114) (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (* (sqrt z) (* (- y) (* t (sqrt 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.35e+114) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else {
tmp = sqrt(z) * (-y * (t * sqrt(2.0)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.35d+114) then
tmp = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
else
tmp = sqrt(z) * (-y * (t * sqrt(2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.35e+114) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else {
tmp = Math.sqrt(z) * (-y * (t * Math.sqrt(2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.35e+114: tmp = ((x * 0.5) - y) * math.sqrt((2.0 * z)) else: tmp = math.sqrt(z) * (-y * (t * math.sqrt(2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.35e+114) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); else tmp = Float64(sqrt(z) * Float64(Float64(-y) * Float64(t * sqrt(2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.35e+114) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); else tmp = sqrt(z) * (-y * (t * sqrt(2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.35e+114], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[z], $MachinePrecision] * N[((-y) * N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.35 \cdot 10^{+114}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z} \cdot \left(\left(-y\right) \cdot \left(t \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if t < 1.35e114Initial program 99.2%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
sqrt-unprod99.7%
associate-*l*99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 67.2%
if 1.35e114 < t Initial program 100.0%
Taylor expanded in x around 0 75.7%
associate-*l*75.7%
mul-1-neg75.7%
*-commutative75.7%
*-commutative75.7%
associate-*r*75.7%
sqrt-prod75.7%
*-commutative75.7%
pow275.7%
div-inv75.7%
metadata-eval75.7%
*-commutative75.7%
*-un-lft-identity75.7%
pow-exp75.7%
associate-*l*78.4%
pow-exp78.4%
*-un-lft-identity78.4%
*-commutative78.4%
exp-prod78.4%
pow1/278.4%
Applied egg-rr78.4%
distribute-lft-neg-in78.4%
*-commutative78.4%
associate-*r*78.4%
Simplified78.4%
Taylor expanded in t around 0 70.6%
+-commutative70.6%
unpow270.6%
fma-define70.6%
Simplified70.6%
Taylor expanded in t around inf 47.4%
mul-1-neg47.4%
*-commutative47.4%
distribute-rgt-neg-in47.4%
*-commutative47.4%
associate-*r*47.4%
Simplified47.4%
Final simplification64.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))))
(if (or (<= x -4.5e+53) (not (<= x 5.5e-100)))
(* 0.5 (* x t_1))
(* y (- t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double tmp;
if ((x <= -4.5e+53) || !(x <= 5.5e-100)) {
tmp = 0.5 * (x * t_1);
} else {
tmp = y * -t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((2.0d0 * z))
if ((x <= (-4.5d+53)) .or. (.not. (x <= 5.5d-100))) then
tmp = 0.5d0 * (x * t_1)
else
tmp = y * -t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((2.0 * z));
double tmp;
if ((x <= -4.5e+53) || !(x <= 5.5e-100)) {
tmp = 0.5 * (x * t_1);
} else {
tmp = y * -t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) tmp = 0 if (x <= -4.5e+53) or not (x <= 5.5e-100): tmp = 0.5 * (x * t_1) else: tmp = y * -t_1 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) tmp = 0.0 if ((x <= -4.5e+53) || !(x <= 5.5e-100)) tmp = Float64(0.5 * Float64(x * t_1)); else tmp = Float64(y * Float64(-t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); tmp = 0.0; if ((x <= -4.5e+53) || ~((x <= 5.5e-100))) tmp = 0.5 * (x * t_1); else tmp = y * -t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x, -4.5e+53], N[Not[LessEqual[x, 5.5e-100]], $MachinePrecision]], N[(0.5 * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], N[(y * (-t$95$1)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{+53} \lor \neg \left(x \leq 5.5 \cdot 10^{-100}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-t\_1\right)\\
\end{array}
\end{array}
if x < -4.5000000000000002e53 or 5.50000000000000011e-100 < x Initial program 99.7%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
sqrt-unprod99.7%
associate-*l*99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 61.6%
Taylor expanded in x around inf 49.7%
pow149.7%
associate-*l*49.7%
sqrt-prod49.7%
Applied egg-rr49.7%
unpow149.7%
*-commutative49.7%
Simplified49.7%
if -4.5000000000000002e53 < x < 5.50000000000000011e-100Initial program 99.0%
Taylor expanded in x around 0 79.8%
associate-*l*79.8%
mul-1-neg79.8%
*-commutative79.8%
*-commutative79.8%
associate-*r*79.9%
sqrt-prod79.9%
*-commutative79.9%
pow279.9%
div-inv79.9%
metadata-eval79.9%
*-commutative79.9%
*-un-lft-identity79.9%
pow-exp79.9%
associate-*l*82.5%
pow-exp82.5%
*-un-lft-identity82.5%
*-commutative82.5%
exp-prod82.5%
pow1/282.5%
Applied egg-rr82.5%
distribute-lft-neg-in82.5%
*-commutative82.5%
associate-*r*82.5%
Simplified82.5%
Taylor expanded in t around 0 47.6%
distribute-rgt-neg-out47.6%
neg-sub047.6%
metadata-eval47.6%
Applied egg-rr47.6%
neg-sub047.6%
distribute-rgt-neg-in47.6%
*-commutative47.6%
Simplified47.6%
Final simplification48.8%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* 2.0 z))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt((2.0 * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt((2.0 * z));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt((2.0 * z))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}
\end{array}
Initial program 99.4%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 60.0%
Final simplification60.0%
(FPCore (x y z t) :precision binary64 (* y (- (sqrt (* 2.0 z)))))
double code(double x, double y, double z, double t) {
return y * -sqrt((2.0 * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * -sqrt((2.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return y * -Math.sqrt((2.0 * z));
}
def code(x, y, z, t): return y * -math.sqrt((2.0 * z))
function code(x, y, z, t) return Float64(y * Float64(-sqrt(Float64(2.0 * z)))) end
function tmp = code(x, y, z, t) tmp = y * -sqrt((2.0 * z)); end
code[x_, y_, z_, t_] := N[(y * (-N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-\sqrt{2 \cdot z}\right)
\end{array}
Initial program 99.4%
Taylor expanded in x around 0 57.7%
associate-*l*57.7%
mul-1-neg57.7%
*-commutative57.7%
*-commutative57.7%
associate-*r*57.7%
sqrt-prod57.8%
*-commutative57.8%
pow257.8%
div-inv57.8%
metadata-eval57.8%
*-commutative57.8%
*-un-lft-identity57.8%
pow-exp57.8%
associate-*l*59.3%
pow-exp59.3%
*-un-lft-identity59.3%
*-commutative59.3%
exp-prod59.3%
pow1/259.3%
Applied egg-rr59.3%
distribute-lft-neg-in59.3%
*-commutative59.3%
associate-*r*59.3%
Simplified59.3%
Taylor expanded in t around 0 29.1%
distribute-rgt-neg-out29.1%
neg-sub029.1%
metadata-eval29.1%
Applied egg-rr29.1%
neg-sub029.1%
distribute-rgt-neg-in29.1%
*-commutative29.1%
Simplified29.1%
Final simplification29.1%
(FPCore (x y z t) :precision binary64 (* y (sqrt (* 2.0 z))))
double code(double x, double y, double z, double t) {
return y * sqrt((2.0 * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * sqrt((2.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return y * Math.sqrt((2.0 * z));
}
def code(x, y, z, t): return y * math.sqrt((2.0 * z))
function code(x, y, z, t) return Float64(y * sqrt(Float64(2.0 * z))) end
function tmp = code(x, y, z, t) tmp = y * sqrt((2.0 * z)); end
code[x_, y_, z_, t_] := N[(y * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \sqrt{2 \cdot z}
\end{array}
Initial program 99.4%
Taylor expanded in x around 0 57.7%
associate-*l*57.7%
mul-1-neg57.7%
*-commutative57.7%
*-commutative57.7%
associate-*r*57.7%
sqrt-prod57.8%
*-commutative57.8%
pow257.8%
div-inv57.8%
metadata-eval57.8%
*-commutative57.8%
*-un-lft-identity57.8%
pow-exp57.8%
associate-*l*59.3%
pow-exp59.3%
*-un-lft-identity59.3%
*-commutative59.3%
exp-prod59.3%
pow1/259.3%
Applied egg-rr59.3%
distribute-lft-neg-in59.3%
*-commutative59.3%
associate-*r*59.3%
Simplified59.3%
Taylor expanded in t around 0 29.1%
add-sqr-sqrt16.6%
sqrt-unprod15.3%
sqr-neg15.3%
sqrt-unprod2.1%
add-sqr-sqrt3.3%
pow13.3%
metadata-eval3.3%
Applied egg-rr3.3%
unpow13.3%
*-commutative3.3%
*-commutative3.3%
Simplified3.3%
Final simplification3.3%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * pow(exp(1.0), ((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * (exp(1.0d0) ** ((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.pow(Math.exp(1.0), ((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.pow(math.exp(1.0), ((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * (exp(1.0) ^ Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * (exp(1.0) ^ ((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[Exp[1.0], $MachinePrecision], N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot {\left(e^{1}\right)}^{\left(\frac{t \cdot t}{2}\right)}
\end{array}
herbie shell --seed 2024067
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
:alt
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0)))
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))