
(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 14 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 (* (* z 2.0) (exp (pow t 2.0))))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((z * 2.0) * 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(((z * 2.0d0) * 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(((z * 2.0) * Math.exp(Math.pow(t, 2.0))));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((z * 2.0) * math.exp(math.pow(t, 2.0))))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(z * 2.0) * exp((t ^ 2.0))))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((z * 2.0) * exp((t ^ 2.0)))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(z * 2.0), $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(z \cdot 2\right) \cdot e^{{t}^{2}}}
\end{array}
Initial program 99.5%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.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%
Simplified99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* z 2.0))))
(if (<= (* t t) 1e-19)
(* t_1 t_2)
(if (<= (* t t) 2e+266)
(* (exp (/ (* t t) 2.0)) (* 0.5 (* x t_2)))
(* t_1 (pow (* z (* 2.0 (fma t t 1.0))) 0.5))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = sqrt((z * 2.0));
double tmp;
if ((t * t) <= 1e-19) {
tmp = t_1 * t_2;
} else if ((t * t) <= 2e+266) {
tmp = exp(((t * t) / 2.0)) * (0.5 * (x * t_2));
} else {
tmp = t_1 * pow((z * (2.0 * fma(t, t, 1.0))), 0.5);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) t_2 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (Float64(t * t) <= 1e-19) tmp = Float64(t_1 * t_2); elseif (Float64(t * t) <= 2e+266) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(0.5 * Float64(x * t_2))); else tmp = Float64(t_1 * (Float64(z * Float64(2.0 * fma(t, t, 1.0))) ^ 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[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 1e-19], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 2e+266], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(0.5 * N[(x * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[(z * N[(2.0 * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \cdot t \leq 10^{-19}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;t \cdot t \leq 2 \cdot 10^{+266}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(0.5 \cdot \left(x \cdot t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {\left(z \cdot \left(2 \cdot \mathsf{fma}\left(t, t, 1\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if (*.f64 t t) < 9.9999999999999998e-20Initial program 99.7%
associate-*l*99.7%
remove-double-neg99.7%
remove-double-neg99.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%
Simplified99.7%
Taylor expanded in t around 0 99.3%
unpow1/299.3%
metadata-eval99.3%
pow-sqr99.2%
unpow1/299.2%
metadata-eval99.2%
pow-sqr99.0%
unswap-sqr99.0%
exp-to-pow94.5%
exp-to-pow94.5%
exp-sum94.5%
distribute-rgt-in94.5%
+-commutative94.5%
*-commutative94.5%
exp-prod94.6%
exp-sum94.5%
rem-exp-log94.5%
rem-exp-log99.4%
*-commutative99.4%
exp-to-pow94.5%
exp-to-pow94.5%
exp-sum94.5%
distribute-rgt-in94.5%
Simplified99.7%
if 9.9999999999999998e-20 < (*.f64 t t) < 2.0000000000000001e266Initial program 98.4%
Taylor expanded in x around inf 74.2%
Taylor expanded in z around -inf 0.0%
Simplified74.2%
if 2.0000000000000001e266 < (*.f64 t t) Initial program 100.0%
associate-*l*100.0%
remove-double-neg100.0%
remove-double-neg100.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%
Simplified100.0%
Taylor expanded in t around 0 97.6%
+-commutative97.6%
unpow297.6%
fma-define97.6%
Simplified97.6%
pow1/297.6%
associate-*l*98.8%
Applied egg-rr98.8%
Final simplification93.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* z 2.0))))
(if (<= (* t t) 1e-19)
(* t_1 t_2)
(if (<= (* t t) 2e+266)
(* (exp (/ (* t t) 2.0)) (* 0.5 (* x t_2)))
(* t_1 (sqrt (* (* z 2.0) (fma t t 1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = sqrt((z * 2.0));
double tmp;
if ((t * t) <= 1e-19) {
tmp = t_1 * t_2;
} else if ((t * t) <= 2e+266) {
tmp = exp(((t * t) / 2.0)) * (0.5 * (x * t_2));
} else {
tmp = t_1 * sqrt(((z * 2.0) * fma(t, t, 1.0)));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) t_2 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (Float64(t * t) <= 1e-19) tmp = Float64(t_1 * t_2); elseif (Float64(t * t) <= 2e+266) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(0.5 * Float64(x * t_2))); else tmp = Float64(t_1 * sqrt(Float64(Float64(z * 2.0) * 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]}, Block[{t$95$2 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 1e-19], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 2e+266], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(0.5 * N[(x * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \cdot t \leq 10^{-19}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;t \cdot t \leq 2 \cdot 10^{+266}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(0.5 \cdot \left(x \cdot t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 9.9999999999999998e-20Initial program 99.7%
associate-*l*99.7%
remove-double-neg99.7%
remove-double-neg99.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%
Simplified99.7%
Taylor expanded in t around 0 99.3%
unpow1/299.3%
metadata-eval99.3%
pow-sqr99.2%
unpow1/299.2%
metadata-eval99.2%
pow-sqr99.0%
unswap-sqr99.0%
exp-to-pow94.5%
exp-to-pow94.5%
exp-sum94.5%
distribute-rgt-in94.5%
+-commutative94.5%
*-commutative94.5%
exp-prod94.6%
exp-sum94.5%
rem-exp-log94.5%
rem-exp-log99.4%
*-commutative99.4%
exp-to-pow94.5%
exp-to-pow94.5%
exp-sum94.5%
distribute-rgt-in94.5%
Simplified99.7%
if 9.9999999999999998e-20 < (*.f64 t t) < 2.0000000000000001e266Initial program 98.4%
Taylor expanded in x around inf 74.2%
Taylor expanded in z around -inf 0.0%
Simplified74.2%
if 2.0000000000000001e266 < (*.f64 t t) Initial program 100.0%
associate-*l*100.0%
remove-double-neg100.0%
remove-double-neg100.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%
Simplified100.0%
Taylor expanded in t around 0 97.6%
+-commutative97.6%
unpow297.6%
fma-define97.6%
Simplified97.6%
Final simplification92.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 1.0)
(* t_1 (sqrt (* z 2.0)))
(if (<= t 4e+154)
(* (* t (* t_1 (sqrt 2.0))) (sqrt z))
(* (sqrt (* (* z 2.0) (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 <= 1.0) {
tmp = t_1 * sqrt((z * 2.0));
} else if (t <= 4e+154) {
tmp = (t * (t_1 * sqrt(2.0))) * sqrt(z);
} else {
tmp = sqrt(((z * 2.0) * 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 <= 1.0) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); elseif (t <= 4e+154) tmp = Float64(Float64(t * Float64(t_1 * sqrt(2.0))) * sqrt(z)); else tmp = Float64(sqrt(Float64(Float64(z * 2.0) * 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, 1.0], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e+154], N[(N[(t * N[(t$95$1 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(z * 2.0), $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 1:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+154}:\\
\;\;\;\;\left(t \cdot \left(t\_1 \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)} \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if t < 1Initial program 99.2%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.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%
Simplified99.8%
Taylor expanded in t around 0 71.6%
unpow1/271.6%
metadata-eval71.6%
pow-sqr71.5%
unpow1/271.5%
metadata-eval71.5%
pow-sqr71.4%
unswap-sqr71.4%
exp-to-pow68.4%
exp-to-pow68.4%
exp-sum68.5%
distribute-rgt-in68.5%
+-commutative68.5%
*-commutative68.5%
exp-prod68.5%
exp-sum68.4%
rem-exp-log68.4%
rem-exp-log71.6%
*-commutative71.6%
exp-to-pow68.4%
exp-to-pow68.4%
exp-sum68.4%
distribute-rgt-in68.4%
Simplified71.8%
if 1 < t < 4.00000000000000015e154Initial program 100.0%
associate-*l*100.0%
remove-double-neg100.0%
remove-double-neg100.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%
Simplified100.0%
Taylor expanded in t around 0 39.0%
+-commutative39.0%
unpow239.0%
fma-define39.0%
Simplified39.0%
Taylor expanded in t around inf 41.5%
if 4.00000000000000015e154 < t Initial program 100.0%
associate-*l*100.0%
remove-double-neg100.0%
remove-double-neg100.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%
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 78.6%
Final simplification68.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 2.6e+30)
(* t_1 (sqrt (* z 2.0)))
(if (<= t 9.8e+69)
(sqrt (* z (* 2.0 (pow t_1 2.0))))
(* (sqrt (* (* z 2.0) (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 <= 2.6e+30) {
tmp = t_1 * sqrt((z * 2.0));
} else if (t <= 9.8e+69) {
tmp = sqrt((z * (2.0 * pow(t_1, 2.0))));
} else {
tmp = sqrt(((z * 2.0) * 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 <= 2.6e+30) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); elseif (t <= 9.8e+69) tmp = sqrt(Float64(z * Float64(2.0 * (t_1 ^ 2.0)))); else tmp = Float64(sqrt(Float64(Float64(z * 2.0) * 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, 2.6e+30], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.8e+69], N[Sqrt[N[(z * N[(2.0 * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(z * 2.0), $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 2.6 \cdot 10^{+30}:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{+69}:\\
\;\;\;\;\sqrt{z \cdot \left(2 \cdot {t\_1}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)} \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if t < 2.59999999999999988e30Initial program 99.2%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.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%
Simplified99.8%
Taylor expanded in t around 0 70.6%
unpow1/270.6%
metadata-eval70.6%
pow-sqr70.5%
unpow1/270.5%
metadata-eval70.5%
pow-sqr70.4%
unswap-sqr70.4%
exp-to-pow67.5%
exp-to-pow67.5%
exp-sum67.6%
distribute-rgt-in67.6%
+-commutative67.6%
*-commutative67.6%
exp-prod67.6%
exp-sum67.5%
rem-exp-log67.5%
rem-exp-log70.7%
*-commutative70.7%
exp-to-pow67.5%
exp-to-pow67.5%
exp-sum67.5%
distribute-rgt-in67.5%
Simplified70.8%
if 2.59999999999999988e30 < t < 9.7999999999999999e69Initial program 100.0%
Taylor expanded in t around 0 13.0%
*-rgt-identity13.0%
add-sqr-sqrt11.6%
sqrt-unprod35.4%
*-commutative35.4%
*-commutative35.4%
swap-sqr51.4%
add-sqr-sqrt51.4%
pow251.4%
fmm-def51.4%
Applied egg-rr51.4%
associate-*l*51.4%
fmm-undef51.4%
*-commutative51.4%
Simplified51.4%
if 9.7999999999999999e69 < t Initial program 100.0%
associate-*l*100.0%
remove-double-neg100.0%
remove-double-neg100.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%
Simplified100.0%
Taylor expanded in t around 0 83.0%
+-commutative83.0%
unpow283.0%
fma-define83.0%
Simplified83.0%
Taylor expanded in x around inf 64.9%
Final simplification68.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* z 2.0))))
(if (<= t 2.3e+30)
(* t_1 t_2)
(if (<= t 1.4e+127)
(sqrt (* z (* 2.0 (pow t_1 2.0))))
(* t_1 (* t t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = sqrt((z * 2.0));
double tmp;
if (t <= 2.3e+30) {
tmp = t_1 * t_2;
} else if (t <= 1.4e+127) {
tmp = sqrt((z * (2.0 * pow(t_1, 2.0))));
} else {
tmp = t_1 * (t * t_2);
}
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) :: t_2
real(8) :: tmp
t_1 = (x * 0.5d0) - y
t_2 = sqrt((z * 2.0d0))
if (t <= 2.3d+30) then
tmp = t_1 * t_2
else if (t <= 1.4d+127) then
tmp = sqrt((z * (2.0d0 * (t_1 ** 2.0d0))))
else
tmp = t_1 * (t * t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = Math.sqrt((z * 2.0));
double tmp;
if (t <= 2.3e+30) {
tmp = t_1 * t_2;
} else if (t <= 1.4e+127) {
tmp = Math.sqrt((z * (2.0 * Math.pow(t_1, 2.0))));
} else {
tmp = t_1 * (t * t_2);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y t_2 = math.sqrt((z * 2.0)) tmp = 0 if t <= 2.3e+30: tmp = t_1 * t_2 elif t <= 1.4e+127: tmp = math.sqrt((z * (2.0 * math.pow(t_1, 2.0)))) else: tmp = t_1 * (t * t_2) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) t_2 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (t <= 2.3e+30) tmp = Float64(t_1 * t_2); elseif (t <= 1.4e+127) tmp = sqrt(Float64(z * Float64(2.0 * (t_1 ^ 2.0)))); else tmp = Float64(t_1 * Float64(t * t_2)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; t_2 = sqrt((z * 2.0)); tmp = 0.0; if (t <= 2.3e+30) tmp = t_1 * t_2; elseif (t <= 1.4e+127) tmp = sqrt((z * (2.0 * (t_1 ^ 2.0)))); else tmp = t_1 * (t * t_2); 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[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.3e+30], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[t, 1.4e+127], N[Sqrt[N[(z * N[(2.0 * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$1 * N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \leq 2.3 \cdot 10^{+30}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+127}:\\
\;\;\;\;\sqrt{z \cdot \left(2 \cdot {t\_1}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t \cdot t\_2\right)\\
\end{array}
\end{array}
if t < 2.3e30Initial program 99.2%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.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%
Simplified99.8%
Taylor expanded in t around 0 70.6%
unpow1/270.6%
metadata-eval70.6%
pow-sqr70.5%
unpow1/270.5%
metadata-eval70.5%
pow-sqr70.4%
unswap-sqr70.4%
exp-to-pow67.5%
exp-to-pow67.5%
exp-sum67.6%
distribute-rgt-in67.6%
+-commutative67.6%
*-commutative67.6%
exp-prod67.6%
exp-sum67.5%
rem-exp-log67.5%
rem-exp-log70.7%
*-commutative70.7%
exp-to-pow67.5%
exp-to-pow67.5%
exp-sum67.5%
distribute-rgt-in67.5%
Simplified70.8%
if 2.3e30 < t < 1.4000000000000001e127Initial program 100.0%
Taylor expanded in t around 0 15.1%
*-rgt-identity15.1%
add-sqr-sqrt13.6%
sqrt-unprod31.2%
*-commutative31.2%
*-commutative31.2%
swap-sqr38.3%
add-sqr-sqrt38.3%
pow238.3%
fmm-def38.3%
Applied egg-rr38.3%
associate-*l*38.3%
fmm-undef38.3%
*-commutative38.3%
Simplified38.3%
if 1.4000000000000001e127 < t Initial program 100.0%
associate-*l*100.0%
remove-double-neg100.0%
remove-double-neg100.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%
Simplified100.0%
Taylor expanded in t around 0 98.0%
+-commutative98.0%
unpow298.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in t around inf 55.6%
associate-*l*55.6%
Simplified55.6%
*-commutative55.6%
sqrt-prod55.6%
Applied egg-rr55.6%
Final simplification64.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (<= (* t t) 1e-19)
(* (- (* x 0.5) y) t_1)
(* (exp (/ (* t t) 2.0)) (* 0.5 (* x t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if ((t * t) <= 1e-19) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = exp(((t * t) / 2.0)) * (0.5 * (x * 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((z * 2.0d0))
if ((t * t) <= 1d-19) then
tmp = ((x * 0.5d0) - y) * t_1
else
tmp = exp(((t * t) / 2.0d0)) * (0.5d0 * (x * 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((z * 2.0));
double tmp;
if ((t * t) <= 1e-19) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = Math.exp(((t * t) / 2.0)) * (0.5 * (x * t_1));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if (t * t) <= 1e-19: tmp = ((x * 0.5) - y) * t_1 else: tmp = math.exp(((t * t) / 2.0)) * (0.5 * (x * t_1)) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (Float64(t * t) <= 1e-19) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); else tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(0.5 * Float64(x * t_1))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if ((t * t) <= 1e-19) tmp = ((x * 0.5) - y) * t_1; else tmp = exp(((t * t) / 2.0)) * (0.5 * (x * t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 1e-19], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(0.5 * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \cdot t \leq 10^{-19}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(0.5 \cdot \left(x \cdot t\_1\right)\right)\\
\end{array}
\end{array}
if (*.f64 t t) < 9.9999999999999998e-20Initial program 99.7%
associate-*l*99.7%
remove-double-neg99.7%
remove-double-neg99.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%
Simplified99.7%
Taylor expanded in t around 0 99.3%
unpow1/299.3%
metadata-eval99.3%
pow-sqr99.2%
unpow1/299.2%
metadata-eval99.2%
pow-sqr99.0%
unswap-sqr99.0%
exp-to-pow94.5%
exp-to-pow94.5%
exp-sum94.5%
distribute-rgt-in94.5%
+-commutative94.5%
*-commutative94.5%
exp-prod94.6%
exp-sum94.5%
rem-exp-log94.5%
rem-exp-log99.4%
*-commutative99.4%
exp-to-pow94.5%
exp-to-pow94.5%
exp-sum94.5%
distribute-rgt-in94.5%
Simplified99.7%
if 9.9999999999999998e-20 < (*.f64 t t) Initial program 99.3%
Taylor expanded in x around inf 75.9%
Taylor expanded in z around -inf 0.0%
Simplified75.9%
Final simplification86.6%
(FPCore (x y z t) :precision binary64 (if (<= t 1.25e+118) (* (- (* x 0.5) y) (* (sqrt (* z 2.0)) (hypot 1.0 t))) (* (sqrt (* (* z 2.0) (fma t t 1.0))) (* x 0.5))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.25e+118) {
tmp = ((x * 0.5) - y) * (sqrt((z * 2.0)) * hypot(1.0, t));
} else {
tmp = sqrt(((z * 2.0) * fma(t, t, 1.0))) * (x * 0.5);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 1.25e+118) tmp = Float64(Float64(Float64(x * 0.5) - y) * Float64(sqrt(Float64(z * 2.0)) * hypot(1.0, t))); else tmp = Float64(sqrt(Float64(Float64(z * 2.0) * fma(t, t, 1.0))) * Float64(x * 0.5)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.25e+118], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.25 \cdot 10^{+118}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \mathsf{hypot}\left(1, t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)} \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if t < 1.24999999999999993e118Initial program 99.3%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.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%
Simplified99.8%
Taylor expanded in t around 0 80.5%
+-commutative80.5%
unpow280.5%
fma-define80.5%
Simplified80.5%
sqrt-prod78.3%
Applied egg-rr78.3%
*-commutative78.3%
fma-undefine78.3%
unpow278.3%
+-commutative78.3%
unpow278.3%
hypot-1-def74.2%
Simplified74.2%
if 1.24999999999999993e118 < t Initial program 100.0%
associate-*l*100.0%
remove-double-neg100.0%
remove-double-neg100.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%
Simplified100.0%
Taylor expanded in t around 0 96.1%
+-commutative96.1%
unpow296.1%
fma-define96.1%
Simplified96.1%
Taylor expanded in x around inf 75.0%
Final simplification74.3%
(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}
Initial program 99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (or (<= x -3e+59) (not (<= x 1.1e+24)))
(* t_1 (* x 0.5))
(* y (- t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if ((x <= -3e+59) || !(x <= 1.1e+24)) {
tmp = t_1 * (x * 0.5);
} 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((z * 2.0d0))
if ((x <= (-3d+59)) .or. (.not. (x <= 1.1d+24))) then
tmp = t_1 * (x * 0.5d0)
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((z * 2.0));
double tmp;
if ((x <= -3e+59) || !(x <= 1.1e+24)) {
tmp = t_1 * (x * 0.5);
} else {
tmp = y * -t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if (x <= -3e+59) or not (x <= 1.1e+24): tmp = t_1 * (x * 0.5) else: tmp = y * -t_1 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if ((x <= -3e+59) || !(x <= 1.1e+24)) tmp = Float64(t_1 * Float64(x * 0.5)); else tmp = Float64(y * Float64(-t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if ((x <= -3e+59) || ~((x <= 1.1e+24))) tmp = t_1 * (x * 0.5); else tmp = y * -t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x, -3e+59], N[Not[LessEqual[x, 1.1e+24]], $MachinePrecision]], N[(t$95$1 * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], N[(y * (-t$95$1)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;x \leq -3 \cdot 10^{+59} \lor \neg \left(x \leq 1.1 \cdot 10^{+24}\right):\\
\;\;\;\;t\_1 \cdot \left(x \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-t\_1\right)\\
\end{array}
\end{array}
if x < -3e59 or 1.10000000000000001e24 < x Initial program 99.9%
Taylor expanded in t around 0 58.3%
Taylor expanded in x around inf 45.6%
*-commutative45.6%
Simplified46.5%
if -3e59 < x < 1.10000000000000001e24Initial program 99.1%
Taylor expanded in t around 0 50.2%
Taylor expanded in x around 0 43.1%
mul-1-neg43.1%
associate-*l*43.1%
*-commutative43.1%
unpow1/243.1%
metadata-eval43.1%
pow-sqr43.0%
unpow1/243.0%
metadata-eval43.0%
pow-sqr43.0%
unswap-sqr43.0%
exp-to-pow41.3%
exp-to-pow41.3%
exp-sum41.2%
distribute-rgt-in41.2%
+-commutative41.2%
*-commutative41.2%
exp-prod41.2%
exp-sum41.3%
rem-exp-log41.3%
rem-exp-log43.1%
*-commutative43.1%
Simplified43.2%
Final simplification44.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* z 2.0)))) (if (<= t 1.0) (* t_1 t_2) (* t_1 (* t t_2)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = sqrt((z * 2.0));
double tmp;
if (t <= 1.0) {
tmp = t_1 * t_2;
} else {
tmp = t_1 * (t * t_2);
}
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) :: t_2
real(8) :: tmp
t_1 = (x * 0.5d0) - y
t_2 = sqrt((z * 2.0d0))
if (t <= 1.0d0) then
tmp = t_1 * t_2
else
tmp = t_1 * (t * t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = Math.sqrt((z * 2.0));
double tmp;
if (t <= 1.0) {
tmp = t_1 * t_2;
} else {
tmp = t_1 * (t * t_2);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y t_2 = math.sqrt((z * 2.0)) tmp = 0 if t <= 1.0: tmp = t_1 * t_2 else: tmp = t_1 * (t * t_2) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) t_2 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (t <= 1.0) tmp = Float64(t_1 * t_2); else tmp = Float64(t_1 * Float64(t * t_2)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; t_2 = sqrt((z * 2.0)); tmp = 0.0; if (t <= 1.0) tmp = t_1 * t_2; else tmp = t_1 * (t * t_2); 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[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.0], N[(t$95$1 * t$95$2), $MachinePrecision], N[(t$95$1 * N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \leq 1:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t \cdot t\_2\right)\\
\end{array}
\end{array}
if t < 1Initial program 99.2%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.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%
Simplified99.8%
Taylor expanded in t around 0 71.6%
unpow1/271.6%
metadata-eval71.6%
pow-sqr71.5%
unpow1/271.5%
metadata-eval71.5%
pow-sqr71.4%
unswap-sqr71.4%
exp-to-pow68.4%
exp-to-pow68.4%
exp-sum68.5%
distribute-rgt-in68.5%
+-commutative68.5%
*-commutative68.5%
exp-prod68.5%
exp-sum68.4%
rem-exp-log68.4%
rem-exp-log71.6%
*-commutative71.6%
exp-to-pow68.4%
exp-to-pow68.4%
exp-sum68.4%
distribute-rgt-in68.4%
Simplified71.8%
if 1 < t Initial program 100.0%
associate-*l*100.0%
remove-double-neg100.0%
remove-double-neg100.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%
Simplified100.0%
Taylor expanded in t around 0 71.9%
+-commutative71.9%
unpow271.9%
fma-define71.9%
Simplified71.9%
Taylor expanded in t around inf 43.9%
associate-*l*43.9%
Simplified43.9%
*-commutative43.9%
sqrt-prod43.9%
Applied egg-rr43.9%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* z 2.0))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt((z * 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))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt((z * 2.0));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt((z * 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt((z * 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}
\end{array}
Initial program 99.5%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.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%
Simplified99.8%
Taylor expanded in t around 0 53.7%
unpow1/253.7%
metadata-eval53.7%
pow-sqr53.7%
unpow1/253.7%
metadata-eval53.7%
pow-sqr53.6%
unswap-sqr53.6%
exp-to-pow51.5%
exp-to-pow51.5%
exp-sum51.5%
distribute-rgt-in51.5%
+-commutative51.5%
*-commutative51.5%
exp-prod51.5%
exp-sum51.5%
rem-exp-log51.5%
rem-exp-log53.7%
*-commutative53.7%
exp-to-pow51.5%
exp-to-pow51.5%
exp-sum51.5%
distribute-rgt-in51.5%
Simplified53.9%
(FPCore (x y z t) :precision binary64 (* y (- (sqrt (* z 2.0)))))
double code(double x, double y, double z, double t) {
return y * -sqrt((z * 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 = y * -sqrt((z * 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return y * -Math.sqrt((z * 2.0));
}
def code(x, y, z, t): return y * -math.sqrt((z * 2.0))
function code(x, y, z, t) return Float64(y * Float64(-sqrt(Float64(z * 2.0)))) end
function tmp = code(x, y, z, t) tmp = y * -sqrt((z * 2.0)); end
code[x_, y_, z_, t_] := N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-\sqrt{z \cdot 2}\right)
\end{array}
Initial program 99.5%
Taylor expanded in t around 0 53.9%
Taylor expanded in x around 0 29.9%
mul-1-neg29.9%
associate-*l*29.9%
*-commutative29.9%
unpow1/229.9%
metadata-eval29.9%
pow-sqr29.9%
unpow1/229.9%
metadata-eval29.9%
pow-sqr29.9%
unswap-sqr29.9%
exp-to-pow28.7%
exp-to-pow28.7%
exp-sum28.7%
distribute-rgt-in28.7%
+-commutative28.7%
*-commutative28.7%
exp-prod28.7%
exp-sum28.7%
rem-exp-log28.7%
rem-exp-log29.9%
*-commutative29.9%
Simplified30.0%
Final simplification30.0%
(FPCore (x y z t) :precision binary64 (* y (sqrt (* z 2.0))))
double code(double x, double y, double z, double t) {
return y * sqrt((z * 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 = y * sqrt((z * 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return y * Math.sqrt((z * 2.0));
}
def code(x, y, z, t): return y * math.sqrt((z * 2.0))
function code(x, y, z, t) return Float64(y * sqrt(Float64(z * 2.0))) end
function tmp = code(x, y, z, t) tmp = y * sqrt((z * 2.0)); end
code[x_, y_, z_, t_] := N[(y * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \sqrt{z \cdot 2}
\end{array}
Initial program 99.5%
Taylor expanded in t around 0 53.9%
Taylor expanded in x around 0 29.9%
mul-1-neg29.9%
associate-*l*29.9%
*-commutative29.9%
unpow1/229.9%
metadata-eval29.9%
pow-sqr29.9%
unpow1/229.9%
metadata-eval29.9%
pow-sqr29.9%
unswap-sqr29.9%
exp-to-pow28.7%
exp-to-pow28.7%
exp-sum28.7%
distribute-rgt-in28.7%
+-commutative28.7%
*-commutative28.7%
exp-prod28.7%
exp-sum28.7%
rem-exp-log28.7%
rem-exp-log29.9%
*-commutative29.9%
Simplified30.0%
neg-sub030.0%
sub-neg30.0%
add-sqr-sqrt16.6%
sqrt-unprod16.2%
sqr-neg16.2%
sqrt-unprod1.3%
add-sqr-sqrt2.1%
Applied egg-rr2.1%
+-lft-identity2.1%
Simplified2.1%
Final simplification2.1%
(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 2024157
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
:alt
(! :herbie-platform default (* (* (- (* x 1/2) y) (sqrt (* z 2))) (pow (exp 1) (/ (* t t) 2))))
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))