
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (pow (exp t) t)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((2.0 * z) * pow(exp(t), t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * 0.5d0) - y) * sqrt(((2.0d0 * z) * (exp(t) ** t)))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt(((2.0 * z) * Math.pow(Math.exp(t), t)));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((2.0 * z) * math.pow(math.exp(t), t)))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) * (exp(t) ^ t)))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) * (exp(t) ^ t))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[Power[N[Exp[t], $MachinePrecision], t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot {\left(e^{t}\right)}^{t}}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
pow299.8%
exp-prod99.8%
Applied egg-rr99.8%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (exp (pow t 2.0))))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((2.0 * z) * exp(pow(t, 2.0))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * 0.5d0) - y) * sqrt(((2.0d0 * z) * exp((t ** 2.0d0))))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt(((2.0 * z) * Math.exp(Math.pow(t, 2.0))));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((2.0 * z) * math.exp(math.pow(t, 2.0))))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) * exp((t ^ 2.0))))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) * exp((t ^ 2.0)))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[Exp[N[Power[t, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot e^{{t}^{2}}}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))) (t_2 (- (* x 0.5) y)))
(if (<= (* t t) 4e-7)
(* t_2 (* (hypot 1.0 t) t_1))
(if (<= (* t t) 5e+286)
(* (exp (/ (* t t) 2.0)) (* y (- t_1)))
(* t_2 (sqrt (* z (* 2.0 (pow t 2.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double t_2 = (x * 0.5) - y;
double tmp;
if ((t * t) <= 4e-7) {
tmp = t_2 * (hypot(1.0, t) * t_1);
} else if ((t * t) <= 5e+286) {
tmp = exp(((t * t) / 2.0)) * (y * -t_1);
} else {
tmp = t_2 * sqrt((z * (2.0 * 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 = (x * 0.5) - y;
double tmp;
if ((t * t) <= 4e-7) {
tmp = t_2 * (Math.hypot(1.0, t) * t_1);
} else if ((t * t) <= 5e+286) {
tmp = Math.exp(((t * t) / 2.0)) * (y * -t_1);
} else {
tmp = t_2 * Math.sqrt((z * (2.0 * Math.pow(t, 2.0))));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) t_2 = (x * 0.5) - y tmp = 0 if (t * t) <= 4e-7: tmp = t_2 * (math.hypot(1.0, t) * t_1) elif (t * t) <= 5e+286: tmp = math.exp(((t * t) / 2.0)) * (y * -t_1) else: tmp = t_2 * math.sqrt((z * (2.0 * math.pow(t, 2.0)))) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) t_2 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (Float64(t * t) <= 4e-7) tmp = Float64(t_2 * Float64(hypot(1.0, t) * t_1)); elseif (Float64(t * t) <= 5e+286) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(y * Float64(-t_1))); else tmp = Float64(t_2 * sqrt(Float64(z * Float64(2.0 * (t ^ 2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); t_2 = (x * 0.5) - y; tmp = 0.0; if ((t * t) <= 4e-7) tmp = t_2 * (hypot(1.0, t) * t_1); elseif ((t * t) <= 5e+286) tmp = exp(((t * t) / 2.0)) * (y * -t_1); else tmp = t_2 * sqrt((z * (2.0 * (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[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 4e-7], N[(t$95$2 * N[(N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 5e+286], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(y * (-t$95$1)), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sqrt[N[(z * N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
t_2 := x \cdot 0.5 - y\\
\mathbf{if}\;t \cdot t \leq 4 \cdot 10^{-7}:\\
\;\;\;\;t\_2 \cdot \left(\mathsf{hypot}\left(1, t\right) \cdot t\_1\right)\\
\mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+286}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot \left(-t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sqrt{z \cdot \left(2 \cdot {t}^{2}\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 3.9999999999999998e-7Initial program 99.7%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
sqrt-unprod99.7%
associate-*l*99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 99.6%
+-commutative99.6%
unpow299.6%
fma-define99.6%
Simplified99.6%
sqrt-prod99.6%
Applied egg-rr99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
unpow299.6%
hypot-1-def99.6%
Simplified99.6%
if 3.9999999999999998e-7 < (*.f64 t t) < 5.0000000000000004e286Initial program 100.0%
Taylor expanded in x around 0 78.4%
mul-1-neg78.4%
distribute-rgt-neg-in78.4%
Simplified78.4%
distribute-rgt-neg-out78.4%
neg-sub078.4%
associate-*l*78.4%
sqrt-prod78.4%
*-commutative78.4%
*-commutative78.4%
Applied egg-rr78.4%
neg-sub078.4%
*-commutative78.4%
distribute-rgt-neg-in78.4%
Simplified78.4%
if 5.0000000000000004e286 < (*.f64 t t) Initial program 98.5%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
pow1100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
unpow1100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
+-commutative100.0%
unpow2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification94.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* 2.0 z))))
(if (<= (* t t) 4e-7)
(* t_1 t_2)
(if (<= (* t t) 5e+286)
(* (exp (/ (* t t) 2.0)) (* y (- t_2)))
(* t_1 (sqrt (* z (* 2.0 (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((2.0 * z));
double tmp;
if ((t * t) <= 4e-7) {
tmp = t_1 * t_2;
} else if ((t * t) <= 5e+286) {
tmp = exp(((t * t) / 2.0)) * (y * -t_2);
} else {
tmp = t_1 * sqrt((z * (2.0 * 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((2.0d0 * z))
if ((t * t) <= 4d-7) then
tmp = t_1 * t_2
else if ((t * t) <= 5d+286) then
tmp = exp(((t * t) / 2.0d0)) * (y * -t_2)
else
tmp = t_1 * sqrt((z * (2.0d0 * (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((2.0 * z));
double tmp;
if ((t * t) <= 4e-7) {
tmp = t_1 * t_2;
} else if ((t * t) <= 5e+286) {
tmp = Math.exp(((t * t) / 2.0)) * (y * -t_2);
} else {
tmp = t_1 * Math.sqrt((z * (2.0 * Math.pow(t, 2.0))));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y t_2 = math.sqrt((2.0 * z)) tmp = 0 if (t * t) <= 4e-7: tmp = t_1 * t_2 elif (t * t) <= 5e+286: tmp = math.exp(((t * t) / 2.0)) * (y * -t_2) else: tmp = t_1 * math.sqrt((z * (2.0 * 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(2.0 * z)) tmp = 0.0 if (Float64(t * t) <= 4e-7) tmp = Float64(t_1 * t_2); elseif (Float64(t * t) <= 5e+286) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(y * Float64(-t_2))); else tmp = Float64(t_1 * sqrt(Float64(z * Float64(2.0 * (t ^ 2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; t_2 = sqrt((2.0 * z)); tmp = 0.0; if ((t * t) <= 4e-7) tmp = t_1 * t_2; elseif ((t * t) <= 5e+286) tmp = exp(((t * t) / 2.0)) * (y * -t_2); else tmp = t_1 * sqrt((z * (2.0 * (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[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 4e-7], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 5e+286], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(y * (-t$95$2)), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(z * N[(2.0 * 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{2 \cdot z}\\
\mathbf{if}\;t \cdot t \leq 4 \cdot 10^{-7}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+286}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot \left(-t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot \left(2 \cdot {t}^{2}\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 3.9999999999999998e-7Initial program 99.7%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
Taylor expanded in t around 0 99.0%
*-commutative99.0%
sqrt-prod99.3%
pow1/299.3%
Applied egg-rr99.3%
unpow1/299.3%
Simplified99.3%
if 3.9999999999999998e-7 < (*.f64 t t) < 5.0000000000000004e286Initial program 100.0%
Taylor expanded in x around 0 78.4%
mul-1-neg78.4%
distribute-rgt-neg-in78.4%
Simplified78.4%
distribute-rgt-neg-out78.4%
neg-sub078.4%
associate-*l*78.4%
sqrt-prod78.4%
*-commutative78.4%
*-commutative78.4%
Applied egg-rr78.4%
neg-sub078.4%
*-commutative78.4%
distribute-rgt-neg-in78.4%
Simplified78.4%
if 5.0000000000000004e286 < (*.f64 t t) Initial program 98.5%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
pow1100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
unpow1100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
+-commutative100.0%
unpow2100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification94.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))))
(if (<= (* t t) 4e-7)
(* (- (* x 0.5) y) t_1)
(* (exp (/ (* t t) 2.0)) (* y (- t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double tmp;
if ((t * t) <= 4e-7) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = exp(((t * t) / 2.0)) * (y * -t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((2.0d0 * z))
if ((t * t) <= 4d-7) then
tmp = ((x * 0.5d0) - y) * t_1
else
tmp = exp(((t * t) / 2.0d0)) * (y * -t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((2.0 * z));
double tmp;
if ((t * t) <= 4e-7) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = Math.exp(((t * t) / 2.0)) * (y * -t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) tmp = 0 if (t * t) <= 4e-7: tmp = ((x * 0.5) - y) * t_1 else: tmp = math.exp(((t * t) / 2.0)) * (y * -t_1) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) tmp = 0.0 if (Float64(t * t) <= 4e-7) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); else tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(y * Float64(-t_1))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); tmp = 0.0; if ((t * t) <= 4e-7) tmp = ((x * 0.5) - y) * t_1; else tmp = exp(((t * t) / 2.0)) * (y * -t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 4e-7], 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[(y * (-t$95$1)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t \cdot t \leq 4 \cdot 10^{-7}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot \left(-t\_1\right)\right)\\
\end{array}
\end{array}
if (*.f64 t t) < 3.9999999999999998e-7Initial program 99.7%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
Taylor expanded in t around 0 99.0%
*-commutative99.0%
sqrt-prod99.3%
pow1/299.3%
Applied egg-rr99.3%
unpow1/299.3%
Simplified99.3%
if 3.9999999999999998e-7 < (*.f64 t t) Initial program 99.2%
Taylor expanded in x around 0 73.1%
mul-1-neg73.1%
distribute-rgt-neg-in73.1%
Simplified73.1%
distribute-rgt-neg-out73.1%
neg-sub073.1%
associate-*l*73.0%
sqrt-prod73.1%
*-commutative73.1%
*-commutative73.1%
Applied egg-rr73.1%
neg-sub073.1%
*-commutative73.1%
distribute-rgt-neg-in73.1%
Simplified73.1%
Final simplification86.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= (* t t) 1e-6)
(* t_1 (sqrt (* 2.0 z)))
(* (* 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 * t) <= 1e-6) {
tmp = t_1 * sqrt((2.0 * z));
} 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 * t) <= 1d-6) then
tmp = t_1 * sqrt((2.0d0 * z))
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 * t) <= 1e-6) {
tmp = t_1 * Math.sqrt((2.0 * z));
} 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 * t) <= 1e-6: tmp = t_1 * math.sqrt((2.0 * z)) 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 (Float64(t * t) <= 1e-6) tmp = Float64(t_1 * sqrt(Float64(2.0 * z))); 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 * t) <= 1e-6) tmp = t_1 * sqrt((2.0 * z)); 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[N[(t * t), $MachinePrecision], 1e-6], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $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 \cdot t \leq 10^{-6}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \left(t\_1 \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\\
\end{array}
\end{array}
if (*.f64 t t) < 9.99999999999999955e-7Initial program 99.7%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
Taylor expanded in t around 0 98.6%
*-commutative98.6%
sqrt-prod98.9%
pow1/298.9%
Applied egg-rr98.9%
unpow1/298.9%
Simplified98.9%
if 9.99999999999999955e-7 < (*.f64 t t) Initial program 99.2%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
pow1100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
unpow1100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 67.6%
+-commutative67.6%
unpow267.6%
fma-define67.6%
Simplified67.6%
Taylor expanded in t around inf 23.1%
Final simplification60.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 1.0)
(* t_1 (sqrt (* 2.0 z)))
(* (sqrt 2.0) (* t (* t_1 (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((2.0 * z));
} else {
tmp = sqrt(2.0) * (t * (t_1 * 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((2.0d0 * z))
else
tmp = sqrt(2.0d0) * (t * (t_1 * 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((2.0 * z));
} else {
tmp = Math.sqrt(2.0) * (t * (t_1 * 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((2.0 * z)) else: tmp = math.sqrt(2.0) * (t * (t_1 * 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(2.0 * z))); else tmp = Float64(sqrt(2.0) * Float64(t * Float64(t_1 * 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((2.0 * z)); else tmp = sqrt(2.0) * (t * (t_1 * 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[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(t$95$1 * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 1:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \left(t\_1 \cdot \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if t < 1Initial program 99.3%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
Taylor expanded in t around 0 69.9%
*-commutative69.9%
sqrt-prod70.1%
pow1/270.1%
Applied egg-rr70.1%
unpow1/270.1%
Simplified70.1%
if 1 < t Initial program 100.0%
associate-*l*99.9%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
pow1100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
unpow1100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 66.3%
+-commutative66.3%
unpow266.3%
fma-define66.3%
Simplified66.3%
Taylor expanded in t around inf 47.8%
*-commutative47.8%
*-commutative47.8%
associate-*r*40.3%
associate-*r*40.3%
*-commutative40.3%
*-commutative40.3%
fma-neg40.3%
associate-*r*40.3%
associate-*l*40.3%
fma-neg40.3%
*-commutative40.3%
Simplified40.3%
Final simplification62.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) 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 = (x * 0.5) - 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 = (x * 0.5) - 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(x * 0.5) - 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[(x * 0.5), $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 := x \cdot 0.5 - 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%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
Taylor expanded in t around 0 69.9%
*-commutative69.9%
sqrt-prod70.1%
pow1/270.1%
Applied egg-rr70.1%
unpow1/270.1%
Simplified70.1%
if 3.2000000000000002 < t Initial program 100.0%
associate-*l*99.9%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
Taylor expanded in t around 0 10.9%
add-cbrt-cube25.9%
pow1/325.9%
*-commutative25.9%
sqrt-prod25.9%
*-commutative25.9%
sqrt-prod25.9%
*-commutative25.9%
sqrt-prod25.9%
add-sqr-sqrt25.9%
pow125.9%
pow1/225.9%
pow-prod-up25.9%
metadata-eval25.9%
Applied egg-rr25.9%
unpow1/325.9%
Simplified25.9%
(FPCore (x y z t) :precision binary64 (* (exp (/ (* t t) 2.0)) (* (- (* x 0.5) y) (sqrt (* 2.0 z)))))
double code(double x, double y, double z, double t) {
return exp(((t * t) / 2.0)) * (((x * 0.5) - y) * sqrt((2.0 * z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = exp(((t * t) / 2.0d0)) * (((x * 0.5d0) - y) * sqrt((2.0d0 * z)))
end function
public static double code(double x, double y, double z, double t) {
return Math.exp(((t * t) / 2.0)) * (((x * 0.5) - y) * Math.sqrt((2.0 * z)));
}
def code(x, y, z, t): return math.exp(((t * t) / 2.0)) * (((x * 0.5) - y) * math.sqrt((2.0 * z)))
function code(x, y, z, t) return Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z)))) end
function tmp = code(x, y, z, t) tmp = exp(((t * t) / 2.0)) * (((x * 0.5) - y) * sqrt((2.0 * z))); end
code[x_, y_, z_, t_] := N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{\frac{t \cdot t}{2}} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right)
\end{array}
Initial program 99.4%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))))
(if (or (<= x -3.6e-12) (not (<= x 7e-69)))
(* 0.5 (* x t_1))
(* y (- t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double tmp;
if ((x <= -3.6e-12) || !(x <= 7e-69)) {
tmp = 0.5 * (x * t_1);
} else {
tmp = y * -t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((2.0d0 * z))
if ((x <= (-3.6d-12)) .or. (.not. (x <= 7d-69))) then
tmp = 0.5d0 * (x * t_1)
else
tmp = y * -t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((2.0 * z));
double tmp;
if ((x <= -3.6e-12) || !(x <= 7e-69)) {
tmp = 0.5 * (x * t_1);
} else {
tmp = y * -t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) tmp = 0 if (x <= -3.6e-12) or not (x <= 7e-69): tmp = 0.5 * (x * t_1) else: tmp = y * -t_1 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) tmp = 0.0 if ((x <= -3.6e-12) || !(x <= 7e-69)) tmp = Float64(0.5 * Float64(x * t_1)); else tmp = Float64(y * Float64(-t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); tmp = 0.0; if ((x <= -3.6e-12) || ~((x <= 7e-69))) tmp = 0.5 * (x * t_1); else tmp = y * -t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x, -3.6e-12], N[Not[LessEqual[x, 7e-69]], $MachinePrecision]], N[(0.5 * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], N[(y * (-t$95$1)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{-12} \lor \neg \left(x \leq 7 \cdot 10^{-69}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-t\_1\right)\\
\end{array}
\end{array}
if x < -3.6e-12 or 7.0000000000000003e-69 < x Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
Taylor expanded in t around 0 59.3%
Taylor expanded in x around inf 47.2%
*-commutative47.2%
Simplified47.2%
pow147.2%
*-commutative47.2%
associate-*l*47.2%
sqrt-prod47.3%
Applied egg-rr47.3%
unpow147.3%
*-commutative47.3%
Simplified47.3%
if -3.6e-12 < x < 7.0000000000000003e-69Initial program 98.9%
Taylor expanded in x around 0 86.9%
mul-1-neg86.9%
distribute-rgt-neg-in86.9%
Simplified86.9%
Taylor expanded in t around 0 42.5%
mul-1-neg42.5%
distribute-rgt-neg-in42.5%
Simplified42.5%
distribute-rgt-neg-out86.9%
neg-sub086.9%
associate-*l*86.9%
sqrt-prod87.1%
*-commutative87.1%
*-commutative87.1%
Applied egg-rr42.6%
neg-sub087.1%
*-commutative87.1%
distribute-rgt-neg-in87.1%
Simplified42.6%
Final simplification45.3%
(FPCore (x y z t) :precision binary64 (if (<= t 2.05e+31) (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (sqrt (* (* 2.0 z) (* x (- (* x 0.25) y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.05e+31) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else {
tmp = sqrt(((2.0 * z) * (x * ((x * 0.25) - 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 <= 2.05d+31) then
tmp = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
else
tmp = sqrt(((2.0d0 * z) * (x * ((x * 0.25d0) - y))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.05e+31) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else {
tmp = Math.sqrt(((2.0 * z) * (x * ((x * 0.25) - y))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.05e+31: tmp = ((x * 0.5) - y) * math.sqrt((2.0 * z)) else: tmp = math.sqrt(((2.0 * z) * (x * ((x * 0.25) - y)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.05e+31) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); else tmp = sqrt(Float64(Float64(2.0 * z) * Float64(x * Float64(Float64(x * 0.25) - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2.05e+31) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); else tmp = sqrt(((2.0 * z) * (x * ((x * 0.25) - y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.05e+31], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(x * N[(N[(x * 0.25), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.05 \cdot 10^{+31}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(x \cdot \left(x \cdot 0.25 - y\right)\right)}\\
\end{array}
\end{array}
if t < 2.0500000000000001e31Initial program 99.3%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
Taylor expanded in t around 0 67.2%
*-commutative67.2%
sqrt-prod67.4%
pow1/267.4%
Applied egg-rr67.4%
unpow1/267.4%
Simplified67.4%
if 2.0500000000000001e31 < t Initial program 100.0%
Taylor expanded in t around 0 10.0%
add-sqr-sqrt8.7%
sqrt-unprod28.4%
*-commutative28.4%
*-commutative28.4%
swap-sqr32.0%
add-sqr-sqrt32.0%
pow232.0%
Applied egg-rr32.0%
Taylor expanded in y around 0 26.0%
mul-1-neg26.0%
*-commutative26.0%
distribute-lft-neg-in26.0%
unpow226.0%
associate-*r*26.0%
distribute-rgt-in28.0%
+-commutative28.0%
unsub-neg28.0%
*-commutative28.0%
Simplified28.0%
Final simplification59.4%
(FPCore (x y z t) :precision binary64 (if (<= t 3.05e+37) (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (sqrt (* x (* z (+ (* x 0.5) (* y -2.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.05e+37) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else {
tmp = sqrt((x * (z * ((x * 0.5) + (y * -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 <= 3.05d+37) then
tmp = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
else
tmp = sqrt((x * (z * ((x * 0.5d0) + (y * (-2.0d0))))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.05e+37) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else {
tmp = Math.sqrt((x * (z * ((x * 0.5) + (y * -2.0)))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3.05e+37: tmp = ((x * 0.5) - y) * math.sqrt((2.0 * z)) else: tmp = math.sqrt((x * (z * ((x * 0.5) + (y * -2.0))))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3.05e+37) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); else tmp = sqrt(Float64(x * Float64(z * Float64(Float64(x * 0.5) + Float64(y * -2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.05e+37) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); else tmp = sqrt((x * (z * ((x * 0.5) + (y * -2.0))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.05e+37], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(x * N[(z * N[(N[(x * 0.5), $MachinePrecision] + N[(y * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.05 \cdot 10^{+37}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x \cdot \left(z \cdot \left(x \cdot 0.5 + y \cdot -2\right)\right)}\\
\end{array}
\end{array}
if t < 3.05e37Initial program 99.3%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
Taylor expanded in t around 0 67.2%
*-commutative67.2%
sqrt-prod67.4%
pow1/267.4%
Applied egg-rr67.4%
unpow1/267.4%
Simplified67.4%
if 3.05e37 < t Initial program 100.0%
Taylor expanded in t around 0 10.0%
add-sqr-sqrt8.7%
sqrt-unprod28.4%
*-commutative28.4%
*-commutative28.4%
swap-sqr32.0%
add-sqr-sqrt32.0%
pow232.0%
Applied egg-rr32.0%
Taylor expanded in y around 0 24.1%
*-commutative24.1%
associate-*r*24.1%
*-commutative24.1%
unpow224.1%
associate-*r*22.3%
*-commutative22.3%
associate-*l*22.3%
distribute-rgt-in24.2%
associate-*r*24.2%
associate-*r*24.2%
*-commutative24.2%
distribute-rgt-out26.1%
*-commutative26.1%
Simplified26.1%
Final simplification59.1%
(FPCore (x y z t) :precision binary64 (if (<= t 2.5e+27) (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (sqrt (* (* 2.0 z) (* y (- y x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.5e+27) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else {
tmp = sqrt(((2.0 * z) * (y * (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 <= 2.5d+27) then
tmp = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
else
tmp = sqrt(((2.0d0 * z) * (y * (y - x))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.5e+27) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else {
tmp = Math.sqrt(((2.0 * z) * (y * (y - x))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.5e+27: tmp = ((x * 0.5) - y) * math.sqrt((2.0 * z)) else: tmp = math.sqrt(((2.0 * z) * (y * (y - x)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.5e+27) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); else tmp = sqrt(Float64(Float64(2.0 * z) * Float64(y * Float64(y - x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2.5e+27) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); else tmp = sqrt(((2.0 * z) * (y * (y - x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.5e+27], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(y * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.5 \cdot 10^{+27}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot z\right) \cdot \left(y \cdot \left(y - x\right)\right)}\\
\end{array}
\end{array}
if t < 2.4999999999999999e27Initial program 99.3%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
Taylor expanded in t around 0 67.9%
*-commutative67.9%
sqrt-prod68.1%
pow1/268.1%
Applied egg-rr68.1%
unpow1/268.1%
Simplified68.1%
if 2.4999999999999999e27 < t Initial program 100.0%
Taylor expanded in t around 0 9.8%
add-sqr-sqrt8.6%
sqrt-unprod29.2%
*-commutative29.2%
*-commutative29.2%
swap-sqr32.7%
add-sqr-sqrt32.7%
pow232.7%
Applied egg-rr32.7%
Taylor expanded in x around 0 21.5%
+-commutative21.5%
unpow221.5%
associate-*r*21.5%
distribute-rgt-in21.5%
mul-1-neg21.5%
unsub-neg21.5%
Simplified21.5%
Final simplification58.3%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* 2.0 z))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt((2.0 * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt((2.0 * z));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt((2.0 * z))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
Taylor expanded in t around 0 55.6%
*-commutative55.6%
sqrt-prod55.8%
pow1/255.8%
Applied egg-rr55.8%
unpow1/255.8%
Simplified55.8%
(FPCore (x y z t) :precision binary64 (* y (- (sqrt (* 2.0 z)))))
double code(double x, double y, double z, double t) {
return y * -sqrt((2.0 * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * -sqrt((2.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return y * -Math.sqrt((2.0 * z));
}
def code(x, y, z, t): return y * -math.sqrt((2.0 * z))
function code(x, y, z, t) return Float64(y * Float64(-sqrt(Float64(2.0 * z)))) end
function tmp = code(x, y, z, t) tmp = y * -sqrt((2.0 * z)); end
code[x_, y_, z_, t_] := N[(y * (-N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-\sqrt{2 \cdot z}\right)
\end{array}
Initial program 99.4%
Taylor expanded in x around 0 60.7%
mul-1-neg60.7%
distribute-rgt-neg-in60.7%
Simplified60.7%
Taylor expanded in t around 0 27.0%
mul-1-neg27.0%
distribute-rgt-neg-in27.0%
Simplified27.0%
distribute-rgt-neg-out60.7%
neg-sub060.7%
associate-*l*60.7%
sqrt-prod60.8%
*-commutative60.8%
*-commutative60.8%
Applied egg-rr27.1%
neg-sub060.8%
*-commutative60.8%
distribute-rgt-neg-in60.8%
Simplified27.1%
Final simplification27.1%
(FPCore (x y z t) :precision binary64 (* y (sqrt (* 2.0 z))))
double code(double x, double y, double z, double t) {
return y * sqrt((2.0 * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * sqrt((2.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return y * Math.sqrt((2.0 * z));
}
def code(x, y, z, t): return y * math.sqrt((2.0 * z))
function code(x, y, z, t) return Float64(y * sqrt(Float64(2.0 * z))) end
function tmp = code(x, y, z, t) tmp = y * sqrt((2.0 * z)); end
code[x_, y_, z_, t_] := N[(y * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \sqrt{2 \cdot z}
\end{array}
Initial program 99.4%
Taylor expanded in x around 0 60.7%
mul-1-neg60.7%
distribute-rgt-neg-in60.7%
Simplified60.7%
Taylor expanded in t around 0 27.0%
mul-1-neg27.0%
distribute-rgt-neg-in27.0%
Simplified27.0%
pow127.0%
pow127.0%
pow127.0%
add-sqr-sqrt0.0%
sqrt-unprod2.2%
sqr-neg2.2%
add-sqr-sqrt2.2%
associate-*l*2.2%
sqrt-prod2.2%
Applied egg-rr2.2%
unpow12.2%
Simplified2.2%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * pow(exp(1.0), ((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * (exp(1.0d0) ** ((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.pow(Math.exp(1.0), ((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.pow(math.exp(1.0), ((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * (exp(1.0) ^ Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * (exp(1.0) ^ ((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[Exp[1.0], $MachinePrecision], N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot {\left(e^{1}\right)}^{\left(\frac{t \cdot t}{2}\right)}
\end{array}
herbie shell --seed 2024100
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
:alt
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0)))
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))