
(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 11 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 98.6%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.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 98.6%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
pow299.8%
pow-exp99.8%
Applied egg-rr99.8%
(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 98.6%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* z 2.0) (pow (+ t 1.0) t)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((z * 2.0) * pow((t + 1.0), 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) * ((t + 1.0d0) ** 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((t + 1.0), t)));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((z * 2.0) * math.pow((t + 1.0), t)))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(z * 2.0) * (Float64(t + 1.0) ^ t)))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((z * 2.0) * ((t + 1.0) ^ 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[(t + 1.0), $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(t + 1\right)}^{t}}
\end{array}
Initial program 98.6%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
pow299.8%
pow-exp99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 79.5%
+-commutative79.5%
Simplified79.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (<= t 4.0)
(* (- (* 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 <= 4.0) {
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 <= 4.0d0) 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 <= 4.0) {
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 <= 4.0: 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 <= 4.0) 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 <= 4.0) 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, 4.0], 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 4:\\
\;\;\;\;\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 < 4Initial program 98.7%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
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 77.1%
*-commutative77.1%
Simplified77.1%
if 4 < t Initial program 98.4%
associate-*l*99.9%
remove-double-neg99.9%
remove-double-neg99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
pow199.9%
sqrt-unprod99.9%
associate-*l*99.9%
pow-exp99.9%
pow299.9%
Applied egg-rr99.9%
unpow199.9%
associate-*r*99.9%
Simplified99.9%
Taylor expanded in t around 0 14.6%
*-commutative14.6%
Simplified14.6%
Taylor expanded in y around inf 30.1%
Final simplification64.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (or (<= y -3500000000.0) (not (<= y 3.6e-49)))
(* 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 <= -3500000000.0) || !(y <= 3.6e-49)) {
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 <= (-3500000000.0d0)) .or. (.not. (y <= 3.6d-49))) 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 <= -3500000000.0) || !(y <= 3.6e-49)) {
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 <= -3500000000.0) or not (y <= 3.6e-49): 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 <= -3500000000.0) || !(y <= 3.6e-49)) 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 <= -3500000000.0) || ~((y <= 3.6e-49))) 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, -3500000000.0], N[Not[LessEqual[y, 3.6e-49]], $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 -3500000000 \lor \neg \left(y \leq 3.6 \cdot 10^{-49}\right):\\
\;\;\;\;y \cdot \left(-t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if y < -3.5e9 or 3.5999999999999997e-49 < y Initial program 99.8%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 64.8%
*-commutative64.8%
Simplified64.8%
Taylor expanded in x around 0 50.1%
neg-mul-150.1%
Simplified50.1%
if -3.5e9 < y < 3.5999999999999997e-49Initial program 97.5%
associate-*l*99.7%
remove-double-neg99.7%
remove-double-neg99.7%
exp-sqrt99.7%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
unpow199.7%
associate-*r*99.7%
Simplified99.7%
Taylor expanded in t around 0 57.0%
*-commutative57.0%
Simplified57.0%
Taylor expanded in x around inf 47.6%
Final simplification48.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (sqrt (* z 2.0)))) (if (<= t 3.05e-7) (* (- (* 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 <= 3.05e-7) {
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 <= 3.05d-7) 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 <= 3.05e-7) {
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 <= 3.05e-7: 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 <= 3.05e-7) 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 <= 3.05e-7) 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, 3.05e-7], 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 3.05 \cdot 10^{-7}:\\
\;\;\;\;\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 < 3.04999999999999991e-7Initial program 98.7%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 77.5%
*-commutative77.5%
Simplified77.5%
if 3.04999999999999991e-7 < t Initial program 98.5%
associate-*l*99.9%
remove-double-neg99.9%
remove-double-neg99.9%
exp-sqrt99.9%
exp-prod99.9%
Simplified99.9%
pow199.9%
sqrt-unprod99.9%
associate-*l*99.9%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 17.2%
*-commutative17.2%
Simplified17.2%
Taylor expanded in x around inf 21.2%
mul-1-neg21.2%
unsub-neg21.2%
Simplified21.2%
Final simplification61.8%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* 2.0 (+ z (* z (* t t)))))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt((2.0 * (z + (z * (t * t)))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * 0.5d0) - y) * sqrt((2.0d0 * (z + (z * (t * t)))))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt((2.0 * (z + (z * (t * t)))));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt((2.0 * (z + (z * (t * t)))))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * Float64(z + Float64(z * Float64(t * t)))))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt((2.0 * (z + (z * (t * t))))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(z + N[(z * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z + z \cdot \left(t \cdot t\right)\right)}
\end{array}
Initial program 98.6%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
pow299.8%
pow-exp99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 86.2%
distribute-lft-out86.2%
*-commutative86.2%
Simplified86.2%
unpow286.2%
Applied egg-rr86.2%
(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 98.6%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 60.7%
*-commutative60.7%
Simplified60.7%
(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 98.6%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 60.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in x around 0 29.4%
neg-mul-129.4%
Simplified29.4%
Final simplification29.4%
(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 98.6%
associate-*l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 60.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in x around 0 29.4%
neg-mul-129.4%
Simplified29.4%
neg-sub029.4%
sub-neg29.4%
add-sqr-sqrt13.5%
sqrt-unprod13.4%
sqr-neg13.4%
sqrt-unprod1.0%
add-sqr-sqrt2.1%
Applied egg-rr2.1%
+-lft-identity2.1%
Simplified2.1%
(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 2024185
(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))))