
(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 (* z 2.0)) (sqrt (pow (exp t) t)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * (sqrt((z * 2.0)) * sqrt(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((z * 2.0d0)) * sqrt((exp(t) ** t)))
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.sqrt(Math.pow(Math.exp(t), t)));
}
def code(x, y, z, t): return ((x * 0.5) - y) * (math.sqrt((z * 2.0)) * math.sqrt(math.pow(math.exp(t), t)))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * Float64(sqrt(Float64(z * 2.0)) * sqrt((exp(t) ^ t)))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * (sqrt((z * 2.0)) * sqrt((exp(t) ^ t))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Power[N[Exp[t], $MachinePrecision], t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z \cdot 2} \cdot \sqrt{{\left(e^{t}\right)}^{t}}\right)
\end{array}
Initial program 99.0%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= (exp (/ (* t t) 2.0)) 1.05)
(* t_1 (sqrt (* z 2.0)))
(* (sqrt z) (* t (* t_1 (sqrt 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (exp(((t * t) / 2.0)) <= 1.05) {
tmp = t_1 * sqrt((z * 2.0));
} else {
tmp = sqrt(z) * (t * (t_1 * 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 = (x * 0.5d0) - y
if (exp(((t * t) / 2.0d0)) <= 1.05d0) then
tmp = t_1 * sqrt((z * 2.0d0))
else
tmp = sqrt(z) * (t * (t_1 * sqrt(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 tmp;
if (Math.exp(((t * t) / 2.0)) <= 1.05) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else {
tmp = Math.sqrt(z) * (t * (t_1 * Math.sqrt(2.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if math.exp(((t * t) / 2.0)) <= 1.05: tmp = t_1 * math.sqrt((z * 2.0)) else: tmp = math.sqrt(z) * (t * (t_1 * math.sqrt(2.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (exp(Float64(Float64(t * t) / 2.0)) <= 1.05) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); else tmp = Float64(sqrt(z) * Float64(t * Float64(t_1 * sqrt(2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if (exp(((t * t) / 2.0)) <= 1.05) tmp = t_1 * sqrt((z * 2.0)); else tmp = sqrt(z) * (t * (t_1 * sqrt(2.0))); 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[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 1.05], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[z], $MachinePrecision] * N[(t * N[(t$95$1 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;e^{\frac{t \cdot t}{2}} \leq 1.05:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z} \cdot \left(t \cdot \left(t\_1 \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if (exp.f64 (/.f64 (*.f64 t t) #s(literal 2 binary64))) < 1.05000000000000004Initial program 99.6%
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%
Simplified99.7%
Taylor expanded in t around 0 99.0%
if 1.05000000000000004 < (exp.f64 (/.f64 (*.f64 t t) #s(literal 2 binary64))) Initial program 98.4%
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%
Simplified100.0%
Taylor expanded in t around 0 69.0%
distribute-lft-out69.0%
*-commutative69.0%
Simplified69.0%
Taylor expanded in t around inf 24.2%
Final simplification62.2%
(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.0%
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%
Simplified99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= (* t t) 0.0004)
(* t_1 (sqrt (* 2.0 (+ z (* z (pow t 2.0))))))
(if (<= (* t t) 5e+248)
(* (exp (/ (* t t) 2.0)) (* y (- (sqrt (* z 2.0)))))
(* t_1 (sqrt (* (* z 2.0) (fma t t 1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if ((t * t) <= 0.0004) {
tmp = t_1 * sqrt((2.0 * (z + (z * pow(t, 2.0)))));
} else if ((t * t) <= 5e+248) {
tmp = exp(((t * t) / 2.0)) * (y * -sqrt((z * 2.0)));
} else {
tmp = t_1 * sqrt(((z * 2.0) * fma(t, t, 1.0)));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (Float64(t * t) <= 0.0004) tmp = Float64(t_1 * sqrt(Float64(2.0 * Float64(z + Float64(z * (t ^ 2.0)))))); elseif (Float64(t * t) <= 5e+248) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(y * Float64(-sqrt(Float64(z * 2.0))))); else tmp = Float64(t_1 * sqrt(Float64(Float64(z * 2.0) * fma(t, t, 1.0)))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 0.0004], N[(t$95$1 * N[Sqrt[N[(2.0 * N[(z + N[(z * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 5e+248], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \cdot t \leq 0.0004:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z + z \cdot {t}^{2}\right)}\\
\mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+248}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot \left(-\sqrt{z \cdot 2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 4.00000000000000019e-4Initial program 99.6%
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%
Simplified99.7%
Taylor expanded in t around 0 99.4%
distribute-lft-out99.4%
*-commutative99.4%
Simplified99.4%
if 4.00000000000000019e-4 < (*.f64 t t) < 4.9999999999999996e248Initial program 98.4%
Taylor expanded in x around 0 75.0%
mul-1-neg75.0%
*-commutative75.0%
distribute-rgt-neg-in75.0%
*-commutative75.0%
distribute-rgt-neg-in75.0%
Simplified75.0%
associate-*r*75.0%
sqrt-prod75.0%
*-commutative75.0%
distribute-lft-neg-out75.0%
neg-sub075.0%
*-commutative75.0%
Applied egg-rr75.0%
neg-sub075.0%
distribute-rgt-neg-in75.0%
*-commutative75.0%
Simplified75.0%
if 4.9999999999999996e248 < (*.f64 t t) Initial program 98.4%
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%
Simplified100.0%
Taylor expanded in t around 0 98.4%
+-commutative98.4%
unpow298.4%
fma-define98.4%
Simplified98.4%
Final simplification93.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))) (t_2 (- (* x 0.5) y)))
(if (<= (* t t) 0.0004)
(* t_2 (* t_1 (hypot 1.0 t)))
(if (<= (* t t) 5e+248)
(* (exp (/ (* t t) 2.0)) (* y (- t_1)))
(* t_2 (sqrt (* (* z 2.0) (fma t t 1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double t_2 = (x * 0.5) - y;
double tmp;
if ((t * t) <= 0.0004) {
tmp = t_2 * (t_1 * hypot(1.0, t));
} else if ((t * t) <= 5e+248) {
tmp = exp(((t * t) / 2.0)) * (y * -t_1);
} else {
tmp = t_2 * sqrt(((z * 2.0) * fma(t, t, 1.0)));
}
return tmp;
}
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) t_2 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (Float64(t * t) <= 0.0004) tmp = Float64(t_2 * Float64(t_1 * hypot(1.0, t))); elseif (Float64(t * t) <= 5e+248) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(y * Float64(-t_1))); else tmp = Float64(t_2 * sqrt(Float64(Float64(z * 2.0) * fma(t, t, 1.0)))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 0.0004], N[(t$95$2 * N[(t$95$1 * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 5e+248], 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[(N[(z * 2.0), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
t_2 := x \cdot 0.5 - y\\
\mathbf{if}\;t \cdot t \leq 0.0004:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \mathsf{hypot}\left(1, t\right)\right)\\
\mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+248}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot \left(-t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sqrt{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 4.00000000000000019e-4Initial program 99.6%
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%
Simplified99.7%
Taylor expanded in t around 0 99.3%
+-commutative99.3%
unpow299.3%
fma-define99.3%
Simplified99.3%
sqrt-prod99.3%
Applied egg-rr99.3%
*-commutative99.3%
fma-undefine99.3%
unpow299.3%
+-commutative99.3%
unpow299.3%
hypot-1-def99.3%
Simplified99.3%
if 4.00000000000000019e-4 < (*.f64 t t) < 4.9999999999999996e248Initial program 98.4%
Taylor expanded in x around 0 75.0%
mul-1-neg75.0%
*-commutative75.0%
distribute-rgt-neg-in75.0%
*-commutative75.0%
distribute-rgt-neg-in75.0%
Simplified75.0%
associate-*r*75.0%
sqrt-prod75.0%
*-commutative75.0%
distribute-lft-neg-out75.0%
neg-sub075.0%
*-commutative75.0%
Applied egg-rr75.0%
neg-sub075.0%
distribute-rgt-neg-in75.0%
*-commutative75.0%
Simplified75.0%
if 4.9999999999999996e248 < (*.f64 t t) Initial program 98.4%
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%
Simplified100.0%
Taylor expanded in t around 0 98.4%
+-commutative98.4%
unpow298.4%
fma-define98.4%
Simplified98.4%
Final simplification93.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* z 2.0))))
(if (<= t 0.155)
(* t_1 (* t_2 (hypot 1.0 t)))
(if (<= t 3.7e+230)
(* (exp (/ (* t t) 2.0)) (* y (- t_2)))
(* t_1 (* t (* (sqrt 2.0) (sqrt z))))))))
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 <= 0.155) {
tmp = t_1 * (t_2 * hypot(1.0, t));
} else if (t <= 3.7e+230) {
tmp = exp(((t * t) / 2.0)) * (y * -t_2);
} else {
tmp = t_1 * (t * (sqrt(2.0) * sqrt(z)));
}
return tmp;
}
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 <= 0.155) {
tmp = t_1 * (t_2 * Math.hypot(1.0, t));
} else if (t <= 3.7e+230) {
tmp = Math.exp(((t * t) / 2.0)) * (y * -t_2);
} else {
tmp = t_1 * (t * (Math.sqrt(2.0) * Math.sqrt(z)));
}
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 <= 0.155: tmp = t_1 * (t_2 * math.hypot(1.0, t)) elif t <= 3.7e+230: tmp = math.exp(((t * t) / 2.0)) * (y * -t_2) else: tmp = t_1 * (t * (math.sqrt(2.0) * math.sqrt(z))) 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 <= 0.155) tmp = Float64(t_1 * Float64(t_2 * hypot(1.0, t))); elseif (t <= 3.7e+230) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(y * Float64(-t_2))); else tmp = Float64(t_1 * Float64(t * Float64(sqrt(2.0) * sqrt(z)))); 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 <= 0.155) tmp = t_1 * (t_2 * hypot(1.0, t)); elseif (t <= 3.7e+230) tmp = exp(((t * t) / 2.0)) * (y * -t_2); else tmp = t_1 * (t * (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]}, Block[{t$95$2 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 0.155], N[(t$95$1 * N[(t$95$2 * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e+230], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(y * (-t$95$2)), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[z], $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 0.155:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \mathsf{hypot}\left(1, t\right)\right)\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+230}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot \left(-t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if t < 0.154999999999999999Initial program 98.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 87.2%
+-commutative87.2%
unpow287.2%
fma-define87.2%
Simplified87.2%
sqrt-prod85.8%
Applied egg-rr85.8%
*-commutative85.8%
fma-undefine85.8%
unpow285.8%
+-commutative85.8%
unpow285.8%
hypot-1-def81.1%
Simplified81.1%
if 0.154999999999999999 < t < 3.69999999999999992e230Initial program 100.0%
Taylor expanded in x around 0 78.3%
mul-1-neg78.3%
*-commutative78.3%
distribute-rgt-neg-in78.3%
*-commutative78.3%
distribute-rgt-neg-in78.3%
Simplified78.3%
associate-*r*78.3%
sqrt-prod78.3%
*-commutative78.3%
distribute-lft-neg-out78.3%
neg-sub078.3%
*-commutative78.3%
Applied egg-rr78.3%
neg-sub078.3%
distribute-rgt-neg-in78.3%
*-commutative78.3%
Simplified78.3%
if 3.69999999999999992e230 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
pow1100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
unpow1100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
distribute-lft-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 90.5%
associate-*l*90.5%
Simplified90.5%
Final simplification80.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* z 2.0))))
(if (<= t 0.044)
(* t_1 t_2)
(if (<= t 1.35e+230)
(* (exp (/ (* t t) 2.0)) (* y (- t_2)))
(* t_1 (* t (* (sqrt 2.0) (sqrt z))))))))
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 <= 0.044) {
tmp = t_1 * t_2;
} else if (t <= 1.35e+230) {
tmp = exp(((t * t) / 2.0)) * (y * -t_2);
} else {
tmp = t_1 * (t * (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) :: t_2
real(8) :: tmp
t_1 = (x * 0.5d0) - y
t_2 = sqrt((z * 2.0d0))
if (t <= 0.044d0) then
tmp = t_1 * t_2
else if (t <= 1.35d+230) then
tmp = exp(((t * t) / 2.0d0)) * (y * -t_2)
else
tmp = t_1 * (t * (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 t_2 = Math.sqrt((z * 2.0));
double tmp;
if (t <= 0.044) {
tmp = t_1 * t_2;
} else if (t <= 1.35e+230) {
tmp = Math.exp(((t * t) / 2.0)) * (y * -t_2);
} else {
tmp = t_1 * (t * (Math.sqrt(2.0) * Math.sqrt(z)));
}
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 <= 0.044: tmp = t_1 * t_2 elif t <= 1.35e+230: tmp = math.exp(((t * t) / 2.0)) * (y * -t_2) else: tmp = t_1 * (t * (math.sqrt(2.0) * math.sqrt(z))) 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 <= 0.044) tmp = Float64(t_1 * t_2); elseif (t <= 1.35e+230) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(y * Float64(-t_2))); else tmp = Float64(t_1 * Float64(t * Float64(sqrt(2.0) * sqrt(z)))); 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 <= 0.044) tmp = t_1 * t_2; elseif (t <= 1.35e+230) tmp = exp(((t * t) / 2.0)) * (y * -t_2); else tmp = t_1 * (t * (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]}, Block[{t$95$2 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 0.044], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[t, 1.35e+230], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(y * (-t$95$2)), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[z], $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 0.044:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+230}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot \left(-t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t \cdot \left(\sqrt{2} \cdot \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if t < 0.043999999999999997Initial program 98.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 70.3%
if 0.043999999999999997 < t < 1.35000000000000002e230Initial program 100.0%
Taylor expanded in x around 0 78.3%
mul-1-neg78.3%
*-commutative78.3%
distribute-rgt-neg-in78.3%
*-commutative78.3%
distribute-rgt-neg-in78.3%
Simplified78.3%
associate-*r*78.3%
sqrt-prod78.3%
*-commutative78.3%
distribute-lft-neg-out78.3%
neg-sub078.3%
*-commutative78.3%
Applied egg-rr78.3%
neg-sub078.3%
distribute-rgt-neg-in78.3%
*-commutative78.3%
Simplified78.3%
if 1.35000000000000002e230 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
pow1100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
unpow1100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
distribute-lft-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 90.5%
associate-*l*90.5%
Simplified90.5%
Final simplification72.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 0.31)
(* t_1 (sqrt (* z 2.0)))
(* t (* (sqrt z) (* t_1 (sqrt 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 0.31) {
tmp = t_1 * sqrt((z * 2.0));
} else {
tmp = t * (sqrt(z) * (t_1 * 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 = (x * 0.5d0) - y
if (t <= 0.31d0) then
tmp = t_1 * sqrt((z * 2.0d0))
else
tmp = t * (sqrt(z) * (t_1 * sqrt(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 tmp;
if (t <= 0.31) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else {
tmp = t * (Math.sqrt(z) * (t_1 * Math.sqrt(2.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if t <= 0.31: tmp = t_1 * math.sqrt((z * 2.0)) else: tmp = t * (math.sqrt(z) * (t_1 * math.sqrt(2.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 0.31) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); else tmp = Float64(t * Float64(sqrt(z) * Float64(t_1 * sqrt(2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if (t <= 0.31) tmp = t_1 * sqrt((z * 2.0)); else tmp = t * (sqrt(z) * (t_1 * sqrt(2.0))); 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, 0.31], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[z], $MachinePrecision] * N[(t$95$1 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 0.31:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\sqrt{z} \cdot \left(t\_1 \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if t < 0.309999999999999998Initial program 98.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 70.3%
if 0.309999999999999998 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
pow1100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
unpow1100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in t around 0 74.2%
distribute-lft-out74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in t around inf 54.0%
associate-*l*52.4%
*-commutative52.4%
Simplified52.4%
Final simplification66.4%
(FPCore (x y z t) :precision binary64 (* (exp (/ (* t t) 2.0)) (* (- (* x 0.5) y) (sqrt (* z 2.0)))))
double code(double x, double y, double z, double t) {
return exp(((t * t) / 2.0)) * (((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 = exp(((t * t) / 2.0d0)) * (((x * 0.5d0) - y) * sqrt((z * 2.0d0)))
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((z * 2.0)));
}
def code(x, y, z, t): return math.exp(((t * t) / 2.0)) * (((x * 0.5) - y) * math.sqrt((z * 2.0)))
function code(x, y, z, t) return Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0)))) end
function tmp = code(x, y, z, t) tmp = exp(((t * t) / 2.0)) * (((x * 0.5) - y) * sqrt((z * 2.0))); 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[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{\frac{t \cdot t}{2}} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right)
\end{array}
Initial program 99.0%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (<= t 2.9e-19)
(* (- (* x 0.5) y) t_1)
(* t_1 (* y (+ (/ 0.5 (/ y x)) -1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if (t <= 2.9e-19) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (y * ((0.5 / (y / x)) + -1.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((z * 2.0d0))
if (t <= 2.9d-19) then
tmp = ((x * 0.5d0) - y) * t_1
else
tmp = t_1 * (y * ((0.5d0 / (y / x)) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z * 2.0));
double tmp;
if (t <= 2.9e-19) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (y * ((0.5 / (y / x)) + -1.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if t <= 2.9e-19: tmp = ((x * 0.5) - y) * t_1 else: tmp = t_1 * (y * ((0.5 / (y / x)) + -1.0)) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (t <= 2.9e-19) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); else tmp = Float64(t_1 * Float64(y * Float64(Float64(0.5 / Float64(y / x)) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if (t <= 2.9e-19) tmp = ((x * 0.5) - y) * t_1; else tmp = t_1 * (y * ((0.5 / (y / x)) + -1.0)); 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, 2.9e-19], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(y * N[(N[(0.5 / N[(y / x), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \leq 2.9 \cdot 10^{-19}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(y \cdot \left(\frac{0.5}{\frac{y}{x}} + -1\right)\right)\\
\end{array}
\end{array}
if t < 2.9e-19Initial program 98.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 70.1%
if 2.9e-19 < t Initial program 100.0%
Taylor expanded in t around 0 25.5%
Taylor expanded in y around inf 35.2%
clear-num35.2%
un-div-inv35.2%
Applied egg-rr35.2%
Final simplification62.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (<= t 5e-20)
(* (- (* x 0.5) y) t_1)
(* t_1 (* y (+ (* 0.5 (/ x y)) -1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if (t <= 5e-20) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (y * ((0.5 * (x / y)) + -1.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((z * 2.0d0))
if (t <= 5d-20) then
tmp = ((x * 0.5d0) - y) * t_1
else
tmp = t_1 * (y * ((0.5d0 * (x / y)) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z * 2.0));
double tmp;
if (t <= 5e-20) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (y * ((0.5 * (x / y)) + -1.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if t <= 5e-20: tmp = ((x * 0.5) - y) * t_1 else: tmp = t_1 * (y * ((0.5 * (x / y)) + -1.0)) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (t <= 5e-20) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); else tmp = Float64(t_1 * Float64(y * Float64(Float64(0.5 * Float64(x / y)) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if (t <= 5e-20) tmp = ((x * 0.5) - y) * t_1; else tmp = t_1 * (y * ((0.5 * (x / y)) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 5e-20], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(y * N[(N[(0.5 * N[(x / y), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(y \cdot \left(0.5 \cdot \frac{x}{y} + -1\right)\right)\\
\end{array}
\end{array}
if t < 4.9999999999999999e-20Initial program 98.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 70.1%
if 4.9999999999999999e-20 < t Initial program 100.0%
Taylor expanded in t around 0 25.5%
Taylor expanded in y around inf 35.2%
Final simplification62.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (or (<= y -8e+75) (not (<= y 2.4e+78)))
(* y (- t_1))
(* t_1 (* x 0.5)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if ((y <= -8e+75) || !(y <= 2.4e+78)) {
tmp = y * -t_1;
} else {
tmp = t_1 * (x * 0.5);
}
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 ((y <= (-8d+75)) .or. (.not. (y <= 2.4d+78))) then
tmp = y * -t_1
else
tmp = t_1 * (x * 0.5d0)
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 ((y <= -8e+75) || !(y <= 2.4e+78)) {
tmp = y * -t_1;
} else {
tmp = t_1 * (x * 0.5);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if (y <= -8e+75) or not (y <= 2.4e+78): tmp = y * -t_1 else: tmp = t_1 * (x * 0.5) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if ((y <= -8e+75) || !(y <= 2.4e+78)) tmp = Float64(y * Float64(-t_1)); else tmp = Float64(t_1 * Float64(x * 0.5)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if ((y <= -8e+75) || ~((y <= 2.4e+78))) tmp = y * -t_1; else tmp = t_1 * (x * 0.5); 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[y, -8e+75], N[Not[LessEqual[y, 2.4e+78]], $MachinePrecision]], N[(y * (-t$95$1)), $MachinePrecision], N[(t$95$1 * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;y \leq -8 \cdot 10^{+75} \lor \neg \left(y \leq 2.4 \cdot 10^{+78}\right):\\
\;\;\;\;y \cdot \left(-t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if y < -7.99999999999999941e75 or 2.3999999999999999e78 < y Initial program 99.8%
Taylor expanded in t around 0 64.4%
Taylor expanded in x around 0 54.1%
mul-1-neg54.1%
Simplified54.1%
*-rgt-identity54.1%
distribute-lft-neg-out54.1%
neg-sub054.1%
Applied egg-rr54.1%
neg-sub054.1%
distribute-rgt-neg-in54.1%
Simplified54.1%
if -7.99999999999999941e75 < y < 2.3999999999999999e78Initial program 98.5%
Taylor expanded in t around 0 56.8%
Taylor expanded in x around inf 44.8%
Final simplification48.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (sqrt (* z 2.0)))) (if (<= t 90000.0) (* (- (* 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 <= 90000.0) {
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 <= 90000.0d0) 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 <= 90000.0) {
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 <= 90000.0: 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 <= 90000.0) 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 <= 90000.0) 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, 90000.0], 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 90000:\\
\;\;\;\;\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 < 9e4Initial program 98.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 69.4%
if 9e4 < t Initial program 100.0%
Taylor expanded in t around 0 23.0%
Taylor expanded in x around inf 26.6%
mul-1-neg26.6%
unsub-neg26.6%
Simplified26.6%
Final simplification60.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.0%
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%
Simplified99.8%
Taylor expanded in t around 0 60.0%
Final simplification60.0%
(FPCore (x y z t) :precision binary64 (* y (- (sqrt (* z 2.0)))))
double code(double x, double y, double z, double t) {
return y * -sqrt((z * 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * -sqrt((z * 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return y * -Math.sqrt((z * 2.0));
}
def code(x, y, z, t): return y * -math.sqrt((z * 2.0))
function code(x, y, z, t) return Float64(y * Float64(-sqrt(Float64(z * 2.0)))) end
function tmp = code(x, y, z, t) tmp = y * -sqrt((z * 2.0)); end
code[x_, y_, z_, t_] := N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-\sqrt{z \cdot 2}\right)
\end{array}
Initial program 99.0%
Taylor expanded in t around 0 60.0%
Taylor expanded in x around 0 32.0%
mul-1-neg32.0%
Simplified32.0%
*-rgt-identity32.0%
distribute-lft-neg-out32.0%
neg-sub032.0%
Applied egg-rr32.0%
neg-sub032.0%
distribute-rgt-neg-in32.0%
Simplified32.0%
(FPCore (x y z t) :precision binary64 (* y (sqrt (* z 2.0))))
double code(double x, double y, double z, double t) {
return y * sqrt((z * 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * sqrt((z * 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return y * Math.sqrt((z * 2.0));
}
def code(x, y, z, t): return y * math.sqrt((z * 2.0))
function code(x, y, z, t) return Float64(y * sqrt(Float64(z * 2.0))) end
function tmp = code(x, y, z, t) tmp = y * sqrt((z * 2.0)); end
code[x_, y_, z_, t_] := N[(y * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \sqrt{z \cdot 2}
\end{array}
Initial program 99.0%
Taylor expanded in t around 0 60.0%
Taylor expanded in x around 0 32.0%
mul-1-neg32.0%
Simplified32.0%
*-rgt-identity32.0%
add-sqr-sqrt14.1%
sqrt-unprod14.6%
sqr-neg14.6%
sqrt-unprod1.9%
add-sqr-sqrt3.5%
pow13.5%
Applied egg-rr3.5%
unpow13.5%
Simplified3.5%
(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 2024139
(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))))