
(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 15 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) (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.5%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
pow199.9%
sqrt-unprod99.9%
associate-*l*99.9%
pow-exp99.9%
pow299.9%
Applied egg-rr99.9%
unpow199.9%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y))
(t_2 (* (* t (* t_1 (sqrt 2.0))) (sqrt z)))
(t_3 (sqrt (* (* 2.0 z) (fma t t 1.0)))))
(if (<= t 0.00042)
(* t_1 (sqrt (* 2.0 z)))
(if (<= t 2.5e+156)
t_2
(if (<= t 3.2e+208)
(* y (- t_3))
(if (<= t 5e+256) t_2 (* t_3 (* x 0.5))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = (t * (t_1 * sqrt(2.0))) * sqrt(z);
double t_3 = sqrt(((2.0 * z) * fma(t, t, 1.0)));
double tmp;
if (t <= 0.00042) {
tmp = t_1 * sqrt((2.0 * z));
} else if (t <= 2.5e+156) {
tmp = t_2;
} else if (t <= 3.2e+208) {
tmp = y * -t_3;
} else if (t <= 5e+256) {
tmp = t_2;
} else {
tmp = t_3 * (x * 0.5);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) t_2 = Float64(Float64(t * Float64(t_1 * sqrt(2.0))) * sqrt(z)) t_3 = sqrt(Float64(Float64(2.0 * z) * fma(t, t, 1.0))) tmp = 0.0 if (t <= 0.00042) tmp = Float64(t_1 * sqrt(Float64(2.0 * z))); elseif (t <= 2.5e+156) tmp = t_2; elseif (t <= 3.2e+208) tmp = Float64(y * Float64(-t_3)); elseif (t <= 5e+256) tmp = t_2; else tmp = Float64(t_3 * Float64(x * 0.5)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * N[(t$95$1 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 0.00042], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+156], t$95$2, If[LessEqual[t, 3.2e+208], N[(y * (-t$95$3)), $MachinePrecision], If[LessEqual[t, 5e+256], t$95$2, N[(t$95$3 * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \left(t \cdot \left(t\_1 \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\\
t_3 := \sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\\
\mathbf{if}\;t \leq 0.00042:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+156}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+208}:\\
\;\;\;\;y \cdot \left(-t\_3\right)\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+256}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if t < 4.2000000000000002e-4Initial program 99.3%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 68.8%
if 4.2000000000000002e-4 < t < 2.49999999999999996e156 or 3.2000000000000001e208 < t < 5.00000000000000015e256Initial 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 53.9%
+-commutative53.9%
unpow253.9%
fma-define53.9%
Simplified53.9%
Taylor expanded in t around inf 55.8%
if 2.49999999999999996e156 < t < 3.2000000000000001e208Initial 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%
+-commutative100.0%
unpow2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 90.9%
neg-mul-190.9%
Simplified90.9%
if 5.00000000000000015e256 < 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%
+-commutative100.0%
unpow2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around inf 93.3%
Final simplification69.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (* t t) 2e-7) (not (<= (* t t) 1e+253))) (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (fma t t 1.0)))) (* (exp (/ (* t t) 2.0)) (* (sqrt (* 2.0 z)) (* x 0.5)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((t * t) <= 2e-7) || !((t * t) <= 1e+253)) {
tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) * fma(t, t, 1.0)));
} else {
tmp = exp(((t * t) / 2.0)) * (sqrt((2.0 * z)) * (x * 0.5));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((Float64(t * t) <= 2e-7) || !(Float64(t * t) <= 1e+253)) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) * fma(t, t, 1.0)))); else tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(sqrt(Float64(2.0 * z)) * Float64(x * 0.5))); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(t * t), $MachinePrecision], 2e-7], N[Not[LessEqual[N[(t * t), $MachinePrecision], 1e+253]], $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[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 2 \cdot 10^{-7} \lor \neg \left(t \cdot t \leq 10^{+253}\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}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\sqrt{2 \cdot z} \cdot \left(x \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 t t) < 1.9999999999999999e-7 or 9.9999999999999994e252 < (*.f64 t t) Initial program 99.4%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
pow199.9%
sqrt-unprod99.9%
associate-*l*99.9%
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 97.9%
+-commutative97.9%
unpow297.9%
fma-define97.9%
Simplified97.9%
if 1.9999999999999999e-7 < (*.f64 t t) < 9.9999999999999994e252Initial program 100.0%
Taylor expanded in x around inf 75.9%
*-commutative75.9%
associate-*l*75.9%
Simplified75.9%
pow175.9%
*-commutative75.9%
associate-*l*75.9%
sqrt-prod75.9%
*-commutative75.9%
Applied egg-rr75.9%
unpow175.9%
associate-*r*75.9%
Simplified75.9%
Final simplification93.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))))
(if (<= (* t t) 2e-7)
(* (- (* x 0.5) y) t_1)
(if (<= (* t t) INFINITY)
(* (exp (/ (* t t) 2.0)) (* t_1 (* x 0.5)))
(* (sqrt (* (* 2.0 z) (fma t t 1.0))) (* x 0.5))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double tmp;
if ((t * t) <= 2e-7) {
tmp = ((x * 0.5) - y) * t_1;
} else if ((t * t) <= ((double) INFINITY)) {
tmp = exp(((t * t) / 2.0)) * (t_1 * (x * 0.5));
} else {
tmp = sqrt(((2.0 * z) * fma(t, t, 1.0))) * (x * 0.5);
}
return tmp;
}
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) tmp = 0.0 if (Float64(t * t) <= 2e-7) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); elseif (Float64(t * t) <= Inf) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(t_1 * Float64(x * 0.5))); else tmp = Float64(sqrt(Float64(Float64(2.0 * z) * fma(t, t, 1.0))) * Float64(x * 0.5)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 2e-7], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], Infinity], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t \cdot t \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\
\mathbf{elif}\;t \cdot t \leq \infty:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(t\_1 \cdot \left(x \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)} \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if (*.f64 t t) < 1.9999999999999999e-7Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 99.3%
if 1.9999999999999999e-7 < (*.f64 t t) < +inf.0Initial program 99.2%
Taylor expanded in x around inf 72.9%
*-commutative72.9%
associate-*l*72.9%
Simplified72.9%
pow172.9%
*-commutative72.9%
associate-*l*72.9%
sqrt-prod72.9%
*-commutative72.9%
Applied egg-rr72.9%
unpow172.9%
associate-*r*72.9%
Simplified72.9%
if +inf.0 < (*.f64 t t) Initial program 99.5%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
pow199.9%
sqrt-unprod99.9%
associate-*l*99.9%
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 83.5%
+-commutative83.5%
unpow283.5%
fma-define83.5%
Simplified83.5%
Taylor expanded in x around inf 46.2%
Final simplification85.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 0.00042)
(* t_1 (sqrt (* 2.0 z)))
(if (<= t 6.4e+135)
(* t (* (sqrt 2.0) (* t_1 (sqrt z))))
(* (sqrt (* (* 2.0 z) (fma t t 1.0))) (* x 0.5))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 0.00042) {
tmp = t_1 * sqrt((2.0 * z));
} else if (t <= 6.4e+135) {
tmp = t * (sqrt(2.0) * (t_1 * sqrt(z)));
} else {
tmp = sqrt(((2.0 * z) * fma(t, t, 1.0))) * (x * 0.5);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 0.00042) tmp = Float64(t_1 * sqrt(Float64(2.0 * z))); elseif (t <= 6.4e+135) tmp = Float64(t * Float64(sqrt(2.0) * Float64(t_1 * sqrt(z)))); else tmp = Float64(sqrt(Float64(Float64(2.0 * z) * fma(t, t, 1.0))) * Float64(x * 0.5)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 0.00042], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.4e+135], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$1 * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 0.00042:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{+135}:\\
\;\;\;\;t \cdot \left(\sqrt{2} \cdot \left(t\_1 \cdot \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)} \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if t < 4.2000000000000002e-4Initial program 99.3%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 68.8%
if 4.2000000000000002e-4 < t < 6.3999999999999995e135Initial 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 42.2%
+-commutative42.2%
unpow242.2%
fma-define42.2%
Simplified42.2%
Taylor expanded in t around inf 44.8%
associate-*l*39.1%
*-commutative39.1%
associate-*r*39.1%
*-commutative39.1%
associate-*l*39.1%
Simplified39.1%
if 6.3999999999999995e135 < 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 95.0%
+-commutative95.0%
unpow295.0%
fma-define95.0%
Simplified95.0%
Taylor expanded in x around inf 79.1%
Final simplification66.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 0.00042)
(* t_1 (sqrt (* 2.0 z)))
(if (<= t 2.5e+156)
(* t (* (sqrt 2.0) (* t_1 (sqrt z))))
(* y (- (sqrt (* (* 2.0 z) (fma t t 1.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 0.00042) {
tmp = t_1 * sqrt((2.0 * z));
} else if (t <= 2.5e+156) {
tmp = t * (sqrt(2.0) * (t_1 * sqrt(z)));
} else {
tmp = y * -sqrt(((2.0 * z) * fma(t, t, 1.0)));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 0.00042) tmp = Float64(t_1 * sqrt(Float64(2.0 * z))); elseif (t <= 2.5e+156) tmp = Float64(t * Float64(sqrt(2.0) * Float64(t_1 * sqrt(z)))); else tmp = Float64(y * Float64(-sqrt(Float64(Float64(2.0 * z) * fma(t, t, 1.0))))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 0.00042], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+156], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$1 * N[Sqrt[z], $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}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 0.00042:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+156}:\\
\;\;\;\;t \cdot \left(\sqrt{2} \cdot \left(t\_1 \cdot \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-\sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\right)\\
\end{array}
\end{array}
if t < 4.2000000000000002e-4Initial program 99.3%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 68.8%
if 4.2000000000000002e-4 < t < 2.49999999999999996e156Initial 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 45.0%
+-commutative45.0%
unpow245.0%
fma-define45.0%
Simplified45.0%
Taylor expanded in t around inf 47.2%
associate-*l*39.7%
*-commutative39.7%
associate-*r*39.7%
*-commutative39.7%
associate-*l*39.7%
Simplified39.7%
if 2.49999999999999996e156 < 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%
+-commutative100.0%
unpow2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 81.8%
neg-mul-181.8%
Simplified81.8%
Final simplification66.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 9e+33)
(* t_1 (sqrt (* 2.0 z)))
(if (<= t 3.6e+97)
(sqrt (* (* 2.0 z) (pow t_1 2.0)))
(* y (- (sqrt (* (* 2.0 z) (fma t t 1.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 9e+33) {
tmp = t_1 * sqrt((2.0 * z));
} else if (t <= 3.6e+97) {
tmp = sqrt(((2.0 * z) * pow(t_1, 2.0)));
} else {
tmp = y * -sqrt(((2.0 * z) * fma(t, t, 1.0)));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 9e+33) tmp = Float64(t_1 * sqrt(Float64(2.0 * z))); elseif (t <= 3.6e+97) tmp = sqrt(Float64(Float64(2.0 * z) * (t_1 ^ 2.0))); else tmp = Float64(y * Float64(-sqrt(Float64(Float64(2.0 * z) * fma(t, t, 1.0))))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 9e+33], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e+97], N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[Power[t$95$1, 2.0], $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}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 9 \cdot 10^{+33}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+97}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot {t\_1}^{2}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-\sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\right)\\
\end{array}
\end{array}
if t < 9.0000000000000001e33Initial program 99.3%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
pow199.9%
sqrt-unprod99.9%
associate-*l*99.9%
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 67.0%
if 9.0000000000000001e33 < t < 3.59999999999999966e97Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
Taylor expanded in t around 0 5.0%
sqrt-prod5.0%
add-sqr-sqrt3.7%
sqrt-unprod34.7%
*-commutative34.7%
*-commutative34.7%
swap-sqr47.5%
add-sqr-sqrt47.5%
*-commutative47.5%
pow247.5%
Applied egg-rr47.5%
if 3.59999999999999966e97 < 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 94.1%
+-commutative94.1%
unpow294.1%
fma-define94.1%
Simplified94.1%
Taylor expanded in x around 0 70.6%
neg-mul-170.6%
Simplified70.6%
Final simplification66.5%
(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.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))))
(if (<= t 5e-22)
(* (- (* x 0.5) y) t_1)
(* t_1 (* y (+ (* 0.5 (/ x y)) -1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double tmp;
if (t <= 5e-22) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (y * ((0.5 * (x / y)) + -1.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) :: t_1
real(8) :: tmp
t_1 = sqrt((2.0d0 * z))
if (t <= 5d-22) then
tmp = ((x * 0.5d0) - y) * t_1
else
tmp = t_1 * (y * ((0.5d0 * (x / y)) + (-1.0d0)))
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 (t <= 5e-22) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (y * ((0.5 * (x / y)) + -1.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) tmp = 0 if t <= 5e-22: tmp = ((x * 0.5) - y) * t_1 else: tmp = t_1 * (y * ((0.5 * (x / y)) + -1.0)) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) tmp = 0.0 if (t <= 5e-22) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); else tmp = Float64(t_1 * Float64(y * Float64(Float64(0.5 * Float64(x / y)) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); tmp = 0.0; if (t <= 5e-22) tmp = ((x * 0.5) - y) * t_1; else tmp = t_1 * (y * ((0.5 * (x / y)) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 5e-22], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(y * N[(N[(0.5 * N[(x / y), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t \leq 5 \cdot 10^{-22}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(y \cdot \left(0.5 \cdot \frac{x}{y} + -1\right)\right)\\
\end{array}
\end{array}
if t < 4.99999999999999954e-22Initial program 99.3%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
pow199.9%
sqrt-unprod99.9%
associate-*l*99.9%
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 68.0%
if 4.99999999999999954e-22 < t Initial program 99.9%
Taylor expanded in t around 0 21.1%
Taylor expanded in y around inf 29.8%
Final simplification56.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))))
(if (<= y -4.8e-29)
(sqrt (* (* 2.0 z) (* y (- y x))))
(if (<= y 5.5e-156) (* t_1 (* x 0.5)) (* t_1 (- y))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double tmp;
if (y <= -4.8e-29) {
tmp = sqrt(((2.0 * z) * (y * (y - x))));
} else if (y <= 5.5e-156) {
tmp = t_1 * (x * 0.5);
} else {
tmp = t_1 * -y;
}
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 (y <= (-4.8d-29)) then
tmp = sqrt(((2.0d0 * z) * (y * (y - x))))
else if (y <= 5.5d-156) then
tmp = t_1 * (x * 0.5d0)
else
tmp = t_1 * -y
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 (y <= -4.8e-29) {
tmp = Math.sqrt(((2.0 * z) * (y * (y - x))));
} else if (y <= 5.5e-156) {
tmp = t_1 * (x * 0.5);
} else {
tmp = t_1 * -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) tmp = 0 if y <= -4.8e-29: tmp = math.sqrt(((2.0 * z) * (y * (y - x)))) elif y <= 5.5e-156: tmp = t_1 * (x * 0.5) else: tmp = t_1 * -y return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) tmp = 0.0 if (y <= -4.8e-29) tmp = sqrt(Float64(Float64(2.0 * z) * Float64(y * Float64(y - x)))); elseif (y <= 5.5e-156) tmp = Float64(t_1 * Float64(x * 0.5)); else tmp = Float64(t_1 * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); tmp = 0.0; if (y <= -4.8e-29) tmp = sqrt(((2.0 * z) * (y * (y - x)))); elseif (y <= 5.5e-156) tmp = t_1 * (x * 0.5); else tmp = t_1 * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -4.8e-29], N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(y * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 5.5e-156], N[(t$95$1 * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * (-y)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-29}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(y \cdot \left(y - x\right)\right)}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-156}:\\
\;\;\;\;t\_1 \cdot \left(x \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(-y\right)\\
\end{array}
\end{array}
if y < -4.79999999999999984e-29Initial program 99.9%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
Taylor expanded in t around 0 56.7%
sqrt-prod57.0%
add-sqr-sqrt49.7%
sqrt-unprod53.7%
*-commutative53.7%
*-commutative53.7%
swap-sqr52.3%
add-sqr-sqrt52.4%
*-commutative52.4%
pow252.4%
Applied egg-rr52.4%
Taylor expanded in x around 0 47.0%
+-commutative47.0%
unpow247.0%
associate-*r*47.0%
distribute-rgt-in51.1%
mul-1-neg51.1%
unsub-neg51.1%
Simplified51.1%
if -4.79999999999999984e-29 < y < 5.4999999999999998e-156Initial program 98.8%
Taylor expanded in t around 0 48.0%
Taylor expanded in x around inf 41.8%
if 5.4999999999999998e-156 < y Initial program 99.9%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
Taylor expanded in t around 0 57.5%
Taylor expanded in x around 0 49.8%
neg-mul-172.4%
Simplified49.8%
sqrt-prod50.0%
pow1/250.0%
*-commutative50.0%
Applied egg-rr50.0%
unpow1/250.0%
Simplified50.0%
Final simplification47.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (sqrt (* 2.0 z)))) (if (<= t 0.00034) (* (- (* x 0.5) y) t_1) (* t_1 (* x (- 0.5 (/ y x)))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double tmp;
if (t <= 0.00034) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (x * (0.5 - (y / x)));
}
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 (t <= 0.00034d0) then
tmp = ((x * 0.5d0) - y) * t_1
else
tmp = t_1 * (x * (0.5d0 - (y / x)))
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 (t <= 0.00034) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (x * (0.5 - (y / x)));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) tmp = 0 if t <= 0.00034: tmp = ((x * 0.5) - y) * t_1 else: tmp = t_1 * (x * (0.5 - (y / x))) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) tmp = 0.0 if (t <= 0.00034) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); else tmp = Float64(t_1 * Float64(x * Float64(0.5 - Float64(y / x)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); tmp = 0.0; if (t <= 0.00034) tmp = ((x * 0.5) - y) * t_1; else tmp = t_1 * (x * (0.5 - (y / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 0.00034], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(x * N[(0.5 - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t \leq 0.00034:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(x \cdot \left(0.5 - \frac{y}{x}\right)\right)\\
\end{array}
\end{array}
if t < 3.4e-4Initial program 99.3%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 68.8%
if 3.4e-4 < t Initial program 100.0%
Taylor expanded in t around 0 14.1%
Taylor expanded in x around inf 26.5%
mul-1-neg26.5%
unsub-neg26.5%
Simplified26.5%
Final simplification57.4%
(FPCore (x y z t) :precision binary64 (if (<= x 5.6e+125) (* (sqrt (* 2.0 z)) (- y)) (sqrt (* 0.5 (* z (* x x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 5.6e+125) {
tmp = sqrt((2.0 * z)) * -y;
} else {
tmp = sqrt((0.5 * (z * (x * x))));
}
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 (x <= 5.6d+125) then
tmp = sqrt((2.0d0 * z)) * -y
else
tmp = sqrt((0.5d0 * (z * (x * x))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 5.6e+125) {
tmp = Math.sqrt((2.0 * z)) * -y;
} else {
tmp = Math.sqrt((0.5 * (z * (x * x))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 5.6e+125: tmp = math.sqrt((2.0 * z)) * -y else: tmp = math.sqrt((0.5 * (z * (x * x)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 5.6e+125) tmp = Float64(sqrt(Float64(2.0 * z)) * Float64(-y)); else tmp = sqrt(Float64(0.5 * Float64(z * Float64(x * x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 5.6e+125) tmp = sqrt((2.0 * z)) * -y; else tmp = sqrt((0.5 * (z * (x * x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 5.6e+125], N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision], N[Sqrt[N[(0.5 * N[(z * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.6 \cdot 10^{+125}:\\
\;\;\;\;\sqrt{2 \cdot z} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 \cdot \left(z \cdot \left(x \cdot x\right)\right)}\\
\end{array}
\end{array}
if x < 5.6000000000000002e125Initial program 99.4%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
Taylor expanded in t around 0 52.6%
Taylor expanded in x around 0 36.7%
neg-mul-159.7%
Simplified36.7%
sqrt-prod36.9%
pow1/236.9%
*-commutative36.9%
Applied egg-rr36.9%
unpow1/236.9%
Simplified36.9%
if 5.6000000000000002e125 < x Initial program 99.9%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
Taylor expanded in t around 0 63.1%
sqrt-prod63.3%
add-sqr-sqrt60.0%
sqrt-unprod51.4%
*-commutative51.4%
*-commutative51.4%
swap-sqr45.2%
add-sqr-sqrt45.2%
*-commutative45.2%
pow245.2%
Applied egg-rr45.2%
Taylor expanded in x around inf 45.2%
unpow245.2%
Applied egg-rr45.2%
Final simplification37.9%
(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.5%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
pow199.9%
sqrt-unprod99.9%
associate-*l*99.9%
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 54.1%
(FPCore (x y z t) :precision binary64 (* (sqrt (* 2.0 z)) (- y)))
double code(double x, double y, double z, double t) {
return sqrt((2.0 * z)) * -y;
}
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 = sqrt((2.0d0 * z)) * -y
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((2.0 * z)) * -y;
}
def code(x, y, z, t): return math.sqrt((2.0 * z)) * -y
function code(x, y, z, t) return Float64(sqrt(Float64(2.0 * z)) * Float64(-y)) end
function tmp = code(x, y, z, t) tmp = sqrt((2.0 * z)) * -y; end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot z} \cdot \left(-y\right)
\end{array}
Initial program 99.5%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
Taylor expanded in t around 0 53.8%
Taylor expanded in x around 0 33.4%
neg-mul-154.6%
Simplified33.4%
sqrt-prod33.5%
pow1/233.5%
*-commutative33.5%
Applied egg-rr33.5%
unpow1/233.5%
Simplified33.5%
Final simplification33.5%
(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.5%
associate-*l*99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
Taylor expanded in t around 0 53.8%
Taylor expanded in x around 0 33.4%
neg-mul-154.6%
Simplified33.4%
sqrt-prod33.5%
pow1/233.5%
*-commutative33.5%
Applied egg-rr33.5%
unpow1/233.5%
Simplified33.5%
add-sqr-sqrt14.4%
pow1/214.4%
metadata-eval14.4%
pow-pow12.4%
sqrt-unprod15.0%
sqr-neg15.0%
sqrt-unprod1.5%
add-sqr-sqrt4.4%
pow14.4%
pow-pow2.2%
metadata-eval2.2%
pow1/22.2%
Applied egg-rr2.2%
unpow12.2%
*-commutative2.2%
Simplified2.2%
Final simplification2.2%
(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 2024110
(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))))