
(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 15 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) (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))
(t_3 (exp (/ (* t t) 2.0))))
(if (<= (* t t) 5e-7)
(* t_2 (sqrt (* (* 2.0 z) (fma t t 1.0))))
(if (<= (* t t) 4e+197)
(* t_3 (* t_1 (* x 0.5)))
(if (<= (* t t) 2e+278)
(* t_3 (* t_1 (- y)))
(* t_2 (sqrt (* 2.0 (* z (pow t 2.0))))))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double t_2 = (x * 0.5) - y;
double t_3 = exp(((t * t) / 2.0));
double tmp;
if ((t * t) <= 5e-7) {
tmp = t_2 * sqrt(((2.0 * z) * fma(t, t, 1.0)));
} else if ((t * t) <= 4e+197) {
tmp = t_3 * (t_1 * (x * 0.5));
} else if ((t * t) <= 2e+278) {
tmp = t_3 * (t_1 * -y);
} else {
tmp = t_2 * sqrt((2.0 * (z * 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) t_3 = exp(Float64(Float64(t * t) / 2.0)) tmp = 0.0 if (Float64(t * t) <= 5e-7) tmp = Float64(t_2 * sqrt(Float64(Float64(2.0 * z) * fma(t, t, 1.0)))); elseif (Float64(t * t) <= 4e+197) tmp = Float64(t_3 * Float64(t_1 * Float64(x * 0.5))); elseif (Float64(t * t) <= 2e+278) tmp = Float64(t_3 * Float64(t_1 * Float64(-y))); else tmp = Float64(t_2 * sqrt(Float64(2.0 * Float64(z * (t ^ 2.0))))); end return 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]}, Block[{t$95$3 = N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 5e-7], N[(t$95$2 * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 4e+197], N[(t$95$3 * N[(t$95$1 * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 2e+278], N[(t$95$3 * N[(t$95$1 * (-y)), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sqrt[N[(2.0 * N[(z * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
t_2 := x \cdot 0.5 - y\\
t_3 := e^{\frac{t \cdot t}{2}}\\
\mathbf{if}\;t \cdot t \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t\_2 \cdot \sqrt{\left(2 \cdot z\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\\
\mathbf{elif}\;t \cdot t \leq 4 \cdot 10^{+197}:\\
\;\;\;\;t\_3 \cdot \left(t\_1 \cdot \left(x \cdot 0.5\right)\right)\\
\mathbf{elif}\;t \cdot t \leq 2 \cdot 10^{+278}:\\
\;\;\;\;t\_3 \cdot \left(t\_1 \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sqrt{2 \cdot \left(z \cdot {t}^{2}\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 4.99999999999999977e-7Initial program 99.6%
associate-*l*99.6%
exp-sqrt99.6%
exp-prod99.6%
Simplified99.6%
pow199.6%
sqrt-unprod99.6%
associate-*l*99.6%
pow-exp99.6%
pow299.6%
Applied egg-rr99.6%
unpow199.6%
associate-*r*99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around 0 99.6%
+-commutative99.6%
unpow299.6%
fma-define99.6%
Simplified99.6%
if 4.99999999999999977e-7 < (*.f64 t t) < 3.9999999999999998e197Initial program 100.0%
Taylor expanded in x around inf 81.6%
if 3.9999999999999998e197 < (*.f64 t t) < 1.99999999999999993e278Initial program 100.0%
Taylor expanded in x around 0 90.0%
neg-mul-190.0%
Simplified90.0%
if 1.99999999999999993e278 < (*.f64 t t) Initial program 98.7%
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%
Final simplification96.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z)))
(t_2 (- (* x 0.5) y))
(t_3 (exp (/ (* t t) 2.0))))
(if (<= (* t t) 5e-7)
(* t_2 (* t_1 (hypot 1.0 t)))
(if (<= (* t t) 4e+197)
(* t_3 (* t_1 (* x 0.5)))
(if (<= (* t t) 2e+278)
(* t_3 (* t_1 (- y)))
(* t_2 (sqrt (* 2.0 (* z (pow t 2.0))))))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double t_2 = (x * 0.5) - y;
double t_3 = exp(((t * t) / 2.0));
double tmp;
if ((t * t) <= 5e-7) {
tmp = t_2 * (t_1 * hypot(1.0, t));
} else if ((t * t) <= 4e+197) {
tmp = t_3 * (t_1 * (x * 0.5));
} else if ((t * t) <= 2e+278) {
tmp = t_3 * (t_1 * -y);
} else {
tmp = t_2 * sqrt((2.0 * (z * pow(t, 2.0))));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((2.0 * z));
double t_2 = (x * 0.5) - y;
double t_3 = Math.exp(((t * t) / 2.0));
double tmp;
if ((t * t) <= 5e-7) {
tmp = t_2 * (t_1 * Math.hypot(1.0, t));
} else if ((t * t) <= 4e+197) {
tmp = t_3 * (t_1 * (x * 0.5));
} else if ((t * t) <= 2e+278) {
tmp = t_3 * (t_1 * -y);
} else {
tmp = t_2 * Math.sqrt((2.0 * (z * Math.pow(t, 2.0))));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) t_2 = (x * 0.5) - y t_3 = math.exp(((t * t) / 2.0)) tmp = 0 if (t * t) <= 5e-7: tmp = t_2 * (t_1 * math.hypot(1.0, t)) elif (t * t) <= 4e+197: tmp = t_3 * (t_1 * (x * 0.5)) elif (t * t) <= 2e+278: tmp = t_3 * (t_1 * -y) else: tmp = t_2 * math.sqrt((2.0 * (z * math.pow(t, 2.0)))) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) t_2 = Float64(Float64(x * 0.5) - y) t_3 = exp(Float64(Float64(t * t) / 2.0)) tmp = 0.0 if (Float64(t * t) <= 5e-7) tmp = Float64(t_2 * Float64(t_1 * hypot(1.0, t))); elseif (Float64(t * t) <= 4e+197) tmp = Float64(t_3 * Float64(t_1 * Float64(x * 0.5))); elseif (Float64(t * t) <= 2e+278) tmp = Float64(t_3 * Float64(t_1 * Float64(-y))); else tmp = Float64(t_2 * sqrt(Float64(2.0 * Float64(z * (t ^ 2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); t_2 = (x * 0.5) - y; t_3 = exp(((t * t) / 2.0)); tmp = 0.0; if ((t * t) <= 5e-7) tmp = t_2 * (t_1 * hypot(1.0, t)); elseif ((t * t) <= 4e+197) tmp = t_3 * (t_1 * (x * 0.5)); elseif ((t * t) <= 2e+278) tmp = t_3 * (t_1 * -y); else tmp = t_2 * sqrt((2.0 * (z * (t ^ 2.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 5e-7], N[(t$95$2 * N[(t$95$1 * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 4e+197], N[(t$95$3 * N[(t$95$1 * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 2e+278], N[(t$95$3 * N[(t$95$1 * (-y)), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sqrt[N[(2.0 * N[(z * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
t_2 := x \cdot 0.5 - y\\
t_3 := e^{\frac{t \cdot t}{2}}\\
\mathbf{if}\;t \cdot t \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \mathsf{hypot}\left(1, t\right)\right)\\
\mathbf{elif}\;t \cdot t \leq 4 \cdot 10^{+197}:\\
\;\;\;\;t\_3 \cdot \left(t\_1 \cdot \left(x \cdot 0.5\right)\right)\\
\mathbf{elif}\;t \cdot t \leq 2 \cdot 10^{+278}:\\
\;\;\;\;t\_3 \cdot \left(t\_1 \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sqrt{2 \cdot \left(z \cdot {t}^{2}\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 4.99999999999999977e-7Initial program 99.6%
associate-*l*99.6%
exp-sqrt99.6%
exp-prod99.6%
Simplified99.6%
pow199.6%
sqrt-unprod99.6%
associate-*l*99.6%
pow-exp99.6%
pow299.6%
Applied egg-rr99.6%
unpow199.6%
associate-*r*99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around 0 99.6%
+-commutative99.6%
unpow299.6%
fma-define99.6%
Simplified99.6%
sqrt-prod99.5%
Applied egg-rr99.5%
*-commutative99.5%
fma-undefine99.5%
unpow299.5%
+-commutative99.5%
unpow299.5%
hypot-1-def99.5%
Simplified99.5%
if 4.99999999999999977e-7 < (*.f64 t t) < 3.9999999999999998e197Initial program 100.0%
Taylor expanded in x around inf 81.6%
if 3.9999999999999998e197 < (*.f64 t t) < 1.99999999999999993e278Initial program 100.0%
Taylor expanded in x around 0 90.0%
neg-mul-190.0%
Simplified90.0%
if 1.99999999999999993e278 < (*.f64 t t) Initial program 98.7%
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%
Final simplification96.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))) (t_2 (- (* x 0.5) y)))
(if (<= (* t t) 5e-7)
(* t_2 (* t_1 (hypot 1.0 t)))
(if (<= (* t t) 2e+278)
(* (exp (/ (* t t) 2.0)) (* t_1 (- y)))
(* t_2 (sqrt (* 2.0 (* z (pow t 2.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double t_2 = (x * 0.5) - y;
double tmp;
if ((t * t) <= 5e-7) {
tmp = t_2 * (t_1 * hypot(1.0, t));
} else if ((t * t) <= 2e+278) {
tmp = exp(((t * t) / 2.0)) * (t_1 * -y);
} else {
tmp = t_2 * sqrt((2.0 * (z * pow(t, 2.0))));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((2.0 * z));
double t_2 = (x * 0.5) - y;
double tmp;
if ((t * t) <= 5e-7) {
tmp = t_2 * (t_1 * Math.hypot(1.0, t));
} else if ((t * t) <= 2e+278) {
tmp = Math.exp(((t * t) / 2.0)) * (t_1 * -y);
} else {
tmp = t_2 * Math.sqrt((2.0 * (z * Math.pow(t, 2.0))));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) t_2 = (x * 0.5) - y tmp = 0 if (t * t) <= 5e-7: tmp = t_2 * (t_1 * math.hypot(1.0, t)) elif (t * t) <= 2e+278: tmp = math.exp(((t * t) / 2.0)) * (t_1 * -y) else: tmp = t_2 * math.sqrt((2.0 * (z * math.pow(t, 2.0)))) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) t_2 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (Float64(t * t) <= 5e-7) tmp = Float64(t_2 * Float64(t_1 * hypot(1.0, t))); elseif (Float64(t * t) <= 2e+278) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(t_1 * Float64(-y))); else tmp = Float64(t_2 * sqrt(Float64(2.0 * Float64(z * (t ^ 2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); t_2 = (x * 0.5) - y; tmp = 0.0; if ((t * t) <= 5e-7) tmp = t_2 * (t_1 * hypot(1.0, t)); elseif ((t * t) <= 2e+278) tmp = exp(((t * t) / 2.0)) * (t_1 * -y); else tmp = t_2 * sqrt((2.0 * (z * (t ^ 2.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 5e-7], N[(t$95$2 * N[(t$95$1 * N[Sqrt[1.0 ^ 2 + t ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 2e+278], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * (-y)), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sqrt[N[(2.0 * N[(z * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
t_2 := x \cdot 0.5 - y\\
\mathbf{if}\;t \cdot t \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \mathsf{hypot}\left(1, t\right)\right)\\
\mathbf{elif}\;t \cdot t \leq 2 \cdot 10^{+278}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(t\_1 \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sqrt{2 \cdot \left(z \cdot {t}^{2}\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 4.99999999999999977e-7Initial program 99.6%
associate-*l*99.6%
exp-sqrt99.6%
exp-prod99.6%
Simplified99.6%
pow199.6%
sqrt-unprod99.6%
associate-*l*99.6%
pow-exp99.6%
pow299.6%
Applied egg-rr99.6%
unpow199.6%
associate-*r*99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around 0 99.6%
+-commutative99.6%
unpow299.6%
fma-define99.6%
Simplified99.6%
sqrt-prod99.5%
Applied egg-rr99.5%
*-commutative99.5%
fma-undefine99.5%
unpow299.5%
+-commutative99.5%
unpow299.5%
hypot-1-def99.5%
Simplified99.5%
if 4.99999999999999977e-7 < (*.f64 t t) < 1.99999999999999993e278Initial program 100.0%
Taylor expanded in x around 0 75.9%
neg-mul-175.9%
Simplified75.9%
if 1.99999999999999993e278 < (*.f64 t t) Initial program 98.7%
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%
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) 5e-7)
(* t_1 t_2)
(if (<= (* t t) 2e+278)
(* (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((2.0 * z));
double tmp;
if ((t * t) <= 5e-7) {
tmp = t_1 * t_2;
} else if ((t * t) <= 2e+278) {
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((2.0d0 * z))
if ((t * t) <= 5d-7) then
tmp = t_1 * t_2
else if ((t * t) <= 2d+278) 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((2.0 * z));
double tmp;
if ((t * t) <= 5e-7) {
tmp = t_1 * t_2;
} else if ((t * t) <= 2e+278) {
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((2.0 * z)) tmp = 0 if (t * t) <= 5e-7: tmp = t_1 * t_2 elif (t * t) <= 2e+278: 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(2.0 * z)) tmp = 0.0 if (Float64(t * t) <= 5e-7) tmp = Float64(t_1 * t_2); elseif (Float64(t * t) <= 2e+278) 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((2.0 * z)); tmp = 0.0; if ((t * t) <= 5e-7) tmp = t_1 * t_2; elseif ((t * t) <= 2e+278) 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[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 5e-7], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 2e+278], 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{2 \cdot z}\\
\mathbf{if}\;t \cdot t \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;t \cdot t \leq 2 \cdot 10^{+278}:\\
\;\;\;\;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) < 4.99999999999999977e-7Initial program 99.6%
associate-*l*99.6%
exp-sqrt99.6%
exp-prod99.6%
Simplified99.6%
pow199.6%
sqrt-unprod99.6%
associate-*l*99.6%
pow-exp99.6%
pow299.6%
Applied egg-rr99.6%
unpow199.6%
associate-*r*99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around 0 98.6%
if 4.99999999999999977e-7 < (*.f64 t t) < 1.99999999999999993e278Initial program 100.0%
Taylor expanded in x around 0 75.9%
neg-mul-175.9%
Simplified75.9%
if 1.99999999999999993e278 < (*.f64 t t) Initial program 98.7%
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%
Final simplification93.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* 2.0 z))))
(if (<= t 0.014)
(* t_1 t_2)
(if (<= t 3.2e+151)
(* (exp (/ (* t t) 2.0)) (* t_2 (- y)))
(* (* 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 t_2 = sqrt((2.0 * z));
double tmp;
if (t <= 0.014) {
tmp = t_1 * t_2;
} else if (t <= 3.2e+151) {
tmp = exp(((t * t) / 2.0)) * (t_2 * -y);
} 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) :: t_2
real(8) :: tmp
t_1 = (x * 0.5d0) - y
t_2 = sqrt((2.0d0 * z))
if (t <= 0.014d0) then
tmp = t_1 * t_2
else if (t <= 3.2d+151) then
tmp = exp(((t * t) / 2.0d0)) * (t_2 * -y)
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 t_2 = Math.sqrt((2.0 * z));
double tmp;
if (t <= 0.014) {
tmp = t_1 * t_2;
} else if (t <= 3.2e+151) {
tmp = Math.exp(((t * t) / 2.0)) * (t_2 * -y);
} 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 t_2 = math.sqrt((2.0 * z)) tmp = 0 if t <= 0.014: tmp = t_1 * t_2 elif t <= 3.2e+151: tmp = math.exp(((t * t) / 2.0)) * (t_2 * -y) 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) t_2 = sqrt(Float64(2.0 * z)) tmp = 0.0 if (t <= 0.014) tmp = Float64(t_1 * t_2); elseif (t <= 3.2e+151) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(t_2 * Float64(-y))); 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; t_2 = sqrt((2.0 * z)); tmp = 0.0; if (t <= 0.014) tmp = t_1 * t_2; elseif (t <= 3.2e+151) tmp = exp(((t * t) / 2.0)) * (t_2 * -y); 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]}, Block[{t$95$2 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 0.014], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[t, 3.2e+151], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * (-y)), $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\\
t_2 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t \leq 0.014:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+151}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(t\_2 \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \left(t\_1 \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\\
\end{array}
\end{array}
if t < 0.0140000000000000003Initial program 99.7%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
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%
Taylor expanded in t around 0 72.7%
if 0.0140000000000000003 < t < 3.19999999999999994e151Initial program 100.0%
Taylor expanded in x around 0 73.0%
neg-mul-173.0%
Simplified73.0%
if 3.19999999999999994e151 < t Initial program 97.6%
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 74.4%
Final simplification73.0%
(FPCore (x y z t)
:precision binary64
(if (<= t 3.4e+87)
(* (- (* x 0.5) y) (sqrt (* 2.0 z)))
(if (<= t 2.6e+190)
(* x (* 0.5 (pow (pow (* 2.0 z) 1.5) 0.3333333333333333)))
(sqrt (* (pow x 2.0) (* 0.5 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.4e+87) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else if (t <= 2.6e+190) {
tmp = x * (0.5 * pow(pow((2.0 * z), 1.5), 0.3333333333333333));
} else {
tmp = sqrt((pow(x, 2.0) * (0.5 * z)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 3.4d+87) then
tmp = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
else if (t <= 2.6d+190) then
tmp = x * (0.5d0 * (((2.0d0 * z) ** 1.5d0) ** 0.3333333333333333d0))
else
tmp = sqrt(((x ** 2.0d0) * (0.5d0 * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.4e+87) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else if (t <= 2.6e+190) {
tmp = x * (0.5 * Math.pow(Math.pow((2.0 * z), 1.5), 0.3333333333333333));
} else {
tmp = Math.sqrt((Math.pow(x, 2.0) * (0.5 * z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3.4e+87: tmp = ((x * 0.5) - y) * math.sqrt((2.0 * z)) elif t <= 2.6e+190: tmp = x * (0.5 * math.pow(math.pow((2.0 * z), 1.5), 0.3333333333333333)) else: tmp = math.sqrt((math.pow(x, 2.0) * (0.5 * z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3.4e+87) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); elseif (t <= 2.6e+190) tmp = Float64(x * Float64(0.5 * ((Float64(2.0 * z) ^ 1.5) ^ 0.3333333333333333))); else tmp = sqrt(Float64((x ^ 2.0) * Float64(0.5 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.4e+87) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); elseif (t <= 2.6e+190) tmp = x * (0.5 * (((2.0 * z) ^ 1.5) ^ 0.3333333333333333)); else tmp = sqrt(((x ^ 2.0) * (0.5 * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.4e+87], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+190], N[(x * N[(0.5 * N[Power[N[Power[N[(2.0 * z), $MachinePrecision], 1.5], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[Power[x, 2.0], $MachinePrecision] * N[(0.5 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.4 \cdot 10^{+87}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+190}:\\
\;\;\;\;x \cdot \left(0.5 \cdot {\left({\left(2 \cdot z\right)}^{1.5}\right)}^{0.3333333333333333}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{x}^{2} \cdot \left(0.5 \cdot z\right)}\\
\end{array}
\end{array}
if t < 3.4000000000000002e87Initial program 99.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%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 67.1%
if 3.4000000000000002e87 < t < 2.60000000000000011e190Initial program 95.8%
Taylor expanded in x around inf 70.8%
Taylor expanded in t around 0 6.9%
pow16.9%
*-rgt-identity6.9%
*-commutative6.9%
associate-*l*6.9%
*-commutative6.9%
Applied egg-rr6.9%
Simplified6.9%
add-cbrt-cube26.7%
pow1/326.7%
add-sqr-sqrt26.7%
pow126.7%
pow1/226.7%
pow-prod-up26.7%
metadata-eval26.7%
Applied egg-rr26.7%
if 2.60000000000000011e190 < t Initial program 100.0%
Taylor expanded in x around inf 87.5%
Taylor expanded in t around 0 10.1%
pow110.1%
*-rgt-identity10.1%
*-commutative10.1%
associate-*l*10.1%
*-commutative10.1%
Applied egg-rr10.1%
Simplified10.1%
add-sqr-sqrt2.2%
sqrt-unprod14.1%
swap-sqr25.9%
unpow225.9%
swap-sqr25.9%
metadata-eval25.9%
add-sqr-sqrt25.9%
*-commutative25.9%
Applied egg-rr25.9%
associate-*r*25.9%
metadata-eval25.9%
Simplified25.9%
Final simplification58.2%
(FPCore (x y z t)
:precision binary64
(if (<= t 3.2e+87)
(* (- (* x 0.5) y) (sqrt (* 2.0 z)))
(if (<= t 2.8e+190)
(* x (* 0.5 (cbrt (pow (* 2.0 z) 1.5))))
(sqrt (* (pow x 2.0) (* 0.5 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.2e+87) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else if (t <= 2.8e+190) {
tmp = x * (0.5 * cbrt(pow((2.0 * z), 1.5)));
} else {
tmp = sqrt((pow(x, 2.0) * (0.5 * z)));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.2e+87) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else if (t <= 2.8e+190) {
tmp = x * (0.5 * Math.cbrt(Math.pow((2.0 * z), 1.5)));
} else {
tmp = Math.sqrt((Math.pow(x, 2.0) * (0.5 * z)));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 3.2e+87) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); elseif (t <= 2.8e+190) tmp = Float64(x * Float64(0.5 * cbrt((Float64(2.0 * z) ^ 1.5)))); else tmp = sqrt(Float64((x ^ 2.0) * Float64(0.5 * z))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.2e+87], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e+190], N[(x * N[(0.5 * N[Power[N[Power[N[(2.0 * z), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[Power[x, 2.0], $MachinePrecision] * N[(0.5 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.2 \cdot 10^{+87}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+190}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \sqrt[3]{{\left(2 \cdot z\right)}^{1.5}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{x}^{2} \cdot \left(0.5 \cdot z\right)}\\
\end{array}
\end{array}
if t < 3.2e87Initial program 99.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%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 67.1%
if 3.2e87 < t < 2.79999999999999997e190Initial program 95.8%
Taylor expanded in x around inf 70.8%
Taylor expanded in t around 0 6.9%
pow16.9%
*-rgt-identity6.9%
*-commutative6.9%
associate-*l*6.9%
*-commutative6.9%
Applied egg-rr6.9%
Simplified6.9%
add-cbrt-cube26.7%
add-sqr-sqrt26.7%
pow126.7%
pow1/226.7%
pow-prod-up26.7%
metadata-eval26.7%
Applied egg-rr26.7%
if 2.79999999999999997e190 < t Initial program 100.0%
Taylor expanded in x around inf 87.5%
Taylor expanded in t around 0 10.1%
pow110.1%
*-rgt-identity10.1%
*-commutative10.1%
associate-*l*10.1%
*-commutative10.1%
Applied egg-rr10.1%
Simplified10.1%
add-sqr-sqrt2.2%
sqrt-unprod14.1%
swap-sqr25.9%
unpow225.9%
swap-sqr25.9%
metadata-eval25.9%
add-sqr-sqrt25.9%
*-commutative25.9%
Applied egg-rr25.9%
associate-*r*25.9%
metadata-eval25.9%
Simplified25.9%
Final simplification58.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= (* t t) 5e-7)
(* 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) <= 5e-7) {
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) <= 5d-7) 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) <= 5e-7) {
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) <= 5e-7: 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) <= 5e-7) 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) <= 5e-7) 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], 5e-7], 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 5 \cdot 10^{-7}:\\
\;\;\;\;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) < 4.99999999999999977e-7Initial program 99.6%
associate-*l*99.6%
exp-sqrt99.6%
exp-prod99.6%
Simplified99.6%
pow199.6%
sqrt-unprod99.6%
associate-*l*99.6%
pow-exp99.6%
pow299.6%
Applied egg-rr99.6%
unpow199.6%
associate-*r*99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around 0 98.6%
if 4.99999999999999977e-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 74.3%
+-commutative74.3%
unpow274.3%
fma-define74.3%
Simplified74.3%
Taylor expanded in t around inf 31.5%
Final simplification63.8%
(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 (if (<= t 1.55e+51) (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (* 0.5 (sqrt (* z (* 2.0 (pow x 2.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.55e+51) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else {
tmp = 0.5 * sqrt((z * (2.0 * pow(x, 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 <= 1.55d+51) then
tmp = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
else
tmp = 0.5d0 * sqrt((z * (2.0d0 * (x ** 2.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.55e+51) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else {
tmp = 0.5 * Math.sqrt((z * (2.0 * Math.pow(x, 2.0))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.55e+51: tmp = ((x * 0.5) - y) * math.sqrt((2.0 * z)) else: tmp = 0.5 * math.sqrt((z * (2.0 * math.pow(x, 2.0)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.55e+51) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); else tmp = Float64(0.5 * sqrt(Float64(z * Float64(2.0 * (x ^ 2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.55e+51) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); else tmp = 0.5 * sqrt((z * (2.0 * (x ^ 2.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.55e+51], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(z * N[(2.0 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.55 \cdot 10^{+51}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{z \cdot \left(2 \cdot {x}^{2}\right)}\\
\end{array}
\end{array}
if t < 1.55000000000000006e51Initial program 99.7%
associate-*l*99.8%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
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%
Taylor expanded in t around 0 69.2%
if 1.55000000000000006e51 < t Initial program 98.4%
Taylor expanded in x around inf 78.1%
Taylor expanded in t around 0 8.1%
*-commutative8.1%
Simplified8.1%
add-sqr-sqrt1.9%
sqrt-unprod14.0%
*-commutative14.0%
*-commutative14.0%
swap-sqr19.9%
add-sqr-sqrt19.9%
swap-sqr19.9%
rem-square-sqrt19.9%
pow219.9%
Applied egg-rr19.9%
(FPCore (x y z t) :precision binary64 (if (<= t 1.6e+53) (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (sqrt (* (pow x 2.0) (* 0.5 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.6e+53) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else {
tmp = sqrt((pow(x, 2.0) * (0.5 * z)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.6d+53) then
tmp = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
else
tmp = sqrt(((x ** 2.0d0) * (0.5d0 * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.6e+53) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else {
tmp = Math.sqrt((Math.pow(x, 2.0) * (0.5 * z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.6e+53: tmp = ((x * 0.5) - y) * math.sqrt((2.0 * z)) else: tmp = math.sqrt((math.pow(x, 2.0) * (0.5 * z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.6e+53) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); else tmp = sqrt(Float64((x ^ 2.0) * Float64(0.5 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.6e+53) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); else tmp = sqrt(((x ^ 2.0) * (0.5 * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.6e+53], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[Power[x, 2.0], $MachinePrecision] * N[(0.5 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.6 \cdot 10^{+53}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{x}^{2} \cdot \left(0.5 \cdot z\right)}\\
\end{array}
\end{array}
if t < 1.6e53Initial program 99.7%
associate-*l*99.8%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
pow199.7%
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%
Taylor expanded in t around 0 69.2%
if 1.6e53 < t Initial program 98.4%
Taylor expanded in x around inf 78.1%
Taylor expanded in t around 0 8.1%
pow18.1%
*-rgt-identity8.1%
*-commutative8.1%
associate-*l*8.1%
*-commutative8.1%
Applied egg-rr8.1%
Simplified8.1%
add-sqr-sqrt1.9%
sqrt-unprod14.0%
swap-sqr19.9%
unpow219.9%
swap-sqr19.9%
metadata-eval19.9%
add-sqr-sqrt19.9%
*-commutative19.9%
Applied egg-rr19.9%
associate-*r*19.9%
metadata-eval19.9%
Simplified19.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5e-51) (not (<= y 6e-28))) (* (sqrt (* 2.0 z)) (- y)) (* x (sqrt (* 0.5 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5e-51) || !(y <= 6e-28)) {
tmp = sqrt((2.0 * z)) * -y;
} else {
tmp = x * sqrt((0.5 * z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-5d-51)) .or. (.not. (y <= 6d-28))) then
tmp = sqrt((2.0d0 * z)) * -y
else
tmp = x * sqrt((0.5d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5e-51) || !(y <= 6e-28)) {
tmp = Math.sqrt((2.0 * z)) * -y;
} else {
tmp = x * Math.sqrt((0.5 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5e-51) or not (y <= 6e-28): tmp = math.sqrt((2.0 * z)) * -y else: tmp = x * math.sqrt((0.5 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5e-51) || !(y <= 6e-28)) tmp = Float64(sqrt(Float64(2.0 * z)) * Float64(-y)); else tmp = Float64(x * sqrt(Float64(0.5 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5e-51) || ~((y <= 6e-28))) tmp = sqrt((2.0 * z)) * -y; else tmp = x * sqrt((0.5 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5e-51], N[Not[LessEqual[y, 6e-28]], $MachinePrecision]], N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision], N[(x * N[Sqrt[N[(0.5 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-51} \lor \neg \left(y \leq 6 \cdot 10^{-28}\right):\\
\;\;\;\;\sqrt{2 \cdot z} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\
\end{array}
\end{array}
if y < -5.00000000000000004e-51 or 6.00000000000000005e-28 < y Initial program 99.8%
Taylor expanded in x around 0 81.0%
neg-mul-181.0%
Simplified81.0%
Taylor expanded in t around 0 45.8%
if -5.00000000000000004e-51 < y < 6.00000000000000005e-28Initial program 98.9%
Taylor expanded in x around inf 85.5%
Taylor expanded in t around 0 42.2%
pow142.2%
*-rgt-identity42.2%
*-commutative42.2%
associate-*l*42.2%
*-commutative42.2%
Applied egg-rr42.2%
Simplified42.2%
add-sqr-sqrt42.0%
sqrt-unprod42.2%
swap-sqr42.2%
metadata-eval42.2%
add-sqr-sqrt42.2%
*-commutative42.2%
Applied egg-rr42.2%
associate-*r*42.2%
metadata-eval42.2%
Simplified42.2%
Final simplification44.2%
(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%
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%
Taylor expanded in t around 0 54.5%
(FPCore (x y z t) :precision binary64 (* x (sqrt (* 0.5 z))))
double code(double x, double y, double z, double t) {
return x * sqrt((0.5 * 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 * sqrt((0.5d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return x * Math.sqrt((0.5 * z));
}
def code(x, y, z, t): return x * math.sqrt((0.5 * z))
function code(x, y, z, t) return Float64(x * sqrt(Float64(0.5 * z))) end
function tmp = code(x, y, z, t) tmp = x * sqrt((0.5 * z)); end
code[x_, y_, z_, t_] := N[(x * N[Sqrt[N[(0.5 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \sqrt{0.5 \cdot z}
\end{array}
Initial program 99.4%
Taylor expanded in x around inf 63.3%
Taylor expanded in t around 0 26.7%
pow126.7%
*-rgt-identity26.7%
*-commutative26.7%
associate-*l*26.7%
*-commutative26.7%
Applied egg-rr26.7%
Simplified26.7%
add-sqr-sqrt26.6%
sqrt-unprod26.7%
swap-sqr26.7%
metadata-eval26.7%
add-sqr-sqrt26.7%
*-commutative26.7%
Applied egg-rr26.7%
associate-*r*26.7%
metadata-eval26.7%
Simplified26.7%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * pow(exp(1.0), ((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * (exp(1.0d0) ** ((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.pow(Math.exp(1.0), ((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.pow(math.exp(1.0), ((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * (exp(1.0) ^ Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * (exp(1.0) ^ ((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[Exp[1.0], $MachinePrecision], N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot {\left(e^{1}\right)}^{\left(\frac{t \cdot t}{2}\right)}
\end{array}
herbie shell --seed 2024135
(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))))