
(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 8 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 (* (* (sqrt (pow (exp t) t)) (sqrt (* z 2.0))) (- (* x 0.5) y)))
double code(double x, double y, double z, double t) {
return (sqrt(pow(exp(t), t)) * sqrt((z * 2.0))) * ((x * 0.5) - 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((exp(t) ** t)) * sqrt((z * 2.0d0))) * ((x * 0.5d0) - y)
end function
public static double code(double x, double y, double z, double t) {
return (Math.sqrt(Math.pow(Math.exp(t), t)) * Math.sqrt((z * 2.0))) * ((x * 0.5) - y);
}
def code(x, y, z, t): return (math.sqrt(math.pow(math.exp(t), t)) * math.sqrt((z * 2.0))) * ((x * 0.5) - y)
function code(x, y, z, t) return Float64(Float64(sqrt((exp(t) ^ t)) * sqrt(Float64(z * 2.0))) * Float64(Float64(x * 0.5) - y)) end
function tmp = code(x, y, z, t) tmp = (sqrt((exp(t) ^ t)) * sqrt((z * 2.0))) * ((x * 0.5) - y); end
code[x_, y_, z_, t_] := N[(N[(N[Sqrt[N[Power[N[Exp[t], $MachinePrecision], t], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\sqrt{{\left(e^{t}\right)}^{t}} \cdot \sqrt{z \cdot 2}\right) \cdot \left(x \cdot 0.5 - y\right)
\end{array}
Initial program 98.6%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 1.45e+32)
(* t_1 (sqrt (* z 2.0)))
(sqrt (* (* z 2.0) (pow t_1 2.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 1.45e+32) {
tmp = t_1 * sqrt((z * 2.0));
} else {
tmp = sqrt(((z * 2.0) * pow(t_1, 2.0)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 0.5d0) - y
if (t <= 1.45d+32) then
tmp = t_1 * sqrt((z * 2.0d0))
else
tmp = sqrt(((z * 2.0d0) * (t_1 ** 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 1.45e+32) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else {
tmp = Math.sqrt(((z * 2.0) * Math.pow(t_1, 2.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if t <= 1.45e+32: tmp = t_1 * math.sqrt((z * 2.0)) else: tmp = math.sqrt(((z * 2.0) * math.pow(t_1, 2.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 1.45e+32) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); else tmp = sqrt(Float64(Float64(z * 2.0) * (t_1 ^ 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if (t <= 1.45e+32) tmp = t_1 * sqrt((z * 2.0)); else tmp = sqrt(((z * 2.0) * (t_1 ^ 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 1.45e+32], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 1.45 \cdot 10^{+32}:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {t\_1}^{2}}\\
\end{array}
\end{array}
if t < 1.45000000000000001e32Initial program 98.8%
associate-*r*99.8%
*-commutative99.8%
sub-neg99.8%
distribute-lft-in83.3%
exp-sqrt83.3%
pow-exp83.3%
sqrt-unprod83.3%
associate-*l*83.3%
pow-exp83.3%
pow283.3%
Applied egg-rr83.2%
distribute-lft-out99.7%
*-commutative99.7%
sub-neg99.7%
*-commutative99.7%
*-commutative99.7%
*-commutative99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in t around 0 69.7%
if 1.45000000000000001e32 < t Initial program 98.2%
Taylor expanded in t around 0 14.1%
associate-*r*14.1%
sqrt-prod14.1%
pow1/214.1%
pow114.1%
metadata-eval14.1%
sqrt-pow120.8%
*-commutative20.8%
pow1/220.8%
unpow-prod-down24.2%
*-commutative24.2%
*-commutative24.2%
fma-neg24.2%
Applied egg-rr24.2%
unpow1/224.2%
fma-neg24.2%
Simplified24.2%
Final simplification59.7%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (exp (* t t)) (* z 2.0)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt((exp((t * t)) * (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((exp((t * t)) * (z * 2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt((Math.exp((t * t)) * (z * 2.0)));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt((math.exp((t * t)) * (z * 2.0)))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(exp(Float64(t * t)) * Float64(z * 2.0)))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt((exp((t * t)) * (z * 2.0))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision] * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{e^{t \cdot t} \cdot \left(z \cdot 2\right)}
\end{array}
Initial program 98.6%
associate-*r*99.8%
*-commutative99.8%
sub-neg99.8%
distribute-lft-in77.1%
exp-sqrt77.1%
pow-exp77.1%
sqrt-unprod77.1%
associate-*l*77.1%
pow-exp77.1%
pow277.1%
Applied egg-rr77.1%
distribute-lft-out99.8%
*-commutative99.8%
sub-neg99.8%
*-commutative99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
pow299.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (<= t 1.2e+32) (* (- (* x 0.5) y) (sqrt (* z 2.0))) (sqrt (* 0.5 (* z (pow x 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.2e+32) {
tmp = ((x * 0.5) - y) * sqrt((z * 2.0));
} else {
tmp = sqrt((0.5 * (z * 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.2d+32) then
tmp = ((x * 0.5d0) - y) * sqrt((z * 2.0d0))
else
tmp = sqrt((0.5d0 * (z * (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.2e+32) {
tmp = ((x * 0.5) - y) * Math.sqrt((z * 2.0));
} else {
tmp = Math.sqrt((0.5 * (z * Math.pow(x, 2.0))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.2e+32: tmp = ((x * 0.5) - y) * math.sqrt((z * 2.0)) else: tmp = math.sqrt((0.5 * (z * math.pow(x, 2.0)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.2e+32) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))); else tmp = sqrt(Float64(0.5 * Float64(z * (x ^ 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.2e+32) tmp = ((x * 0.5) - y) * sqrt((z * 2.0)); else tmp = sqrt((0.5 * (z * (x ^ 2.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.2e+32], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(0.5 * N[(z * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.2 \cdot 10^{+32}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 \cdot \left(z \cdot {x}^{2}\right)}\\
\end{array}
\end{array}
if t < 1.19999999999999996e32Initial program 98.8%
associate-*r*99.8%
*-commutative99.8%
sub-neg99.8%
distribute-lft-in83.3%
exp-sqrt83.3%
pow-exp83.3%
sqrt-unprod83.3%
associate-*l*83.3%
pow-exp83.3%
pow283.3%
Applied egg-rr83.2%
distribute-lft-out99.7%
*-commutative99.7%
sub-neg99.7%
*-commutative99.7%
*-commutative99.7%
*-commutative99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in t around 0 69.7%
if 1.19999999999999996e32 < t Initial program 98.2%
Taylor expanded in t around 0 14.1%
associate-*r*14.1%
sqrt-prod14.1%
pow1/214.1%
pow114.1%
metadata-eval14.1%
sqrt-pow120.8%
*-commutative20.8%
pow1/220.8%
unpow-prod-down24.2%
*-commutative24.2%
*-commutative24.2%
fma-neg24.2%
Applied egg-rr24.2%
unpow1/224.2%
fma-neg24.2%
Simplified24.2%
Taylor expanded in x around inf 22.5%
Final simplification59.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (or (<= x -1.7e+87)
(not
(or (<= x 1.02e-10) (and (not (<= x 2.55e+32)) (<= x 2.5e+99)))))
(* 0.5 (* x t_1))
(* y (- t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if ((x <= -1.7e+87) || !((x <= 1.02e-10) || (!(x <= 2.55e+32) && (x <= 2.5e+99)))) {
tmp = 0.5 * (x * t_1);
} else {
tmp = y * -t_1;
}
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 ((x <= (-1.7d+87)) .or. (.not. (x <= 1.02d-10) .or. (.not. (x <= 2.55d+32)) .and. (x <= 2.5d+99))) then
tmp = 0.5d0 * (x * t_1)
else
tmp = y * -t_1
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 ((x <= -1.7e+87) || !((x <= 1.02e-10) || (!(x <= 2.55e+32) && (x <= 2.5e+99)))) {
tmp = 0.5 * (x * t_1);
} else {
tmp = y * -t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if (x <= -1.7e+87) or not ((x <= 1.02e-10) or (not (x <= 2.55e+32) and (x <= 2.5e+99))): tmp = 0.5 * (x * t_1) else: tmp = y * -t_1 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if ((x <= -1.7e+87) || !((x <= 1.02e-10) || (!(x <= 2.55e+32) && (x <= 2.5e+99)))) tmp = Float64(0.5 * Float64(x * t_1)); else tmp = Float64(y * Float64(-t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if ((x <= -1.7e+87) || ~(((x <= 1.02e-10) || (~((x <= 2.55e+32)) && (x <= 2.5e+99))))) tmp = 0.5 * (x * t_1); else tmp = y * -t_1; 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[x, -1.7e+87], N[Not[Or[LessEqual[x, 1.02e-10], And[N[Not[LessEqual[x, 2.55e+32]], $MachinePrecision], LessEqual[x, 2.5e+99]]]], $MachinePrecision]], N[(0.5 * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], N[(y * (-t$95$1)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+87} \lor \neg \left(x \leq 1.02 \cdot 10^{-10} \lor \neg \left(x \leq 2.55 \cdot 10^{+32}\right) \land x \leq 2.5 \cdot 10^{+99}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-t\_1\right)\\
\end{array}
\end{array}
if x < -1.7000000000000001e87 or 1.01999999999999997e-10 < x < 2.55000000000000002e32 or 2.50000000000000004e99 < x Initial program 99.8%
Taylor expanded in t around 0 63.4%
Taylor expanded in x around inf 55.5%
associate-*l*55.4%
Simplified55.4%
sqrt-prod55.6%
pow1/255.6%
Applied egg-rr55.6%
unpow1/255.6%
Simplified55.6%
if -1.7000000000000001e87 < x < 1.01999999999999997e-10 or 2.55000000000000002e32 < x < 2.50000000000000004e99Initial program 97.9%
Taylor expanded in t around 0 53.6%
Taylor expanded in x around 0 44.1%
associate-*r*44.1%
mul-1-neg44.1%
distribute-lft-neg-out44.1%
*-commutative44.1%
Simplified44.1%
distribute-rgt-neg-out44.1%
distribute-lft-neg-out44.1%
add-sqr-sqrt24.4%
sqrt-unprod19.9%
sqr-neg19.9%
sqrt-unprod1.9%
add-sqr-sqrt2.7%
*-commutative2.7%
associate-*l*2.7%
add-sqr-sqrt1.9%
sqrt-unprod19.9%
sqr-neg19.9%
sqrt-unprod24.4%
add-sqr-sqrt44.2%
sqrt-prod44.2%
Applied egg-rr44.2%
*-commutative44.2%
distribute-rgt-neg-in44.2%
Simplified44.2%
Final simplification48.6%
(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-*r*99.8%
*-commutative99.8%
sub-neg99.8%
distribute-lft-in77.1%
exp-sqrt77.1%
pow-exp77.1%
sqrt-unprod77.1%
associate-*l*77.1%
pow-exp77.1%
pow277.1%
Applied egg-rr77.1%
distribute-lft-out99.8%
*-commutative99.8%
sub-neg99.8%
*-commutative99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in t around 0 57.5%
Final simplification57.5%
(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%
Taylor expanded in t around 0 57.4%
Taylor expanded in x around 0 30.9%
associate-*r*30.9%
mul-1-neg30.9%
distribute-lft-neg-out30.9%
*-commutative30.9%
Simplified30.9%
distribute-rgt-neg-out30.9%
distribute-lft-neg-out30.9%
add-sqr-sqrt16.6%
sqrt-unprod15.0%
sqr-neg15.0%
sqrt-unprod1.6%
add-sqr-sqrt2.7%
*-commutative2.7%
associate-*l*2.7%
add-sqr-sqrt1.6%
sqrt-unprod15.1%
sqr-neg15.1%
sqrt-unprod16.7%
add-sqr-sqrt30.9%
sqrt-prod30.9%
Applied egg-rr30.9%
*-commutative30.9%
distribute-rgt-neg-in30.9%
Simplified30.9%
Final simplification30.9%
(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%
Taylor expanded in t around 0 57.4%
Taylor expanded in x around 0 30.9%
associate-*r*30.9%
mul-1-neg30.9%
distribute-lft-neg-out30.9%
*-commutative30.9%
Simplified30.9%
pow130.9%
*-commutative30.9%
associate-*l*30.9%
add-sqr-sqrt14.2%
sqrt-unprod13.1%
sqr-neg13.1%
sqrt-unprod1.1%
add-sqr-sqrt2.7%
sqrt-prod2.7%
Applied egg-rr2.7%
unpow12.7%
Simplified2.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 2024076
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
:alt
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0)))
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))