
(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 10 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) (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*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
pow299.8%
Applied egg-rr99.8%
(FPCore (x y z t) :precision binary64 (if (<= (* t t) 6.5e-20) (* (- (* x 0.5) y) (sqrt (* z 2.0))) (* y (- (sqrt (* (* z 2.0) (exp (* t t))))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 6.5e-20) {
tmp = ((x * 0.5) - y) * sqrt((z * 2.0));
} else {
tmp = y * -sqrt(((z * 2.0) * exp((t * t))));
}
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 * t) <= 6.5d-20) then
tmp = ((x * 0.5d0) - y) * sqrt((z * 2.0d0))
else
tmp = y * -sqrt(((z * 2.0d0) * exp((t * t))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 6.5e-20) {
tmp = ((x * 0.5) - y) * Math.sqrt((z * 2.0));
} else {
tmp = y * -Math.sqrt(((z * 2.0) * Math.exp((t * t))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t * t) <= 6.5e-20: tmp = ((x * 0.5) - y) * math.sqrt((z * 2.0)) else: tmp = y * -math.sqrt(((z * 2.0) * math.exp((t * t)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(t * t) <= 6.5e-20) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))); else tmp = Float64(y * Float64(-sqrt(Float64(Float64(z * 2.0) * exp(Float64(t * t)))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t * t) <= 6.5e-20) tmp = ((x * 0.5) - y) * sqrt((z * 2.0)); else tmp = y * -sqrt(((z * 2.0) * exp((t * t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(t * t), $MachinePrecision], 6.5e-20], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y * (-N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 6.5 \cdot 10^{-20}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-\sqrt{\left(z \cdot 2\right) \cdot e^{t \cdot t}}\right)\\
\end{array}
\end{array}
if (*.f64 t t) < 6.50000000000000032e-20Initial program 99.7%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
sqrt-unprod99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
Taylor expanded in t around 0 99.7%
*-commutative99.7%
Simplified99.7%
if 6.50000000000000032e-20 < (*.f64 t t) Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
sqrt-unprod100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 79.2%
neg-mul-179.2%
Simplified79.2%
Final simplification89.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (<= t 2.4e+21)
(* (- (* x 0.5) y) t_1)
(* t_1 (* x (/ (- 0.25 (* (/ y x) (/ y 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 <= 2.4e+21) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (x * ((0.25 - ((y / x) * (y / 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 <= 2.4d+21) then
tmp = ((x * 0.5d0) - y) * t_1
else
tmp = t_1 * (x * ((0.25d0 - ((y / x) * (y / 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 <= 2.4e+21) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (x * ((0.25 - ((y / x) * (y / x))) / (0.5 + (y / x))));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if t <= 2.4e+21: tmp = ((x * 0.5) - y) * t_1 else: tmp = t_1 * (x * ((0.25 - ((y / x) * (y / 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 <= 2.4e+21) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); else tmp = Float64(t_1 * Float64(x * Float64(Float64(0.25 - Float64(Float64(y / x) * Float64(y / 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 <= 2.4e+21) tmp = ((x * 0.5) - y) * t_1; else tmp = t_1 * (x * ((0.25 - ((y / x) * (y / 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, 2.4e+21], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(x * N[(N[(0.25 - N[(N[(y / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.5 + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \leq 2.4 \cdot 10^{+21}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(x \cdot \frac{0.25 - \frac{y}{x} \cdot \frac{y}{x}}{0.5 + \frac{y}{x}}\right)\\
\end{array}
\end{array}
if t < 2.4e21Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 73.8%
*-commutative73.8%
Simplified73.8%
if 2.4e21 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
sqrt-unprod100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 14.3%
*-commutative14.3%
Simplified14.3%
Taylor expanded in x around inf 28.7%
mul-1-neg28.7%
unsub-neg28.7%
Simplified28.7%
sub-neg28.7%
flip-+29.4%
metadata-eval29.4%
distribute-neg-frac229.4%
distribute-neg-frac229.4%
distribute-neg-frac229.4%
Applied egg-rr29.4%
Final simplification63.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (or (<= y -1.2e+110) (not (<= y 6.4e-72)))
(* 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 <= -1.2e+110) || !(y <= 6.4e-72)) {
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 <= (-1.2d+110)) .or. (.not. (y <= 6.4d-72))) 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 <= -1.2e+110) || !(y <= 6.4e-72)) {
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 <= -1.2e+110) or not (y <= 6.4e-72): 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 <= -1.2e+110) || !(y <= 6.4e-72)) 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 <= -1.2e+110) || ~((y <= 6.4e-72))) 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, -1.2e+110], N[Not[LessEqual[y, 6.4e-72]], $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 -1.2 \cdot 10^{+110} \lor \neg \left(y \leq 6.4 \cdot 10^{-72}\right):\\
\;\;\;\;y \cdot \left(-t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if y < -1.20000000000000006e110 or 6.39999999999999998e-72 < y Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 64.3%
*-commutative64.3%
Simplified64.3%
Taylor expanded in x around 0 55.7%
neg-mul-188.9%
Simplified55.7%
if -1.20000000000000006e110 < y < 6.39999999999999998e-72Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 55.5%
*-commutative55.5%
Simplified55.5%
Taylor expanded in x around inf 44.4%
Final simplification50.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (sqrt (* z 2.0)))) (if (<= t 1000.0) (* (- (* x 0.5) y) t_1) (* t_1 (* x (- 0.5 (/ y x)))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if (t <= 1000.0) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (x * (0.5 - (y / x)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((z * 2.0d0))
if (t <= 1000.0d0) then
tmp = ((x * 0.5d0) - y) * t_1
else
tmp = t_1 * (x * (0.5d0 - (y / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z * 2.0));
double tmp;
if (t <= 1000.0) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (x * (0.5 - (y / x)));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if t <= 1000.0: tmp = ((x * 0.5) - y) * t_1 else: tmp = t_1 * (x * (0.5 - (y / x))) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (t <= 1000.0) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); else tmp = Float64(t_1 * Float64(x * Float64(0.5 - Float64(y / x)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if (t <= 1000.0) tmp = ((x * 0.5) - y) * t_1; else tmp = t_1 * (x * (0.5 - (y / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1000.0], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(x * N[(0.5 - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \leq 1000:\\
\;\;\;\;\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 < 1e3Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 73.9%
*-commutative73.9%
Simplified73.9%
if 1e3 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
sqrt-unprod100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 16.9%
*-commutative16.9%
Simplified16.9%
Taylor expanded in x around inf 30.6%
mul-1-neg30.6%
unsub-neg30.6%
Simplified30.6%
Final simplification63.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (sqrt (* z 2.0)))) (if (<= t 98000000.0) (* (- (* x 0.5) y) t_1) (* t_1 (* x (/ y (- x)))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if (t <= 98000000.0) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (x * (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 <= 98000000.0d0) then
tmp = ((x * 0.5d0) - y) * t_1
else
tmp = t_1 * (x * (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 <= 98000000.0) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = t_1 * (x * (y / -x));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if t <= 98000000.0: tmp = ((x * 0.5) - y) * t_1 else: tmp = t_1 * (x * (y / -x)) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (t <= 98000000.0) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); else tmp = Float64(t_1 * Float64(x * Float64(y / Float64(-x)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if (t <= 98000000.0) tmp = ((x * 0.5) - y) * t_1; else tmp = t_1 * (x * (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, 98000000.0], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(x * N[(y / (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \leq 98000000:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(x \cdot \frac{y}{-x}\right)\\
\end{array}
\end{array}
if t < 9.8e7Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 73.9%
*-commutative73.9%
Simplified73.9%
if 9.8e7 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
sqrt-unprod100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 16.9%
*-commutative16.9%
Simplified16.9%
Taylor expanded in x around inf 30.6%
mul-1-neg30.6%
unsub-neg30.6%
Simplified30.6%
Taylor expanded in y around inf 28.2%
mul-1-neg28.2%
distribute-frac-neg228.2%
Simplified28.2%
Final simplification62.9%
(FPCore (x y z t) :precision binary64 (if (<= t 6.3e+97) (* (- (* x 0.5) y) (sqrt (* z 2.0))) (sqrt (* (* z 2.0) (* y (- y x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6.3e+97) {
tmp = ((x * 0.5) - y) * sqrt((z * 2.0));
} else {
tmp = sqrt(((z * 2.0) * (y * (y - x))));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 6.3d+97) then
tmp = ((x * 0.5d0) - y) * sqrt((z * 2.0d0))
else
tmp = sqrt(((z * 2.0d0) * (y * (y - x))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6.3e+97) {
tmp = ((x * 0.5) - y) * Math.sqrt((z * 2.0));
} else {
tmp = Math.sqrt(((z * 2.0) * (y * (y - x))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 6.3e+97: tmp = ((x * 0.5) - y) * math.sqrt((z * 2.0)) else: tmp = math.sqrt(((z * 2.0) * (y * (y - x)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 6.3e+97) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))); else tmp = sqrt(Float64(Float64(z * 2.0) * Float64(y * Float64(y - x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 6.3e+97) tmp = ((x * 0.5) - y) * sqrt((z * 2.0)); else tmp = sqrt(((z * 2.0) * (y * (y - x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 6.3e+97], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[(y * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.3 \cdot 10^{+97}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot \left(y \cdot \left(y - x\right)\right)}\\
\end{array}
\end{array}
if t < 6.29999999999999997e97Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 71.0%
*-commutative71.0%
Simplified71.0%
if 6.29999999999999997e97 < t Initial program 100.0%
Taylor expanded in t around 0 14.3%
add-sqr-sqrt8.3%
sqrt-unprod25.7%
*-commutative25.7%
*-commutative25.7%
swap-sqr29.6%
add-sqr-sqrt29.6%
pow229.6%
Applied egg-rr29.6%
Taylor expanded in x around 0 23.5%
+-commutative23.5%
unpow223.5%
associate-*r*23.5%
distribute-rgt-in27.6%
mul-1-neg27.6%
unsub-neg27.6%
Simplified27.6%
Final simplification62.7%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* z 2.0))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt((z * 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * 0.5d0) - y) * sqrt((z * 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt((z * 2.0));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt((z * 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt((z * 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}
\end{array}
Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 60.1%
*-commutative60.1%
Simplified60.1%
(FPCore (x y z t) :precision binary64 (* y (- (sqrt (* z 2.0)))))
double code(double x, double y, double z, double t) {
return y * -sqrt((z * 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * -sqrt((z * 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return y * -Math.sqrt((z * 2.0));
}
def code(x, y, z, t): return y * -math.sqrt((z * 2.0))
function code(x, y, z, t) return Float64(y * Float64(-sqrt(Float64(z * 2.0)))) end
function tmp = code(x, y, z, t) tmp = y * -sqrt((z * 2.0)); end
code[x_, y_, z_, t_] := N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-\sqrt{z \cdot 2}\right)
\end{array}
Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 60.1%
*-commutative60.1%
Simplified60.1%
Taylor expanded in x around 0 34.7%
neg-mul-166.4%
Simplified34.7%
Final simplification34.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 * 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 60.1%
*-rgt-identity60.1%
*-commutative60.1%
sub-neg60.1%
distribute-lft-in60.1%
add-sqr-sqrt30.8%
sqrt-unprod40.5%
sqr-neg40.5%
sqrt-unprod12.1%
add-sqr-sqrt25.9%
Applied egg-rr25.9%
distribute-lft-out25.9%
fma-undefine25.9%
Simplified25.9%
Taylor expanded in x around 0 1.5%
Final simplification1.5%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * pow(exp(1.0), ((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * (exp(1.0d0) ** ((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.pow(Math.exp(1.0), ((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.pow(math.exp(1.0), ((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * (exp(1.0) ^ Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * (exp(1.0) ^ ((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[Exp[1.0], $MachinePrecision], N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot {\left(e^{1}\right)}^{\left(\frac{t \cdot t}{2}\right)}
\end{array}
herbie shell --seed 2024145
(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))))