
(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 18 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))) (pow (exp (- 0.0 t)) (* t -0.5))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * pow(exp((0.0 - t)), (t * -0.5));
}
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((0.0d0 - t)) ** (t * (-0.5d0)))
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((0.0 - t)), (t * -0.5));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.pow(math.exp((0.0 - t)), (t * -0.5))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * (exp(Float64(0.0 - t)) ^ Float64(t * -0.5))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * (exp((0.0 - t)) ^ (t * -0.5)); 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[N[(0.0 - t), $MachinePrecision]], $MachinePrecision], N[(t * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot {\left(e^{0 - t}\right)}^{\left(t \cdot -0.5\right)}
\end{array}
Initial program 99.8%
frac-2negN/A
div-invN/A
distribute-lft-neg-inN/A
associate-*l*N/A
exp-prodN/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval99.8
Applied egg-rr99.8%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* z 2.0) (pow (exp t) t)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((z * 2.0) * 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) * (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.pow(Math.exp(t), t)));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((z * 2.0) * math.pow(math.exp(t), t)))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(z * 2.0) * (exp(t) ^ t)))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((z * 2.0) * (exp(t) ^ t))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[N[Exp[t], $MachinePrecision], t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}}
\end{array}
Initial program 99.8%
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
exp-sqrtN/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f6499.8
Applied egg-rr99.8%
exp-prodN/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f6499.8
Applied egg-rr99.8%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* z 2.0) (exp (* t t))))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((z * 2.0) * 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) * 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.exp((t * t))));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((z * 2.0) * math.exp((t * t))))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(z * 2.0) * exp(Float64(t * t))))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((z * 2.0) * exp((t * t)))); 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[(t * t), $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 \cdot t}}
\end{array}
Initial program 99.8%
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
exp-sqrtN/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f6499.8
Applied egg-rr99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* z 2.0))))
(if (<= (* t t) 100.0)
(*
t_1
(sqrt
(fma
(* z (fma t (* t (fma (* t t) 0.3333333333333333 1.0)) 2.0))
(* t t)
(* z 2.0))))
(if (<= (* t t) 1e+47)
(/ (* t_2 (* x (* x (fma (- 0.0 y) (/ y (* x x)) 0.25)))) (fma x 0.5 y))
(*
(* t_1 t_2)
(fma
t
(* t (fma (* t t) (fma (* t t) 0.020833333333333332 0.125) 0.5))
1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = sqrt((z * 2.0));
double tmp;
if ((t * t) <= 100.0) {
tmp = t_1 * sqrt(fma((z * fma(t, (t * fma((t * t), 0.3333333333333333, 1.0)), 2.0)), (t * t), (z * 2.0)));
} else if ((t * t) <= 1e+47) {
tmp = (t_2 * (x * (x * fma((0.0 - y), (y / (x * x)), 0.25)))) / fma(x, 0.5, y);
} else {
tmp = (t_1 * t_2) * fma(t, (t * fma((t * t), fma((t * t), 0.020833333333333332, 0.125), 0.5)), 1.0);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) t_2 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (Float64(t * t) <= 100.0) tmp = Float64(t_1 * sqrt(fma(Float64(z * fma(t, Float64(t * fma(Float64(t * t), 0.3333333333333333, 1.0)), 2.0)), Float64(t * t), Float64(z * 2.0)))); elseif (Float64(t * t) <= 1e+47) tmp = Float64(Float64(t_2 * Float64(x * Float64(x * fma(Float64(0.0 - y), Float64(y / Float64(x * x)), 0.25)))) / fma(x, 0.5, y)); else tmp = Float64(Float64(t_1 * t_2) * fma(t, Float64(t * fma(Float64(t * t), fma(Float64(t * t), 0.020833333333333332, 0.125), 0.5)), 1.0)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 100.0], N[(t$95$1 * N[Sqrt[N[(N[(z * N[(t * N[(t * N[(N[(t * t), $MachinePrecision] * 0.3333333333333333 + 1.0), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 1e+47], N[(N[(t$95$2 * N[(x * N[(x * N[(N[(0.0 - y), $MachinePrecision] * N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision] + 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.5 + y), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * t$95$2), $MachinePrecision] * N[(t * N[(t * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * 0.020833333333333332 + 0.125), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \cdot t \leq 100:\\
\;\;\;\;t\_1 \cdot \sqrt{\mathsf{fma}\left(z \cdot \mathsf{fma}\left(t, t \cdot \mathsf{fma}\left(t \cdot t, 0.3333333333333333, 1\right), 2\right), t \cdot t, z \cdot 2\right)}\\
\mathbf{elif}\;t \cdot t \leq 10^{+47}:\\
\;\;\;\;\frac{t\_2 \cdot \left(x \cdot \left(x \cdot \mathsf{fma}\left(0 - y, \frac{y}{x \cdot x}, 0.25\right)\right)\right)}{\mathsf{fma}\left(x, 0.5, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 \cdot t\_2\right) \cdot \mathsf{fma}\left(t, t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), 0.5\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 t t) < 100Initial program 99.5%
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
exp-sqrtN/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f6499.5
Applied egg-rr99.5%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
distribute-rgt1-inN/A
*-lowering-*.f64N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6498.8
Simplified98.8%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6498.8
Applied egg-rr98.8%
if 100 < (*.f64 t t) < 1e47Initial program 100.0%
Taylor expanded in t around 0
Simplified31.8%
*-rgt-identityN/A
flip--N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr72.0%
Taylor expanded in x around inf
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unpow2N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6493.2
Simplified93.2%
if 1e47 < (*.f64 t t) Initial program 100.0%
Taylor expanded in t around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6497.7
Simplified97.7%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(*
(sqrt
(*
z
(fma (* t t) (fma (* t t) (fma (* t t) 0.16666666666666666 0.5) 1.0) 1.0)))
(* (- (* x 0.5) y) (sqrt 2.0))))
double code(double x, double y, double z, double t) {
return sqrt((z * fma((t * t), fma((t * t), fma((t * t), 0.16666666666666666, 0.5), 1.0), 1.0))) * (((x * 0.5) - y) * sqrt(2.0));
}
function code(x, y, z, t) return Float64(sqrt(Float64(z * fma(Float64(t * t), fma(Float64(t * t), fma(Float64(t * t), 0.16666666666666666, 0.5), 1.0), 1.0))) * Float64(Float64(Float64(x * 0.5) - y) * sqrt(2.0))) end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, 0.16666666666666666, 0.5\right), 1\right), 1\right)} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2}\right)
\end{array}
Initial program 99.8%
*-commutativeN/A
*-commutativeN/A
pow1/2N/A
unpow-prod-downN/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
exp-sqrtN/A
pow1/2N/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6499.7
Applied egg-rr99.7%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6494.9
Simplified94.9%
Final simplification94.9%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (fma t (* t (fma (* t t) (fma (* t t) 0.020833333333333332 0.125) 0.5)) 1.0)))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * fma(t, (t * fma((t * t), fma((t * t), 0.020833333333333332, 0.125), 0.5)), 1.0);
}
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * fma(t, Float64(t * fma(Float64(t * t), fma(Float64(t * t), 0.020833333333333332, 0.125), 0.5)), 1.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[(t * N[(t * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * 0.020833333333333332 + 0.125), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(t, t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, 0.020833333333333332, 0.125\right), 0.5\right), 1\right)
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6494.6
Simplified94.6%
(FPCore (x y z t) :precision binary64 (* (sqrt 2.0) (* (* (- (* x 0.5) y) (fma (* t t) (fma (* t t) 0.125 0.5) 1.0)) (sqrt z))))
double code(double x, double y, double z, double t) {
return sqrt(2.0) * ((((x * 0.5) - y) * fma((t * t), fma((t * t), 0.125, 0.5), 1.0)) * sqrt(z));
}
function code(x, y, z, t) return Float64(sqrt(2.0) * Float64(Float64(Float64(Float64(x * 0.5) - y) * fma(Float64(t * t), fma(Float64(t * t), 0.125, 0.5), 1.0)) * sqrt(z))) end
code[x_, y_, z_, t_] := N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * 0.125 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2} \cdot \left(\left(\left(x \cdot 0.5 - y\right) \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, 0.125, 0.5\right), 1\right)\right) \cdot \sqrt{z}\right)
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6492.3
Simplified92.3%
Taylor expanded in x around 0
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-inN/A
Simplified93.2%
Final simplification93.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= (* t t) 5000000000000.0)
(* t_1 (sqrt (fma (* t t) (* z (fma t t 2.0)) (* z 2.0))))
(* (* t_1 (sqrt (* z 2.0))) (* 0.125 (* (* t t) (* t t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if ((t * t) <= 5000000000000.0) {
tmp = t_1 * sqrt(fma((t * t), (z * fma(t, t, 2.0)), (z * 2.0)));
} else {
tmp = (t_1 * sqrt((z * 2.0))) * (0.125 * ((t * t) * (t * t)));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (Float64(t * t) <= 5000000000000.0) tmp = Float64(t_1 * sqrt(fma(Float64(t * t), Float64(z * fma(t, t, 2.0)), Float64(z * 2.0)))); else tmp = Float64(Float64(t_1 * sqrt(Float64(z * 2.0))) * Float64(0.125 * Float64(Float64(t * t) * Float64(t * t)))); 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], 5000000000000.0], N[(t$95$1 * N[Sqrt[N[(N[(t * t), $MachinePrecision] * N[(z * N[(t * t + 2.0), $MachinePrecision]), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(N[(t * t), $MachinePrecision] * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \cdot t \leq 5000000000000:\\
\;\;\;\;t\_1 \cdot \sqrt{\mathsf{fma}\left(t \cdot t, z \cdot \mathsf{fma}\left(t, t, 2\right), z \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 \cdot \sqrt{z \cdot 2}\right) \cdot \left(0.125 \cdot \left(\left(t \cdot t\right) \cdot \left(t \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 t t) < 5e12Initial program 99.5%
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
exp-sqrtN/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f6499.5
Applied egg-rr99.5%
exp-prodN/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f6499.5
Applied egg-rr99.5%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6496.4
Simplified96.4%
if 5e12 < (*.f64 t t) Initial program 100.0%
Taylor expanded in t around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6489.2
Simplified89.2%
Taylor expanded in t around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6489.2
Simplified89.2%
Taylor expanded in t around inf
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6489.2
Simplified89.2%
Final simplification92.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= (* z 2.0) 5e+16)
(* (* t_1 (sqrt (* z 2.0))) (fma 0.5 (* t t) 1.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 ((z * 2.0) <= 5e+16) {
tmp = (t_1 * sqrt((z * 2.0))) * fma(0.5, (t * t), 1.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(z * 2.0) <= 5e+16) tmp = Float64(Float64(t_1 * sqrt(Float64(z * 2.0))) * fma(0.5, Float64(t * t), 1.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[(z * 2.0), $MachinePrecision], 5e+16], N[(N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(0.5 * N[(t * t), $MachinePrecision] + 1.0), $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}\;z \cdot 2 \leq 5 \cdot 10^{+16}:\\
\;\;\;\;\left(t\_1 \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(0.5, t \cdot t, 1\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 z #s(literal 2 binary64)) < 5e16Initial program 99.7%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6482.0
Simplified82.0%
if 5e16 < (*.f64 z #s(literal 2 binary64)) Initial program 99.8%
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
exp-sqrtN/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f6499.8
Applied egg-rr99.8%
Taylor expanded in t around 0
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f6495.8
Simplified95.8%
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (* (fma t (* 0.125 (* t (* t t))) 1.0) (fma x 0.5 (- 0.0 y)))))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * (fma(t, (0.125 * (t * (t * t))), 1.0) * fma(x, 0.5, (0.0 - y)));
}
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(fma(t, Float64(0.125 * Float64(t * Float64(t * t))), 1.0) * fma(x, 0.5, Float64(0.0 - y)))) end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(t * N[(0.125 * N[(t * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * 0.5 + N[(0.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(\mathsf{fma}\left(t, 0.125 \cdot \left(t \cdot \left(t \cdot t\right)\right), 1\right) \cdot \mathsf{fma}\left(x, 0.5, 0 - y\right)\right)
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6492.3
Simplified92.3%
Taylor expanded in t around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.1
Simplified92.1%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
associate-*r*N/A
cube-unmultN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f6493.2
Applied egg-rr93.2%
Final simplification93.2%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (fma t (* t (fma (* t t) 0.125 0.5)) 1.0)))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * fma(t, (t * fma((t * t), 0.125, 0.5)), 1.0);
}
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * fma(t, Float64(t * fma(Float64(t * t), 0.125, 0.5)), 1.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[(t * N[(t * N[(N[(t * t), $MachinePrecision] * 0.125 + 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(t, t \cdot \mathsf{fma}\left(t \cdot t, 0.125, 0.5\right), 1\right)
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6492.3
Simplified92.3%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (fma t (* t (* (* t t) 0.125)) 1.0)))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * fma(t, (t * ((t * t) * 0.125)), 1.0);
}
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * fma(t, Float64(t * Float64(Float64(t * t) * 0.125)), 1.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[(t * N[(t * N[(N[(t * t), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot \mathsf{fma}\left(t, t \cdot \left(\left(t \cdot t\right) \cdot 0.125\right), 1\right)
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6492.3
Simplified92.3%
Taylor expanded in t around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6492.1
Simplified92.1%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (fma (* t t) (* z (fma t t 2.0)) (* z 2.0)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(fma((t * t), (z * fma(t, t, 2.0)), (z * 2.0)));
}
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(fma(Float64(t * t), Float64(z * fma(t, t, 2.0)), Float64(z * 2.0)))) end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(t * t), $MachinePrecision] * N[(z * N[(t * t + 2.0), $MachinePrecision]), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\mathsf{fma}\left(t \cdot t, z \cdot \mathsf{fma}\left(t, t, 2\right), z \cdot 2\right)}
\end{array}
Initial program 99.8%
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
exp-sqrtN/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f6499.8
Applied egg-rr99.8%
exp-prodN/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f6499.8
Applied egg-rr99.8%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6490.0
Simplified90.0%
Final simplification90.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))) (t_2 (* t_1 (fma x 0.5 y))))
(if (<= (* x 0.5) -4e-43)
t_2
(if (<= (* x 0.5) 5e+72) (* t_1 (- 0.0 y)) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double t_2 = t_1 * fma(x, 0.5, y);
double tmp;
if ((x * 0.5) <= -4e-43) {
tmp = t_2;
} else if ((x * 0.5) <= 5e+72) {
tmp = t_1 * (0.0 - y);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) t_2 = Float64(t_1 * fma(x, 0.5, y)) tmp = 0.0 if (Float64(x * 0.5) <= -4e-43) tmp = t_2; elseif (Float64(x * 0.5) <= 5e+72) tmp = Float64(t_1 * Float64(0.0 - y)); else tmp = t_2; 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[(t$95$1 * N[(x * 0.5 + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * 0.5), $MachinePrecision], -4e-43], t$95$2, If[LessEqual[N[(x * 0.5), $MachinePrecision], 5e+72], N[(t$95$1 * N[(0.0 - y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
t_2 := t\_1 \cdot \mathsf{fma}\left(x, 0.5, y\right)\\
\mathbf{if}\;x \cdot 0.5 \leq -4 \cdot 10^{-43}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot 0.5 \leq 5 \cdot 10^{+72}:\\
\;\;\;\;t\_1 \cdot \left(0 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x #s(literal 1/2 binary64)) < -4.00000000000000031e-43 or 4.99999999999999992e72 < (*.f64 x #s(literal 1/2 binary64)) Initial program 99.8%
Taylor expanded in t around 0
Simplified58.5%
*-rgt-identityN/A
flip--N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr56.9%
Applied egg-rr48.0%
if -4.00000000000000031e-43 < (*.f64 x #s(literal 1/2 binary64)) < 4.99999999999999992e72Initial program 99.7%
Taylor expanded in t around 0
Simplified51.3%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f6441.2
Simplified41.2%
Applied egg-rr41.2%
Final simplification44.4%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* z 2.0) (fma t t 1.0)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((z * 2.0) * fma(t, t, 1.0)));
}
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(z * 2.0) * fma(t, t, 1.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[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)}
\end{array}
Initial program 99.8%
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
exp-sqrtN/A
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f6499.8
Applied egg-rr99.8%
Taylor expanded in t around 0
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f6485.5
Simplified85.5%
(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.8%
Taylor expanded in t around 0
Simplified54.6%
*-rgt-identityN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6454.6
Applied egg-rr54.6%
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (- 0.0 y)))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * (0.0 - y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((z * 2.0d0)) * (0.0d0 - y)
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * (0.0 - y);
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * (0.0 - y)
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(0.0 - y)) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * (0.0 - y); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(0.0 - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(0 - y\right)
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
Simplified54.6%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f6428.3
Simplified28.3%
Applied egg-rr28.3%
Final simplification28.3%
(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.8%
Taylor expanded in t around 0
Simplified54.6%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f6428.3
Simplified28.3%
*-rgt-identityN/A
sub0-negN/A
*-commutativeN/A
sub0-negN/A
flip--N/A
Applied egg-rr2.7%
Final simplification2.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 2024195
(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))))