
(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.4%
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)))
(if (<= (* t t) 4e-6)
(* t_1 (sqrt (* (* z 2.0) (fma t t 1.0))))
(if (<= (* t t) 5e+307)
(* (exp (/ (* t t) 2.0)) (* (sqrt (* z 2.0)) (- y)))
(* t_1 (sqrt (* 2.0 (* z (pow t 2.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if ((t * t) <= 4e-6) {
tmp = t_1 * sqrt(((z * 2.0) * fma(t, t, 1.0)));
} else if ((t * t) <= 5e+307) {
tmp = exp(((t * t) / 2.0)) * (sqrt((z * 2.0)) * -y);
} else {
tmp = t_1 * sqrt((2.0 * (z * pow(t, 2.0))));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (Float64(t * t) <= 4e-6) tmp = Float64(t_1 * sqrt(Float64(Float64(z * 2.0) * fma(t, t, 1.0)))); elseif (Float64(t * t) <= 5e+307) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(sqrt(Float64(z * 2.0)) * Float64(-y))); 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[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 4e-6], N[(t$95$1 * N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 5e+307], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * (-y)), $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 := x \cdot 0.5 - y\\
\mathbf{if}\;t \cdot t \leq 4 \cdot 10^{-6}:\\
\;\;\;\;t\_1 \cdot \sqrt{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\\
\mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+307}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\sqrt{z \cdot 2} \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z \cdot {t}^{2}\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 3.99999999999999982e-6Initial program 99.7%
associate-*l*99.7%
remove-double-neg99.7%
remove-double-neg99.7%
exp-sqrt99.6%
exp-prod99.6%
Simplified99.6%
pow199.6%
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%
+-commutative99.3%
unpow299.3%
fma-define99.3%
Simplified99.3%
if 3.99999999999999982e-6 < (*.f64 t t) < 5e307Initial program 98.4%
add-sqr-sqrt51.6%
pow251.6%
Applied egg-rr51.6%
Taylor expanded in x around 0 82.8%
neg-mul-182.8%
Simplified82.8%
if 5e307 < (*.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 100.0%
+-commutative100.0%
unpow2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
Final simplification95.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* z 2.0))))
(if (<= (* t t) 5e-18)
(* t_1 t_2)
(if (<= (* t t) 5e+307)
(* (exp (/ (* t t) 2.0)) (* t_2 (- y)))
(* t_1 (sqrt (* 2.0 (* z (pow t 2.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) <= 5e-18) {
tmp = t_1 * t_2;
} else if ((t * t) <= 5e+307) {
tmp = exp(((t * t) / 2.0)) * (t_2 * -y);
} 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) :: t_2
real(8) :: tmp
t_1 = (x * 0.5d0) - y
t_2 = sqrt((z * 2.0d0))
if ((t * t) <= 5d-18) then
tmp = t_1 * t_2
else if ((t * t) <= 5d+307) then
tmp = exp(((t * t) / 2.0d0)) * (t_2 * -y)
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 = (x * 0.5) - y;
double t_2 = Math.sqrt((z * 2.0));
double tmp;
if ((t * t) <= 5e-18) {
tmp = t_1 * t_2;
} else if ((t * t) <= 5e+307) {
tmp = Math.exp(((t * t) / 2.0)) * (t_2 * -y);
} else {
tmp = t_1 * Math.sqrt((2.0 * (z * Math.pow(t, 2.0))));
}
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 * t) <= 5e-18: tmp = t_1 * t_2 elif (t * t) <= 5e+307: tmp = math.exp(((t * t) / 2.0)) * (t_2 * -y) 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(x * 0.5) - y) t_2 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (Float64(t * t) <= 5e-18) tmp = Float64(t_1 * t_2); elseif (Float64(t * t) <= 5e+307) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(t_2 * Float64(-y))); 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 = (x * 0.5) - y; t_2 = sqrt((z * 2.0)); tmp = 0.0; if ((t * t) <= 5e-18) tmp = t_1 * t_2; elseif ((t * t) <= 5e+307) tmp = exp(((t * t) / 2.0)) * (t_2 * -y); 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[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 5e-18], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 5e+307], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * (-y)), $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 := x \cdot 0.5 - y\\
t_2 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \cdot t \leq 5 \cdot 10^{-18}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+307}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(t\_2 \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z \cdot {t}^{2}\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 5.00000000000000036e-18Initial 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.1%
unpow1/299.1%
metadata-eval99.1%
pow-sqr99.0%
unswap-sqr99.0%
*-commutative99.0%
exp-to-pow99.0%
exp-to-pow95.0%
exp-sum94.6%
distribute-rgt-in94.6%
*-commutative94.6%
exp-prod94.6%
exp-sum95.0%
rem-exp-log95.0%
rem-exp-log99.3%
*-commutative99.3%
Simplified99.7%
if 5.00000000000000036e-18 < (*.f64 t t) < 5e307Initial program 98.5%
add-sqr-sqrt50.7%
pow250.7%
Applied egg-rr50.7%
Taylor expanded in x around 0 81.8%
neg-mul-181.8%
Simplified81.8%
if 5e307 < (*.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 100.0%
+-commutative100.0%
unpow2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
Final simplification95.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* z 2.0))))
(if (<= t 880.0)
(* t_1 t_2)
(if (<= t 5.2e+220)
(sqrt (* (* z 2.0) (pow t_1 2.0)))
(* t_2 (* x (- 0.5 (/ y x))))))))
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 <= 880.0) {
tmp = t_1 * t_2;
} else if (t <= 5.2e+220) {
tmp = sqrt(((z * 2.0) * pow(t_1, 2.0)));
} else {
tmp = t_2 * (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) :: t_2
real(8) :: tmp
t_1 = (x * 0.5d0) - y
t_2 = sqrt((z * 2.0d0))
if (t <= 880.0d0) then
tmp = t_1 * t_2
else if (t <= 5.2d+220) then
tmp = sqrt(((z * 2.0d0) * (t_1 ** 2.0d0)))
else
tmp = t_2 * (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 = (x * 0.5) - y;
double t_2 = Math.sqrt((z * 2.0));
double tmp;
if (t <= 880.0) {
tmp = t_1 * t_2;
} else if (t <= 5.2e+220) {
tmp = Math.sqrt(((z * 2.0) * Math.pow(t_1, 2.0)));
} else {
tmp = t_2 * (x * (0.5 - (y / x)));
}
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 <= 880.0: tmp = t_1 * t_2 elif t <= 5.2e+220: tmp = math.sqrt(((z * 2.0) * math.pow(t_1, 2.0))) else: tmp = t_2 * (x * (0.5 - (y / x))) 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 <= 880.0) tmp = Float64(t_1 * t_2); elseif (t <= 5.2e+220) tmp = sqrt(Float64(Float64(z * 2.0) * (t_1 ^ 2.0))); else tmp = Float64(t_2 * Float64(x * Float64(0.5 - Float64(y / x)))); 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 <= 880.0) tmp = t_1 * t_2; elseif (t <= 5.2e+220) tmp = sqrt(((z * 2.0) * (t_1 ^ 2.0))); else tmp = t_2 * (x * (0.5 - (y / x))); 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, 880.0], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[t, 5.2e+220], N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$2 * N[(x * N[(0.5 - N[(y / x), $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 \leq 880:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+220}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {t\_1}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(x \cdot \left(0.5 - \frac{y}{x}\right)\right)\\
\end{array}
\end{array}
if t < 880Initial program 99.8%
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 67.7%
unpow1/267.7%
metadata-eval67.7%
pow-sqr67.6%
unpow1/267.6%
metadata-eval67.6%
pow-sqr67.6%
unswap-sqr67.5%
*-commutative67.5%
exp-to-pow67.5%
exp-to-pow65.1%
exp-sum64.8%
distribute-rgt-in64.8%
*-commutative64.8%
exp-prod64.8%
exp-sum65.1%
rem-exp-log65.1%
rem-exp-log67.7%
*-commutative67.7%
Simplified68.0%
if 880 < t < 5.19999999999999988e220Initial program 97.0%
associate-*l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
Taylor expanded in x around 0 63.6%
+-commutative63.6%
mul-1-neg63.6%
associate-*l*63.6%
*-commutative63.6%
distribute-lft-neg-in63.6%
associate-*l*63.6%
*-commutative63.6%
associate-*r*63.6%
*-commutative63.6%
Simplified100.0%
Taylor expanded in t around 0 15.7%
*-commutative15.7%
*-commutative15.7%
*-commutative15.7%
add-sqr-sqrt10.6%
unpow210.6%
associate-*r*10.6%
sqrt-prod10.6%
add-sqr-sqrt7.5%
sqrt-unprod18.9%
*-commutative18.9%
*-commutative18.9%
swap-sqr21.8%
Applied egg-rr25.4%
if 5.19999999999999988e220 < t Initial program 100.0%
Taylor expanded in t around 0 16.1%
add-sqr-sqrt53.1%
pow253.1%
Applied egg-rr11.1%
Taylor expanded in x around inf 28.0%
unpow228.0%
rem-square-sqrt28.0%
+-commutative28.0%
mul-1-neg28.0%
unsub-neg28.0%
Simplified28.0%
Final simplification57.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (<= (* t t) 5e-18)
(* (- (* x 0.5) y) t_1)
(* (exp (/ (* t t) 2.0)) (* t_1 (- y))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if ((t * t) <= 5e-18) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = exp(((t * t) / 2.0)) * (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((z * 2.0d0))
if ((t * t) <= 5d-18) then
tmp = ((x * 0.5d0) - y) * t_1
else
tmp = exp(((t * t) / 2.0d0)) * (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((z * 2.0));
double tmp;
if ((t * t) <= 5e-18) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = Math.exp(((t * t) / 2.0)) * (t_1 * -y);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if (t * t) <= 5e-18: tmp = ((x * 0.5) - y) * t_1 else: tmp = math.exp(((t * t) / 2.0)) * (t_1 * -y) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (Float64(t * t) <= 5e-18) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); else tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(t_1 * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if ((t * t) <= 5e-18) tmp = ((x * 0.5) - y) * t_1; else tmp = exp(((t * t) / 2.0)) * (t_1 * -y); 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], 5e-18], 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[(t$95$1 * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \cdot t \leq 5 \cdot 10^{-18}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(t\_1 \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if (*.f64 t t) < 5.00000000000000036e-18Initial 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.1%
unpow1/299.1%
metadata-eval99.1%
pow-sqr99.0%
unswap-sqr99.0%
*-commutative99.0%
exp-to-pow99.0%
exp-to-pow95.0%
exp-sum94.6%
distribute-rgt-in94.6%
*-commutative94.6%
exp-prod94.6%
exp-sum95.0%
rem-exp-log95.0%
rem-exp-log99.3%
*-commutative99.3%
Simplified99.7%
if 5.00000000000000036e-18 < (*.f64 t t) Initial program 99.2%
add-sqr-sqrt51.8%
pow251.8%
Applied egg-rr51.8%
Taylor expanded in x around 0 80.9%
neg-mul-180.9%
Simplified80.9%
Final simplification89.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 1.0)
(* t_1 (sqrt (* z 2.0)))
(* (* t (* t_1 (sqrt 2.0))) (sqrt z)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 1.0) {
tmp = t_1 * sqrt((z * 2.0));
} else {
tmp = (t * (t_1 * sqrt(2.0))) * sqrt(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) :: t_1
real(8) :: tmp
t_1 = (x * 0.5d0) - y
if (t <= 1.0d0) then
tmp = t_1 * sqrt((z * 2.0d0))
else
tmp = (t * (t_1 * sqrt(2.0d0))) * sqrt(z)
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 tmp;
if (t <= 1.0) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else {
tmp = (t * (t_1 * Math.sqrt(2.0))) * Math.sqrt(z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if t <= 1.0: tmp = t_1 * math.sqrt((z * 2.0)) else: tmp = (t * (t_1 * math.sqrt(2.0))) * math.sqrt(z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 1.0) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); else tmp = Float64(Float64(t * Float64(t_1 * sqrt(2.0))) * sqrt(z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if (t <= 1.0) tmp = t_1 * sqrt((z * 2.0)); else tmp = (t * (t_1 * sqrt(2.0))) * sqrt(z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 1.0], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(t$95$1 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 1:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \left(t\_1 \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\\
\end{array}
\end{array}
if t < 1Initial program 99.8%
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 67.7%
unpow1/267.7%
metadata-eval67.7%
pow-sqr67.6%
unpow1/267.6%
metadata-eval67.6%
pow-sqr67.6%
unswap-sqr67.5%
*-commutative67.5%
exp-to-pow67.5%
exp-to-pow65.1%
exp-sum64.8%
distribute-rgt-in64.8%
*-commutative64.8%
exp-prod64.8%
exp-sum65.1%
rem-exp-log65.1%
rem-exp-log67.7%
*-commutative67.7%
Simplified68.0%
if 1 < t Initial program 98.5%
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 73.5%
+-commutative73.5%
unpow273.5%
fma-define73.5%
Simplified73.5%
Taylor expanded in t around inf 47.7%
Final simplification62.8%
(FPCore (x y z t) :precision binary64 (if (<= t 0.0015) (* (- (* x 0.5) y) (sqrt (* z 2.0))) (* (sqrt 2.0) (* x (* (sqrt z) (- 0.5 (/ y x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 0.0015) {
tmp = ((x * 0.5) - y) * sqrt((z * 2.0));
} else {
tmp = sqrt(2.0) * (x * (sqrt(z) * (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) :: tmp
if (t <= 0.0015d0) then
tmp = ((x * 0.5d0) - y) * sqrt((z * 2.0d0))
else
tmp = sqrt(2.0d0) * (x * (sqrt(z) * (0.5d0 - (y / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 0.0015) {
tmp = ((x * 0.5) - y) * Math.sqrt((z * 2.0));
} else {
tmp = Math.sqrt(2.0) * (x * (Math.sqrt(z) * (0.5 - (y / x))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 0.0015: tmp = ((x * 0.5) - y) * math.sqrt((z * 2.0)) else: tmp = math.sqrt(2.0) * (x * (math.sqrt(z) * (0.5 - (y / x)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 0.0015) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))); else tmp = Float64(sqrt(2.0) * Float64(x * Float64(sqrt(z) * Float64(0.5 - Float64(y / x))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 0.0015) tmp = ((x * 0.5) - y) * sqrt((z * 2.0)); else tmp = sqrt(2.0) * (x * (sqrt(z) * (0.5 - (y / x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 0.0015], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(x * N[(N[Sqrt[z], $MachinePrecision] * N[(0.5 - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0015:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(x \cdot \left(\sqrt{z} \cdot \left(0.5 - \frac{y}{x}\right)\right)\right)\\
\end{array}
\end{array}
if t < 0.0015Initial program 99.8%
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 67.8%
unpow1/267.8%
metadata-eval67.8%
pow-sqr67.7%
unpow1/267.7%
metadata-eval67.7%
pow-sqr67.7%
unswap-sqr67.6%
*-commutative67.6%
exp-to-pow67.6%
exp-to-pow65.2%
exp-sum64.9%
distribute-rgt-in64.9%
*-commutative64.9%
exp-prod64.9%
exp-sum65.2%
rem-exp-log65.2%
rem-exp-log67.8%
*-commutative67.8%
Simplified68.1%
if 0.0015 < t Initial program 98.5%
associate-*l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
Taylor expanded in x around 0 60.6%
+-commutative60.6%
mul-1-neg60.6%
associate-*l*60.6%
*-commutative60.6%
distribute-lft-neg-in60.6%
associate-*l*60.6%
*-commutative60.6%
associate-*r*60.6%
*-commutative60.6%
Simplified100.0%
Taylor expanded in t around 0 16.4%
Taylor expanded in x around inf 30.7%
associate-*r*30.7%
distribute-rgt-out30.7%
+-commutative30.7%
mul-1-neg30.7%
unsub-neg30.7%
Simplified30.7%
(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.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (or (<= x -1300.0) (not (<= x 2.75e-81)))
(* 0.5 (* x t_1))
(* t_1 (- y)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if ((x <= -1300.0) || !(x <= 2.75e-81)) {
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((z * 2.0d0))
if ((x <= (-1300.0d0)) .or. (.not. (x <= 2.75d-81))) 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((z * 2.0));
double tmp;
if ((x <= -1300.0) || !(x <= 2.75e-81)) {
tmp = 0.5 * (x * t_1);
} else {
tmp = t_1 * -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if (x <= -1300.0) or not (x <= 2.75e-81): tmp = 0.5 * (x * t_1) else: tmp = t_1 * -y return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if ((x <= -1300.0) || !(x <= 2.75e-81)) 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((z * 2.0)); tmp = 0.0; if ((x <= -1300.0) || ~((x <= 2.75e-81))) 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[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x, -1300.0], N[Not[LessEqual[x, 2.75e-81]], $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{z \cdot 2}\\
\mathbf{if}\;x \leq -1300 \lor \neg \left(x \leq 2.75 \cdot 10^{-81}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(-y\right)\\
\end{array}
\end{array}
if x < -1300 or 2.75000000000000013e-81 < x Initial program 99.8%
Taylor expanded in t around 0 59.6%
Taylor expanded in x around inf 47.7%
associate-*l*47.7%
*-commutative47.7%
unpow1/247.7%
metadata-eval47.7%
pow-sqr47.7%
unpow1/247.7%
metadata-eval47.7%
pow-sqr47.7%
unswap-sqr47.6%
*-commutative47.6%
exp-to-pow47.6%
exp-to-pow46.2%
exp-sum46.1%
distribute-rgt-in46.1%
*-commutative46.1%
exp-prod46.1%
exp-sum46.2%
rem-exp-log46.2%
rem-exp-log47.7%
*-commutative47.7%
Simplified47.9%
if -1300 < x < 2.75000000000000013e-81Initial program 99.0%
Taylor expanded in t around 0 49.3%
Taylor expanded in x around 0 41.5%
mul-1-neg41.5%
associate-*l*41.5%
*-commutative41.5%
unpow1/241.5%
metadata-eval41.5%
pow-sqr41.4%
unpow1/241.4%
metadata-eval41.4%
pow-sqr41.4%
unswap-sqr41.4%
*-commutative41.4%
exp-to-pow41.4%
exp-to-pow40.1%
exp-sum39.7%
distribute-rgt-in39.7%
*-commutative39.7%
exp-prod39.7%
exp-sum40.1%
rem-exp-log40.1%
rem-exp-log41.5%
*-commutative41.5%
Simplified41.6%
Final simplification44.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (sqrt (* z 2.0)))) (if (<= t 0.0015) (* (- (* 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((z * 2.0));
double tmp;
if (t <= 0.0015) {
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((z * 2.0d0))
if (t <= 0.0015d0) 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((z * 2.0));
double tmp;
if (t <= 0.0015) {
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((z * 2.0)) tmp = 0 if t <= 0.0015: 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(z * 2.0)) tmp = 0.0 if (t <= 0.0015) 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((z * 2.0)); tmp = 0.0; if (t <= 0.0015) 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[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 0.0015], 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{z \cdot 2}\\
\mathbf{if}\;t \leq 0.0015:\\
\;\;\;\;\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 < 0.0015Initial program 99.8%
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 67.8%
unpow1/267.8%
metadata-eval67.8%
pow-sqr67.7%
unpow1/267.7%
metadata-eval67.7%
pow-sqr67.7%
unswap-sqr67.6%
*-commutative67.6%
exp-to-pow67.6%
exp-to-pow65.2%
exp-sum64.9%
distribute-rgt-in64.9%
*-commutative64.9%
exp-prod64.9%
exp-sum65.2%
rem-exp-log65.2%
rem-exp-log67.8%
*-commutative67.8%
Simplified68.1%
if 0.0015 < t Initial program 98.5%
Taylor expanded in t around 0 16.4%
add-sqr-sqrt50.0%
pow250.0%
Applied egg-rr10.7%
Taylor expanded in x around inf 26.4%
unpow226.4%
rem-square-sqrt26.4%
+-commutative26.4%
mul-1-neg26.4%
unsub-neg26.4%
Simplified26.4%
Final simplification57.3%
(FPCore (x y z t) :precision binary64 (if (<= t 6e+40) (* (- (* x 0.5) y) (sqrt (* z 2.0))) (* y (- (/ (pow (* z 2.0) 1.5) (* z 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6e+40) {
tmp = ((x * 0.5) - y) * sqrt((z * 2.0));
} else {
tmp = y * -(pow((z * 2.0), 1.5) / (z * 2.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 6d+40) then
tmp = ((x * 0.5d0) - y) * sqrt((z * 2.0d0))
else
tmp = y * -(((z * 2.0d0) ** 1.5d0) / (z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6e+40) {
tmp = ((x * 0.5) - y) * Math.sqrt((z * 2.0));
} else {
tmp = y * -(Math.pow((z * 2.0), 1.5) / (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 6e+40: tmp = ((x * 0.5) - y) * math.sqrt((z * 2.0)) else: tmp = y * -(math.pow((z * 2.0), 1.5) / (z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 6e+40) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))); else tmp = Float64(y * Float64(-Float64((Float64(z * 2.0) ^ 1.5) / Float64(z * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 6e+40) tmp = ((x * 0.5) - y) * sqrt((z * 2.0)); else tmp = y * -(((z * 2.0) ^ 1.5) / (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 6e+40], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y * (-N[(N[Power[N[(z * 2.0), $MachinePrecision], 1.5], $MachinePrecision] / N[(z * 2.0), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6 \cdot 10^{+40}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-\frac{{\left(z \cdot 2\right)}^{1.5}}{z \cdot 2}\right)\\
\end{array}
\end{array}
if t < 6.0000000000000004e40Initial program 99.8%
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 65.7%
unpow1/265.7%
metadata-eval65.7%
pow-sqr65.5%
unpow1/265.5%
metadata-eval65.5%
pow-sqr65.5%
unswap-sqr65.5%
*-commutative65.5%
exp-to-pow65.5%
exp-to-pow63.1%
exp-sum62.9%
distribute-rgt-in62.9%
*-commutative62.9%
exp-prod62.9%
exp-sum63.1%
rem-exp-log63.1%
rem-exp-log65.6%
*-commutative65.6%
Simplified65.9%
if 6.0000000000000004e40 < t Initial program 98.2%
Taylor expanded in t around 0 15.9%
Taylor expanded in x around 0 10.1%
mul-1-neg10.1%
associate-*l*10.1%
*-commutative10.1%
unpow1/210.1%
metadata-eval10.1%
pow-sqr10.1%
unpow1/210.1%
metadata-eval10.1%
pow-sqr10.1%
unswap-sqr10.1%
*-commutative10.1%
exp-to-pow10.1%
exp-to-pow10.1%
exp-sum10.1%
distribute-rgt-in10.1%
*-commutative10.1%
exp-prod10.1%
exp-sum10.1%
rem-exp-log10.1%
rem-exp-log10.1%
*-commutative10.1%
Simplified10.1%
neg-sub010.1%
flip3--20.0%
metadata-eval20.0%
pow320.0%
add-sqr-sqrt20.0%
pow120.0%
pow1/220.0%
pow-prod-up20.0%
metadata-eval20.0%
metadata-eval20.0%
add-sqr-sqrt20.0%
Applied egg-rr20.0%
sub0-neg20.0%
*-commutative20.0%
+-lft-identity20.0%
mul0-lft20.0%
+-rgt-identity20.0%
*-commutative20.0%
Simplified20.0%
Final simplification55.7%
(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.4%
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 54.6%
unpow1/254.6%
metadata-eval54.6%
pow-sqr54.5%
unpow1/254.5%
metadata-eval54.5%
pow-sqr54.5%
unswap-sqr54.4%
*-commutative54.4%
exp-to-pow54.4%
exp-to-pow52.6%
exp-sum52.4%
distribute-rgt-in52.4%
*-commutative52.4%
exp-prod52.4%
exp-sum52.6%
rem-exp-log52.6%
rem-exp-log54.6%
*-commutative54.6%
Simplified54.8%
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (- y)))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * -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((z * 2.0d0)) * -y
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * -y;
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * -y
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(-y)) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * -y; end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(-y\right)
\end{array}
Initial program 99.4%
Taylor expanded in t around 0 54.8%
Taylor expanded in x around 0 26.2%
mul-1-neg26.2%
associate-*l*26.2%
*-commutative26.2%
unpow1/226.2%
metadata-eval26.2%
pow-sqr26.1%
unpow1/226.1%
metadata-eval26.1%
pow-sqr26.1%
unswap-sqr26.1%
*-commutative26.1%
exp-to-pow26.1%
exp-to-pow25.4%
exp-sum25.2%
distribute-rgt-in25.2%
*-commutative25.2%
exp-prod25.2%
exp-sum25.4%
rem-exp-log25.4%
rem-exp-log26.2%
*-commutative26.2%
Simplified26.2%
Final simplification26.2%
(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.4%
Taylor expanded in t around 0 54.8%
Taylor expanded in x around 0 26.2%
mul-1-neg26.2%
associate-*l*26.2%
*-commutative26.2%
unpow1/226.2%
metadata-eval26.2%
pow-sqr26.1%
unpow1/226.1%
metadata-eval26.1%
pow-sqr26.1%
unswap-sqr26.1%
*-commutative26.1%
exp-to-pow26.1%
exp-to-pow25.4%
exp-sum25.2%
distribute-rgt-in25.2%
*-commutative25.2%
exp-prod25.2%
exp-sum25.4%
rem-exp-log25.4%
rem-exp-log26.2%
*-commutative26.2%
Simplified26.2%
add-sqr-sqrt0.0%
sqrt-unprod2.6%
sqr-neg2.6%
add-sqr-sqrt2.6%
Applied egg-rr2.6%
(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 2024181
(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))))