
(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 99.0%
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)) (t_2 (sqrt (* (* z 2.0) (pow t_1 2.0)))))
(if (<= t 19.0)
(* t_1 (sqrt (* z 2.0)))
(if (<= t 4.1e+133)
t_2
(if (<= t 3.1e+190)
(* 0.5 (* x (pow (pow (* z 2.0) 1.5) 0.3333333333333333)))
t_2)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = sqrt(((z * 2.0) * pow(t_1, 2.0)));
double tmp;
if (t <= 19.0) {
tmp = t_1 * sqrt((z * 2.0));
} else if (t <= 4.1e+133) {
tmp = t_2;
} else if (t <= 3.1e+190) {
tmp = 0.5 * (x * pow(pow((z * 2.0), 1.5), 0.3333333333333333));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 0.5d0) - y
t_2 = sqrt(((z * 2.0d0) * (t_1 ** 2.0d0)))
if (t <= 19.0d0) then
tmp = t_1 * sqrt((z * 2.0d0))
else if (t <= 4.1d+133) then
tmp = t_2
else if (t <= 3.1d+190) then
tmp = 0.5d0 * (x * (((z * 2.0d0) ** 1.5d0) ** 0.3333333333333333d0))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double t_2 = Math.sqrt(((z * 2.0) * Math.pow(t_1, 2.0)));
double tmp;
if (t <= 19.0) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else if (t <= 4.1e+133) {
tmp = t_2;
} else if (t <= 3.1e+190) {
tmp = 0.5 * (x * Math.pow(Math.pow((z * 2.0), 1.5), 0.3333333333333333));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y t_2 = math.sqrt(((z * 2.0) * math.pow(t_1, 2.0))) tmp = 0 if t <= 19.0: tmp = t_1 * math.sqrt((z * 2.0)) elif t <= 4.1e+133: tmp = t_2 elif t <= 3.1e+190: tmp = 0.5 * (x * math.pow(math.pow((z * 2.0), 1.5), 0.3333333333333333)) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) t_2 = sqrt(Float64(Float64(z * 2.0) * (t_1 ^ 2.0))) tmp = 0.0 if (t <= 19.0) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); elseif (t <= 4.1e+133) tmp = t_2; elseif (t <= 3.1e+190) tmp = Float64(0.5 * Float64(x * ((Float64(z * 2.0) ^ 1.5) ^ 0.3333333333333333))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; t_2 = sqrt(((z * 2.0) * (t_1 ^ 2.0))); tmp = 0.0; if (t <= 19.0) tmp = t_1 * sqrt((z * 2.0)); elseif (t <= 4.1e+133) tmp = t_2; elseif (t <= 3.1e+190) tmp = 0.5 * (x * (((z * 2.0) ^ 1.5) ^ 0.3333333333333333)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 19.0], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e+133], t$95$2, If[LessEqual[t, 3.1e+190], N[(0.5 * N[(x * N[Power[N[Power[N[(z * 2.0), $MachinePrecision], 1.5], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \sqrt{\left(z \cdot 2\right) \cdot {t\_1}^{2}}\\
\mathbf{if}\;t \leq 19:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+133}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+190}:\\
\;\;\;\;0.5 \cdot \left(x \cdot {\left({\left(z \cdot 2\right)}^{1.5}\right)}^{0.3333333333333333}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < 19Initial program 99.2%
associate-*r*99.7%
*-commutative99.7%
sub-neg99.7%
distribute-lft-in86.8%
exp-sqrt86.8%
pow-exp86.8%
sqrt-unprod86.8%
associate-*l*86.8%
pow-exp86.8%
pow286.8%
Applied egg-rr86.8%
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 75.8%
if 19 < t < 4.10000000000000004e133 or 3.1000000000000001e190 < t Initial program 98.0%
Taylor expanded in t around 0 16.1%
associate-*r*16.1%
sqrt-prod16.1%
*-commutative16.1%
*-commutative16.1%
pow116.1%
metadata-eval16.1%
sqrt-pow119.8%
*-commutative19.8%
sqrt-prod25.5%
pow1/225.5%
pow125.5%
pow125.5%
associate-*l*25.5%
*-commutative25.5%
Applied egg-rr25.5%
unpow1/225.5%
associate-*r*25.5%
*-commutative25.5%
Simplified25.5%
if 4.10000000000000004e133 < t < 3.1000000000000001e190Initial program 100.0%
Taylor expanded in t around 0 20.0%
Taylor expanded in x around inf 10.8%
associate-*l*10.8%
Simplified10.8%
sqrt-prod20.0%
add-cbrt-cube35.9%
pow1/335.9%
add-sqr-sqrt35.9%
pow135.9%
pow1/235.9%
pow-prod-up35.9%
metadata-eval35.9%
Applied egg-rr18.8%
Final simplification63.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 1.0)
(* t_1 (sqrt (* z 2.0)))
(* (sqrt z) (* t_1 (* t (sqrt 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 1.0) {
tmp = t_1 * sqrt((z * 2.0));
} else {
tmp = sqrt(z) * (t_1 * (t * sqrt(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.0d0) then
tmp = t_1 * sqrt((z * 2.0d0))
else
tmp = sqrt(z) * (t_1 * (t * sqrt(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.0) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else {
tmp = Math.sqrt(z) * (t_1 * (t * Math.sqrt(2.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if t <= 1.0: tmp = t_1 * math.sqrt((z * 2.0)) else: tmp = math.sqrt(z) * (t_1 * (t * math.sqrt(2.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 1.0) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); else tmp = Float64(sqrt(z) * Float64(t_1 * Float64(t * sqrt(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.0) tmp = t_1 * sqrt((z * 2.0)); else tmp = sqrt(z) * (t_1 * (t * sqrt(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.0], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[z], $MachinePrecision] * N[(t$95$1 * N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 1:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z} \cdot \left(t\_1 \cdot \left(t \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if t < 1Initial program 99.2%
associate-*r*99.7%
*-commutative99.7%
sub-neg99.7%
distribute-lft-in86.8%
exp-sqrt86.8%
pow-exp86.8%
sqrt-unprod86.8%
associate-*l*86.8%
pow-exp86.8%
pow286.8%
Applied egg-rr86.8%
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 75.8%
if 1 < t Initial program 98.4%
associate-*r*100.0%
*-commutative100.0%
sub-neg100.0%
distribute-lft-in47.5%
exp-sqrt47.5%
pow-exp47.5%
sqrt-unprod47.5%
associate-*l*47.5%
pow-exp47.5%
pow247.5%
Applied egg-rr47.5%
distribute-lft-out100.0%
*-commutative100.0%
sub-neg100.0%
*-commutative100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 68.8%
distribute-lft-out68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in t around inf 53.0%
*-commutative53.0%
associate-*r*53.0%
Simplified53.0%
Final simplification70.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 1.0)
(* t_1 (sqrt (* z 2.0)))
(* t (* (sqrt z) (* t_1 (sqrt 2.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 1.0) {
tmp = t_1 * sqrt((z * 2.0));
} else {
tmp = t * (sqrt(z) * (t_1 * sqrt(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.0d0) then
tmp = t_1 * sqrt((z * 2.0d0))
else
tmp = t * (sqrt(z) * (t_1 * sqrt(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.0) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else {
tmp = t * (Math.sqrt(z) * (t_1 * Math.sqrt(2.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if t <= 1.0: tmp = t_1 * math.sqrt((z * 2.0)) else: tmp = t * (math.sqrt(z) * (t_1 * math.sqrt(2.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 1.0) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); else tmp = Float64(t * Float64(sqrt(z) * Float64(t_1 * sqrt(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.0) tmp = t_1 * sqrt((z * 2.0)); else tmp = t * (sqrt(z) * (t_1 * sqrt(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.0], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[z], $MachinePrecision] * N[(t$95$1 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 1:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\sqrt{z} \cdot \left(t\_1 \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if t < 1Initial program 99.2%
associate-*r*99.7%
*-commutative99.7%
sub-neg99.7%
distribute-lft-in86.8%
exp-sqrt86.8%
pow-exp86.8%
sqrt-unprod86.8%
associate-*l*86.8%
pow-exp86.8%
pow286.8%
Applied egg-rr86.8%
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 75.8%
if 1 < t Initial program 98.4%
associate-*r*100.0%
*-commutative100.0%
sub-neg100.0%
distribute-lft-in47.5%
exp-sqrt47.5%
pow-exp47.5%
sqrt-unprod47.5%
associate-*l*47.5%
pow-exp47.5%
pow247.5%
Applied egg-rr47.5%
distribute-lft-out100.0%
*-commutative100.0%
sub-neg100.0%
*-commutative100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 68.8%
distribute-lft-out68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in t around inf 53.0%
associate-*l*49.9%
*-commutative49.9%
Simplified49.9%
Final simplification69.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 2.2e+42)
(* t_1 (sqrt (* z 2.0)))
(* t_1 (cbrt (pow (* z 2.0) 1.5))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 2.2e+42) {
tmp = t_1 * sqrt((z * 2.0));
} else {
tmp = t_1 * cbrt(pow((z * 2.0), 1.5));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 2.2e+42) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else {
tmp = t_1 * Math.cbrt(Math.pow((z * 2.0), 1.5));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 2.2e+42) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); else tmp = Float64(t_1 * cbrt((Float64(z * 2.0) ^ 1.5))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 2.2e+42], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[Power[N[(z * 2.0), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 2.2 \cdot 10^{+42}:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt[3]{{\left(z \cdot 2\right)}^{1.5}}\\
\end{array}
\end{array}
if t < 2.2000000000000001e42Initial program 99.2%
associate-*r*99.7%
*-commutative99.7%
sub-neg99.7%
distribute-lft-in84.5%
exp-sqrt84.5%
pow-exp84.5%
sqrt-unprod84.5%
associate-*l*84.5%
pow-exp84.5%
pow284.5%
Applied egg-rr84.5%
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 73.1%
if 2.2000000000000001e42 < t Initial program 98.1%
associate-*r*100.0%
*-commutative100.0%
sub-neg100.0%
distribute-lft-in50.0%
exp-sqrt50.0%
pow-exp50.0%
sqrt-unprod50.0%
associate-*l*50.0%
pow-exp50.0%
pow250.0%
Applied egg-rr50.0%
distribute-lft-out100.0%
*-commutative100.0%
sub-neg100.0%
*-commutative100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 17.1%
*-commutative17.1%
*-commutative17.1%
associate-*l*17.1%
Simplified17.1%
sqrt-prod17.1%
add-cbrt-cube29.7%
pow1/329.7%
add-sqr-sqrt29.7%
pow129.7%
pow1/229.7%
pow-prod-up29.7%
metadata-eval29.7%
Applied egg-rr29.7%
unpow1/329.7%
Simplified29.7%
Final simplification64.3%
(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 99.0%
associate-*r*99.8%
*-commutative99.8%
sub-neg99.8%
distribute-lft-in77.5%
exp-sqrt77.5%
pow-exp77.5%
sqrt-unprod77.5%
associate-*l*77.5%
pow-exp77.5%
pow277.5%
Applied egg-rr77.5%
distribute-lft-out99.7%
*-commutative99.7%
sub-neg99.7%
*-commutative99.7%
*-commutative99.7%
*-commutative99.7%
associate-*l*99.7%
Simplified99.7%
pow299.7%
Applied egg-rr99.7%
Final simplification99.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.0%
associate-*r*99.8%
*-commutative99.8%
sub-neg99.8%
distribute-lft-in77.5%
exp-sqrt77.5%
pow-exp77.5%
sqrt-unprod77.5%
associate-*l*77.5%
pow-exp77.5%
pow277.5%
Applied egg-rr77.5%
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 61.7%
Final simplification61.7%
(FPCore (x y z t) :precision binary64 (* 0.5 (* x (sqrt (* z 2.0)))))
double code(double x, double y, double z, double t) {
return 0.5 * (x * 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 = 0.5d0 * (x * sqrt((z * 2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return 0.5 * (x * Math.sqrt((z * 2.0)));
}
def code(x, y, z, t): return 0.5 * (x * math.sqrt((z * 2.0)))
function code(x, y, z, t) return Float64(0.5 * Float64(x * sqrt(Float64(z * 2.0)))) end
function tmp = code(x, y, z, t) tmp = 0.5 * (x * sqrt((z * 2.0))); end
code[x_, y_, z_, t_] := N[(0.5 * N[(x * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \left(x \cdot \sqrt{z \cdot 2}\right)
\end{array}
Initial program 99.0%
Taylor expanded in t around 0 61.5%
Taylor expanded in x around inf 31.6%
associate-*l*31.6%
Simplified31.6%
sqrt-prod31.7%
pow1/231.7%
Applied egg-rr31.7%
unpow1/231.7%
Simplified31.7%
Final simplification31.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 2024101
(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))))