
(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 13 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 (* (- (* 0.5 x) y) (sqrt (* 2.0 (* z (exp (pow t 2.0)))))))
double code(double x, double y, double z, double t) {
return ((0.5 * x) - 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 = ((0.5d0 * x) - y) * sqrt((2.0d0 * (z * exp((t ** 2.0d0)))))
end function
public static double code(double x, double y, double z, double t) {
return ((0.5 * x) - y) * Math.sqrt((2.0 * (z * Math.exp(Math.pow(t, 2.0)))));
}
def code(x, y, z, t): return ((0.5 * x) - y) * math.sqrt((2.0 * (z * math.exp(math.pow(t, 2.0)))))
function code(x, y, z, t) return Float64(Float64(Float64(0.5 * x) - y) * sqrt(Float64(2.0 * Float64(z * exp((t ^ 2.0)))))) end
function tmp = code(x, y, z, t) tmp = ((0.5 * x) - y) * sqrt((2.0 * (z * exp((t ^ 2.0))))); end
code[x_, y_, z_, t_] := N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(z * N[Exp[N[Power[t, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot \left(z \cdot e^{{t}^{2}}\right)}
\end{array}
Initial program 99.4%
*-commutative99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
exp-sqrt99.8%
associate-*r*99.4%
*-commutative99.4%
expm1-log1p-u55.6%
expm1-udef43.7%
Applied egg-rr44.1%
expm1-def56.0%
expm1-log1p99.8%
fma-neg99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))) (t_2 (- (* 0.5 x) y)))
(if (<= (* t t) 5000000000000.0)
(* t_2 (* t_1 (hypot 1.0 t)))
(if (<= (* t t) 1e+146)
(* (exp (/ (* t t) 2.0)) (* (* 0.5 x) t_1))
(* t_2 (sqrt (* 2.0 (* z (pow t 2.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double t_2 = (0.5 * x) - y;
double tmp;
if ((t * t) <= 5000000000000.0) {
tmp = t_2 * (t_1 * hypot(1.0, t));
} else if ((t * t) <= 1e+146) {
tmp = exp(((t * t) / 2.0)) * ((0.5 * x) * t_1);
} else {
tmp = t_2 * sqrt((2.0 * (z * pow(t, 2.0))));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((2.0 * z));
double t_2 = (0.5 * x) - y;
double tmp;
if ((t * t) <= 5000000000000.0) {
tmp = t_2 * (t_1 * Math.hypot(1.0, t));
} else if ((t * t) <= 1e+146) {
tmp = Math.exp(((t * t) / 2.0)) * ((0.5 * x) * t_1);
} else {
tmp = t_2 * Math.sqrt((2.0 * (z * Math.pow(t, 2.0))));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) t_2 = (0.5 * x) - y tmp = 0 if (t * t) <= 5000000000000.0: tmp = t_2 * (t_1 * math.hypot(1.0, t)) elif (t * t) <= 1e+146: tmp = math.exp(((t * t) / 2.0)) * ((0.5 * x) * t_1) else: tmp = t_2 * math.sqrt((2.0 * (z * math.pow(t, 2.0)))) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) t_2 = Float64(Float64(0.5 * x) - y) tmp = 0.0 if (Float64(t * t) <= 5000000000000.0) tmp = Float64(t_2 * Float64(t_1 * hypot(1.0, t))); elseif (Float64(t * t) <= 1e+146) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(Float64(0.5 * x) * t_1)); else tmp = Float64(t_2 * sqrt(Float64(2.0 * Float64(z * (t ^ 2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); t_2 = (0.5 * x) - y; tmp = 0.0; if ((t * t) <= 5000000000000.0) tmp = t_2 * (t_1 * hypot(1.0, t)); elseif ((t * t) <= 1e+146) tmp = exp(((t * t) / 2.0)) * ((0.5 * x) * t_1); else tmp = t_2 * sqrt((2.0 * (z * (t ^ 2.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 5000000000000.0], N[(t$95$2 * N[(t$95$1 * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 1e+146], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sqrt[N[(2.0 * N[(z * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
t_2 := 0.5 \cdot x - y\\
\mathbf{if}\;t \cdot t \leq 5000000000000:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \mathsf{hypot}\left(1, t\right)\right)\\
\mathbf{elif}\;t \cdot t \leq 10^{+146}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\left(0.5 \cdot x\right) \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sqrt{2 \cdot \left(z \cdot {t}^{2}\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 5e12Initial program 99.6%
*-commutative99.6%
associate-*l*99.6%
exp-sqrt99.6%
Simplified99.6%
exp-sqrt99.6%
associate-*r*99.6%
*-commutative99.6%
expm1-log1p-u58.8%
expm1-udef35.9%
Applied egg-rr35.9%
expm1-def58.8%
expm1-log1p99.6%
fma-neg99.6%
*-commutative99.6%
*-commutative99.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in t around 0 99.5%
distribute-rgt1-in99.5%
*-commutative99.5%
unpow299.5%
fma-def99.5%
Simplified99.5%
associate-*r*99.5%
sqrt-prod99.4%
Applied egg-rr99.4%
*-commutative99.4%
fma-udef99.4%
unpow299.4%
+-commutative99.4%
unpow299.4%
hypot-1-def99.4%
Simplified99.4%
if 5e12 < (*.f64 t t) < 9.99999999999999934e145Initial program 95.2%
Taylor expanded in x around inf 76.2%
*-commutative76.2%
associate-*r*76.2%
Simplified76.2%
expm1-log1p-u61.9%
expm1-udef38.1%
*-commutative38.1%
associate-*l*38.1%
*-commutative38.1%
sqrt-unprod38.1%
Applied egg-rr38.1%
expm1-def61.9%
expm1-log1p76.2%
associate-*r*76.2%
Simplified76.2%
if 9.99999999999999934e145 < (*.f64 t t) Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
exp-sqrt100.0%
associate-*r*100.0%
*-commutative100.0%
expm1-log1p-u50.0%
expm1-udef50.0%
Applied egg-rr50.0%
expm1-def50.0%
expm1-log1p100.0%
fma-neg100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 89.7%
distribute-rgt1-in89.7%
*-commutative89.7%
unpow289.7%
fma-def89.7%
Simplified89.7%
Taylor expanded in t around inf 89.7%
Final simplification93.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* 0.5 x) y)))
(if (<= (* t t) 5000000000000.0)
(* t_1 (sqrt (* 2.0 (* z (fma t t 1.0)))))
(if (<= (* t t) 1e+146)
(* (exp (/ (* t t) 2.0)) (* (* 0.5 x) (sqrt (* 2.0 z))))
(* t_1 (sqrt (* 2.0 (* z (pow t 2.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (0.5 * x) - y;
double tmp;
if ((t * t) <= 5000000000000.0) {
tmp = t_1 * sqrt((2.0 * (z * fma(t, t, 1.0))));
} else if ((t * t) <= 1e+146) {
tmp = exp(((t * t) / 2.0)) * ((0.5 * x) * sqrt((2.0 * z)));
} else {
tmp = t_1 * sqrt((2.0 * (z * pow(t, 2.0))));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(0.5 * x) - y) tmp = 0.0 if (Float64(t * t) <= 5000000000000.0) tmp = Float64(t_1 * sqrt(Float64(2.0 * Float64(z * fma(t, t, 1.0))))); elseif (Float64(t * t) <= 1e+146) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(Float64(0.5 * x) * sqrt(Float64(2.0 * z)))); else tmp = Float64(t_1 * sqrt(Float64(2.0 * Float64(z * (t ^ 2.0))))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 5000000000000.0], N[(t$95$1 * N[Sqrt[N[(2.0 * N[(z * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 1e+146], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(2.0 * N[(z * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.5 \cdot x - y\\
\mathbf{if}\;t \cdot t \leq 5000000000000:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z \cdot \mathsf{fma}\left(t, t, 1\right)\right)}\\
\mathbf{elif}\;t \cdot t \leq 10^{+146}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\left(0.5 \cdot x\right) \cdot \sqrt{2 \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z \cdot {t}^{2}\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 5e12Initial program 99.6%
*-commutative99.6%
associate-*l*99.6%
exp-sqrt99.6%
Simplified99.6%
exp-sqrt99.6%
associate-*r*99.6%
*-commutative99.6%
expm1-log1p-u58.8%
expm1-udef35.9%
Applied egg-rr35.9%
expm1-def58.8%
expm1-log1p99.6%
fma-neg99.6%
*-commutative99.6%
*-commutative99.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in t around 0 99.5%
distribute-rgt1-in99.5%
*-commutative99.5%
unpow299.5%
fma-def99.5%
Simplified99.5%
if 5e12 < (*.f64 t t) < 9.99999999999999934e145Initial program 95.2%
Taylor expanded in x around inf 76.2%
*-commutative76.2%
associate-*r*76.2%
Simplified76.2%
expm1-log1p-u61.9%
expm1-udef38.1%
*-commutative38.1%
associate-*l*38.1%
*-commutative38.1%
sqrt-unprod38.1%
Applied egg-rr38.1%
expm1-def61.9%
expm1-log1p76.2%
associate-*r*76.2%
Simplified76.2%
if 9.99999999999999934e145 < (*.f64 t t) Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
exp-sqrt100.0%
associate-*r*100.0%
*-commutative100.0%
expm1-log1p-u50.0%
expm1-udef50.0%
Applied egg-rr50.0%
expm1-def50.0%
expm1-log1p100.0%
fma-neg100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 89.7%
distribute-rgt1-in89.7%
*-commutative89.7%
unpow289.7%
fma-def89.7%
Simplified89.7%
Taylor expanded in t around inf 89.7%
Final simplification93.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* 0.5 x) y)))
(if (<= t 1.0)
(* t_1 (sqrt (* 2.0 z)))
(* t_1 (sqrt (* 2.0 (* z (pow t 2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (0.5 * x) - y;
double tmp;
if (t <= 1.0) {
tmp = t_1 * sqrt((2.0 * z));
} else {
tmp = t_1 * sqrt((2.0 * (z * pow(t, 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) :: t_1
real(8) :: tmp
t_1 = (0.5d0 * x) - y
if (t <= 1.0d0) then
tmp = t_1 * sqrt((2.0d0 * z))
else
tmp = t_1 * sqrt((2.0d0 * (z * (t ** 2.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (0.5 * x) - y;
double tmp;
if (t <= 1.0) {
tmp = t_1 * Math.sqrt((2.0 * z));
} else {
tmp = t_1 * Math.sqrt((2.0 * (z * Math.pow(t, 2.0))));
}
return tmp;
}
def code(x, y, z, t): t_1 = (0.5 * x) - y tmp = 0 if t <= 1.0: tmp = t_1 * math.sqrt((2.0 * z)) else: tmp = t_1 * math.sqrt((2.0 * (z * math.pow(t, 2.0)))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(0.5 * x) - y) tmp = 0.0 if (t <= 1.0) tmp = Float64(t_1 * sqrt(Float64(2.0 * z))); else tmp = Float64(t_1 * sqrt(Float64(2.0 * Float64(z * (t ^ 2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (0.5 * x) - y; tmp = 0.0; if (t <= 1.0) tmp = t_1 * sqrt((2.0 * z)); else tmp = t_1 * sqrt((2.0 * (z * (t ^ 2.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 1.0], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(2.0 * N[(z * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.5 \cdot x - y\\
\mathbf{if}\;t \leq 1:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z \cdot {t}^{2}\right)}\\
\end{array}
\end{array}
if t < 1Initial program 99.3%
*-commutative99.3%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 71.0%
if 1 < t Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
exp-sqrt100.0%
associate-*r*100.0%
*-commutative100.0%
expm1-log1p-u58.9%
expm1-udef58.9%
Applied egg-rr58.9%
expm1-def58.9%
expm1-log1p100.0%
fma-neg100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 79.5%
distribute-rgt1-in79.5%
*-commutative79.5%
unpow279.5%
fma-def79.5%
Simplified79.5%
Taylor expanded in t around inf 79.5%
Final simplification72.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* 0.5 x) y)))
(if (<= t 3.2e+47)
(* t_1 (* (sqrt (* 2.0 z)) (hypot 1.0 t)))
(* t_1 (sqrt (* 2.0 (* z (pow t 2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (0.5 * x) - y;
double tmp;
if (t <= 3.2e+47) {
tmp = t_1 * (sqrt((2.0 * z)) * hypot(1.0, t));
} else {
tmp = t_1 * sqrt((2.0 * (z * pow(t, 2.0))));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (0.5 * x) - y;
double tmp;
if (t <= 3.2e+47) {
tmp = t_1 * (Math.sqrt((2.0 * z)) * Math.hypot(1.0, t));
} else {
tmp = t_1 * Math.sqrt((2.0 * (z * Math.pow(t, 2.0))));
}
return tmp;
}
def code(x, y, z, t): t_1 = (0.5 * x) - y tmp = 0 if t <= 3.2e+47: tmp = t_1 * (math.sqrt((2.0 * z)) * math.hypot(1.0, t)) else: tmp = t_1 * math.sqrt((2.0 * (z * math.pow(t, 2.0)))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(0.5 * x) - y) tmp = 0.0 if (t <= 3.2e+47) tmp = Float64(t_1 * Float64(sqrt(Float64(2.0 * z)) * hypot(1.0, t))); else tmp = Float64(t_1 * sqrt(Float64(2.0 * Float64(z * (t ^ 2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (0.5 * x) - y; tmp = 0.0; if (t <= 3.2e+47) tmp = t_1 * (sqrt((2.0 * z)) * hypot(1.0, t)); else tmp = t_1 * sqrt((2.0 * (z * (t ^ 2.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 3.2e+47], N[(t$95$1 * N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(2.0 * N[(z * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.5 \cdot x - y\\
\mathbf{if}\;t \leq 3.2 \cdot 10^{+47}:\\
\;\;\;\;t\_1 \cdot \left(\sqrt{2 \cdot z} \cdot \mathsf{hypot}\left(1, t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z \cdot {t}^{2}\right)}\\
\end{array}
\end{array}
if t < 3.2e47Initial program 99.3%
*-commutative99.3%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
exp-sqrt99.8%
associate-*r*99.3%
*-commutative99.3%
expm1-log1p-u55.0%
expm1-udef40.1%
Applied egg-rr40.6%
expm1-def55.5%
expm1-log1p99.8%
fma-neg99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in t around 0 90.7%
distribute-rgt1-in90.7%
*-commutative90.7%
unpow290.7%
fma-def90.7%
Simplified90.7%
associate-*r*90.7%
sqrt-prod88.9%
Applied egg-rr88.9%
*-commutative88.9%
fma-udef88.9%
unpow288.9%
+-commutative88.9%
unpow288.9%
hypot-1-def82.0%
Simplified82.0%
if 3.2e47 < t Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
exp-sqrt100.0%
associate-*r*100.0%
*-commutative100.0%
expm1-log1p-u57.7%
expm1-udef57.7%
Applied egg-rr57.7%
expm1-def57.7%
expm1-log1p100.0%
fma-neg100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 83.5%
distribute-rgt1-in83.5%
*-commutative83.5%
unpow283.5%
fma-def83.5%
Simplified83.5%
Taylor expanded in t around inf 83.5%
Final simplification82.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* 0.5 x) y)))
(if (<= t 1.0)
(* t_1 (sqrt (* 2.0 z)))
(* (sqrt z) (* t_1 (* t (sqrt 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (0.5 * x) - y;
double tmp;
if (t <= 1.0) {
tmp = t_1 * sqrt((2.0 * z));
} else {
tmp = sqrt(z) * (t_1 * (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) :: t_1
real(8) :: tmp
t_1 = (0.5d0 * x) - y
if (t <= 1.0d0) then
tmp = t_1 * sqrt((2.0d0 * z))
else
tmp = sqrt(z) * (t_1 * (t * sqrt(2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (0.5 * x) - y;
double tmp;
if (t <= 1.0) {
tmp = t_1 * Math.sqrt((2.0 * z));
} else {
tmp = Math.sqrt(z) * (t_1 * (t * Math.sqrt(2.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (0.5 * x) - y tmp = 0 if t <= 1.0: tmp = t_1 * math.sqrt((2.0 * z)) else: tmp = math.sqrt(z) * (t_1 * (t * math.sqrt(2.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(0.5 * x) - y) tmp = 0.0 if (t <= 1.0) tmp = Float64(t_1 * sqrt(Float64(2.0 * z))); else tmp = Float64(sqrt(z) * Float64(t_1 * Float64(t * sqrt(2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (0.5 * x) - y; tmp = 0.0; if (t <= 1.0) tmp = t_1 * sqrt((2.0 * z)); else tmp = sqrt(z) * (t_1 * (t * sqrt(2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 1.0], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[z], $MachinePrecision] * N[(t$95$1 * N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.5 \cdot x - y\\
\mathbf{if}\;t \leq 1:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z} \cdot \left(t\_1 \cdot \left(t \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if t < 1Initial program 99.3%
*-commutative99.3%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 71.0%
if 1 < t Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
exp-sqrt100.0%
associate-*r*100.0%
*-commutative100.0%
expm1-log1p-u58.9%
expm1-udef58.9%
Applied egg-rr58.9%
expm1-def58.9%
expm1-log1p100.0%
fma-neg100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 79.5%
distribute-rgt1-in79.5%
*-commutative79.5%
unpow279.5%
fma-def79.5%
Simplified79.5%
Taylor expanded in t around inf 52.3%
*-commutative52.3%
fma-neg52.3%
associate-*r*52.3%
*-commutative52.3%
fma-neg52.3%
Simplified52.3%
Final simplification66.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* 0.5 x) y)))
(if (<= t 3.2)
(* t_1 (sqrt (* 2.0 z)))
(* t_1 (cbrt (pow (* 2.0 z) 1.5))))))
double code(double x, double y, double z, double t) {
double t_1 = (0.5 * x) - y;
double tmp;
if (t <= 3.2) {
tmp = t_1 * sqrt((2.0 * z));
} else {
tmp = t_1 * cbrt(pow((2.0 * z), 1.5));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (0.5 * x) - y;
double tmp;
if (t <= 3.2) {
tmp = t_1 * Math.sqrt((2.0 * z));
} else {
tmp = t_1 * Math.cbrt(Math.pow((2.0 * z), 1.5));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(0.5 * x) - y) tmp = 0.0 if (t <= 3.2) tmp = Float64(t_1 * sqrt(Float64(2.0 * z))); else tmp = Float64(t_1 * cbrt((Float64(2.0 * z) ^ 1.5))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 3.2], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[Power[N[(2.0 * z), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.5 \cdot x - y\\
\mathbf{if}\;t \leq 3.2:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\\
\end{array}
\end{array}
if t < 3.2000000000000002Initial program 99.3%
*-commutative99.3%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 71.0%
if 3.2000000000000002 < t Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 18.1%
*-commutative18.1%
*-commutative18.1%
associate-*l*18.1%
Simplified18.1%
add-cbrt-cube24.5%
pow1/324.5%
*-commutative24.5%
sqrt-prod24.5%
*-commutative24.5%
sqrt-prod24.5%
*-commutative24.5%
sqrt-prod24.5%
add-sqr-sqrt24.5%
pow124.5%
pow1/224.5%
pow-prod-up24.5%
*-commutative24.5%
metadata-eval24.5%
Applied egg-rr24.5%
unpow1/324.5%
Simplified24.5%
Final simplification60.9%
(FPCore (x y z t) :precision binary64 (* (exp (/ (* t t) 2.0)) (* (- (* 0.5 x) y) (sqrt (* 2.0 z)))))
double code(double x, double y, double z, double t) {
return exp(((t * t) / 2.0)) * (((0.5 * x) - 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)) * (((0.5d0 * x) - 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)) * (((0.5 * x) - y) * Math.sqrt((2.0 * z)));
}
def code(x, y, z, t): return math.exp(((t * t) / 2.0)) * (((0.5 * x) - y) * math.sqrt((2.0 * z)))
function code(x, y, z, t) return Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(Float64(Float64(0.5 * x) - y) * sqrt(Float64(2.0 * z)))) end
function tmp = code(x, y, z, t) tmp = exp(((t * t) / 2.0)) * (((0.5 * x) - 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[(0.5 * x), $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(0.5 \cdot x - 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.5e+136) (* (- (* 0.5 x) y) (sqrt (* 2.0 z))) (sqrt (* (pow x 2.0) (* 0.5 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.5e+136) {
tmp = ((0.5 * x) - y) * sqrt((2.0 * z));
} else {
tmp = sqrt((pow(x, 2.0) * (0.5 * z)));
}
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.5d+136) then
tmp = ((0.5d0 * x) - y) * sqrt((2.0d0 * z))
else
tmp = sqrt(((x ** 2.0d0) * (0.5d0 * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.5e+136) {
tmp = ((0.5 * x) - y) * Math.sqrt((2.0 * z));
} else {
tmp = Math.sqrt((Math.pow(x, 2.0) * (0.5 * z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.5e+136: tmp = ((0.5 * x) - y) * math.sqrt((2.0 * z)) else: tmp = math.sqrt((math.pow(x, 2.0) * (0.5 * z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.5e+136) tmp = Float64(Float64(Float64(0.5 * x) - y) * sqrt(Float64(2.0 * z))); else tmp = sqrt(Float64((x ^ 2.0) * Float64(0.5 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.5e+136) tmp = ((0.5 * x) - y) * sqrt((2.0 * z)); else tmp = sqrt(((x ^ 2.0) * (0.5 * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.5e+136], N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[Power[x, 2.0], $MachinePrecision] * N[(0.5 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.5 \cdot 10^{+136}:\\
\;\;\;\;\left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{x}^{2} \cdot \left(0.5 \cdot z\right)}\\
\end{array}
\end{array}
if t < 1.49999999999999989e136Initial program 99.3%
*-commutative99.3%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 67.3%
if 1.49999999999999989e136 < t Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 10.2%
sub-neg10.2%
*-commutative10.2%
fma-udef10.2%
add-sqr-sqrt5.9%
pow15.9%
unpow25.9%
metadata-eval5.9%
pow-prod-up5.9%
pow-prod-down26.6%
Applied egg-rr35.0%
unpow1/235.0%
*-commutative35.0%
Simplified35.0%
Taylor expanded in x around inf 21.1%
*-commutative21.1%
associate-*l*21.1%
Simplified21.1%
Final simplification60.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))))
(if (or (<= x -2.6e+158) (not (<= x 2.8e-40)))
(* 0.5 (* x t_1))
(* t_1 (- y)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double tmp;
if ((x <= -2.6e+158) || !(x <= 2.8e-40)) {
tmp = 0.5 * (x * t_1);
} 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 ((x <= (-2.6d+158)) .or. (.not. (x <= 2.8d-40))) then
tmp = 0.5d0 * (x * t_1)
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 ((x <= -2.6e+158) || !(x <= 2.8e-40)) {
tmp = 0.5 * (x * t_1);
} else {
tmp = t_1 * -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) tmp = 0 if (x <= -2.6e+158) or not (x <= 2.8e-40): tmp = 0.5 * (x * t_1) else: tmp = t_1 * -y return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) tmp = 0.0 if ((x <= -2.6e+158) || !(x <= 2.8e-40)) tmp = Float64(0.5 * Float64(x * t_1)); 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 ((x <= -2.6e+158) || ~((x <= 2.8e-40))) tmp = 0.5 * (x * t_1); 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[Or[LessEqual[x, -2.6e+158], N[Not[LessEqual[x, 2.8e-40]], $MachinePrecision]], N[(0.5 * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * (-y)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+158} \lor \neg \left(x \leq 2.8 \cdot 10^{-40}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(-y\right)\\
\end{array}
\end{array}
if x < -2.6e158 or 2.8e-40 < x Initial program 99.8%
*-commutative99.8%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 67.5%
sub-neg67.5%
distribute-lft-in67.5%
*-commutative67.5%
*-commutative67.5%
add-sqr-sqrt28.9%
sqrt-unprod52.2%
sqr-neg52.2%
sqrt-unprod31.2%
add-sqr-sqrt51.2%
Applied egg-rr51.2%
distribute-lft-out52.2%
fma-udef52.2%
*-commutative52.2%
Simplified52.2%
Taylor expanded in x around inf 53.6%
associate-*r*53.6%
*-commutative53.6%
Simplified53.6%
expm1-log1p-u35.2%
expm1-udef30.0%
*-commutative30.0%
associate-*r*30.0%
associate-*l*30.0%
sqrt-prod30.0%
Applied egg-rr30.0%
expm1-def35.3%
expm1-log1p53.7%
associate-*l*53.7%
*-commutative53.7%
Simplified53.7%
if -2.6e158 < x < 2.8e-40Initial program 99.2%
*-commutative99.2%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 54.4%
Taylor expanded in x around 0 42.6%
mul-1-neg42.6%
associate-*l*42.6%
distribute-rgt-neg-in42.6%
*-commutative42.6%
distribute-rgt-neg-in42.6%
Simplified42.6%
Applied egg-rr42.8%
distribute-lft-neg-in42.8%
Simplified42.8%
Final simplification47.0%
(FPCore (x y z t) :precision binary64 (if (<= t 3.5e+144) (* (- (* 0.5 x) y) (sqrt (* 2.0 z))) (sqrt (* (* 2.0 z) (* y (+ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e+144) {
tmp = ((0.5 * x) - y) * sqrt((2.0 * z));
} else {
tmp = sqrt(((2.0 * z) * (y * (x + 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) :: tmp
if (t <= 3.5d+144) then
tmp = ((0.5d0 * x) - y) * sqrt((2.0d0 * z))
else
tmp = sqrt(((2.0d0 * z) * (y * (x + y))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e+144) {
tmp = ((0.5 * x) - y) * Math.sqrt((2.0 * z));
} else {
tmp = Math.sqrt(((2.0 * z) * (y * (x + y))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3.5e+144: tmp = ((0.5 * x) - y) * math.sqrt((2.0 * z)) else: tmp = math.sqrt(((2.0 * z) * (y * (x + y)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3.5e+144) tmp = Float64(Float64(Float64(0.5 * x) - y) * sqrt(Float64(2.0 * z))); else tmp = sqrt(Float64(Float64(2.0 * z) * Float64(y * Float64(x + y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.5e+144) tmp = ((0.5 * x) - y) * sqrt((2.0 * z)); else tmp = sqrt(((2.0 * z) * (y * (x + y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.5e+144], N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(y * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{+144}:\\
\;\;\;\;\left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(y \cdot \left(x + y\right)\right)}\\
\end{array}
\end{array}
if t < 3.4999999999999998e144Initial program 99.3%
*-commutative99.3%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 67.3%
if 3.4999999999999998e144 < t Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 10.2%
sub-neg10.2%
*-commutative10.2%
fma-udef10.2%
add-sqr-sqrt5.9%
pow15.9%
unpow25.9%
metadata-eval5.9%
pow-prod-up5.9%
pow-prod-down26.6%
Applied egg-rr35.0%
unpow1/235.0%
*-commutative35.0%
Simplified35.0%
Taylor expanded in x around 0 20.7%
+-commutative20.7%
unpow220.7%
distribute-rgt-out20.7%
Simplified20.7%
Final simplification60.9%
(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.4%
*-commutative99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 59.5%
Taylor expanded in x around 0 33.1%
mul-1-neg33.1%
associate-*l*33.1%
distribute-rgt-neg-in33.1%
*-commutative33.1%
distribute-rgt-neg-in33.1%
Simplified33.1%
Applied egg-rr33.1%
distribute-lft-neg-in33.1%
Simplified33.1%
Final simplification33.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%
*-commutative99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 59.5%
Taylor expanded in x around 0 33.1%
mul-1-neg33.1%
associate-*l*33.1%
distribute-rgt-neg-in33.1%
*-commutative33.1%
distribute-rgt-neg-in33.1%
Simplified33.1%
Applied egg-rr1.5%
expm1-def1.5%
expm1-log1p1.7%
Simplified1.7%
Final simplification1.7%
(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 2024040
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
:herbie-target
(* (* (- (* 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))))