
(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 12 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 (* z 2.0)) (- (* x 0.5) y)) (pow (exp t) (* 0.5 t))))
double code(double x, double y, double z, double t) {
return (sqrt((z * 2.0)) * ((x * 0.5) - y)) * pow(exp(t), (0.5 * 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 = (sqrt((z * 2.0d0)) * ((x * 0.5d0) - y)) * (exp(t) ** (0.5d0 * t))
end function
public static double code(double x, double y, double z, double t) {
return (Math.sqrt((z * 2.0)) * ((x * 0.5) - y)) * Math.pow(Math.exp(t), (0.5 * t));
}
def code(x, y, z, t): return (math.sqrt((z * 2.0)) * ((x * 0.5) - y)) * math.pow(math.exp(t), (0.5 * t))
function code(x, y, z, t) return Float64(Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(x * 0.5) - y)) * (exp(t) ^ Float64(0.5 * t))) end
function tmp = code(x, y, z, t) tmp = (sqrt((z * 2.0)) * ((x * 0.5) - y)) * (exp(t) ^ (0.5 * t)); end
code[x_, y_, z_, t_] := N[(N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] * N[Power[N[Exp[t], $MachinePrecision], N[(0.5 * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\right) \cdot {\left(e^{t}\right)}^{\left(0.5 \cdot t\right)}
\end{array}
Initial program 99.8%
exp-sqrt99.8%
pow-exp99.8%
pow1/299.8%
pow-pow99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (* (sqrt (* (* z 2.0) (pow (exp t) t))) (- (* x 0.5) y)))
double code(double x, double y, double z, double t) {
return sqrt(((z * 2.0) * pow(exp(t), t))) * ((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(((z * 2.0d0) * (exp(t) ** t))) * ((x * 0.5d0) - y)
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt(((z * 2.0) * Math.pow(Math.exp(t), t))) * ((x * 0.5) - y);
}
def code(x, y, z, t): return math.sqrt(((z * 2.0) * math.pow(math.exp(t), t))) * ((x * 0.5) - y)
function code(x, y, z, t) return Float64(sqrt(Float64(Float64(z * 2.0) * (exp(t) ^ t))) * Float64(Float64(x * 0.5) - y)) end
function tmp = code(x, y, z, t) tmp = sqrt(((z * 2.0) * (exp(t) ^ t))) * ((x * 0.5) - y); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[N[Exp[t], $MachinePrecision], t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t}\right)}^{t}} \cdot \left(x \cdot 0.5 - y\right)
\end{array}
Initial program 99.8%
sqr-neg99.8%
associate-/l*99.8%
distribute-frac-neg99.8%
exp-neg99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
exp-sqrt99.8%
Simplified99.8%
expm1-log1p-u98.5%
expm1-udef75.6%
pow-exp75.6%
sqrt-unprod75.6%
associate-*l*75.6%
Applied egg-rr75.6%
expm1-def98.6%
expm1-log1p99.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (* (* (sqrt (* z 2.0)) (- (* x 0.5) y)) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (sqrt((z * 2.0)) * ((x * 0.5) - y)) * 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 = (sqrt((z * 2.0d0)) * ((x * 0.5d0) - y)) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (Math.sqrt((z * 2.0)) * ((x * 0.5) - y)) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (math.sqrt((z * 2.0)) * ((x * 0.5) - y)) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(x * 0.5) - y)) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (sqrt((z * 2.0)) * ((x * 0.5) - y)) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (- (* 0.5 (+ x (* t (* t (- (* x 0.5) y))))) y)))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * ((0.5 * (x + (t * (t * ((x * 0.5) - y))))) - y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((z * 2.0d0)) * ((0.5d0 * (x + (t * (t * ((x * 0.5d0) - y))))) - y)
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * ((0.5 * (x + (t * (t * ((x * 0.5) - y))))) - y);
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * ((0.5 * (x + (t * (t * ((x * 0.5) - y))))) - y)
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(0.5 * Float64(x + Float64(t * Float64(t * Float64(Float64(x * 0.5) - y))))) - y)) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * ((0.5 * (x + (t * (t * ((x * 0.5) - y))))) - y); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * N[(x + N[(t * N[(t * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(0.5 \cdot \left(x + t \cdot \left(t \cdot \left(x \cdot 0.5 - y\right)\right)\right) - y\right)
\end{array}
Initial program 99.8%
sqr-neg99.8%
associate-/l*99.8%
distribute-frac-neg99.8%
exp-neg99.8%
associate-*r/99.8%
*-rgt-identity99.8%
*-commutative99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 91.0%
distribute-lft-out91.0%
unpow291.0%
associate-*l*89.5%
Simplified89.5%
Final simplification89.5%
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (- (* 0.5 (+ x (* (* t t) (- (* x 0.5) y)))) y)))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * ((0.5 * (x + ((t * t) * ((x * 0.5) - y)))) - y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((z * 2.0d0)) * ((0.5d0 * (x + ((t * t) * ((x * 0.5d0) - y)))) - y)
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * ((0.5 * (x + ((t * t) * ((x * 0.5) - y)))) - y);
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * ((0.5 * (x + ((t * t) * ((x * 0.5) - y)))) - y)
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(0.5 * Float64(x + Float64(Float64(t * t) * Float64(Float64(x * 0.5) - y)))) - y)) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * ((0.5 * (x + ((t * t) * ((x * 0.5) - y)))) - y); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * N[(x + N[(N[(t * t), $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(0.5 \cdot \left(x + \left(t \cdot t\right) \cdot \left(x \cdot 0.5 - y\right)\right) - y\right)
\end{array}
Initial program 99.8%
sqr-neg99.8%
associate-/l*99.8%
distribute-frac-neg99.8%
exp-neg99.8%
associate-*r/99.8%
*-rgt-identity99.8%
*-commutative99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 91.0%
distribute-lft-out91.0%
unpow291.0%
Simplified91.0%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (if (<= t 7.8e+170) (* (sqrt (* z 2.0)) (- (* x 0.5) y)) (* (+ 1.0 (* t (* 0.5 t))) (sqrt (* 2.0 (* y (* y z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 7.8e+170) {
tmp = sqrt((z * 2.0)) * ((x * 0.5) - y);
} else {
tmp = (1.0 + (t * (0.5 * t))) * sqrt((2.0 * (y * (y * z))));
}
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 <= 7.8d+170) then
tmp = sqrt((z * 2.0d0)) * ((x * 0.5d0) - y)
else
tmp = (1.0d0 + (t * (0.5d0 * t))) * sqrt((2.0d0 * (y * (y * z))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 7.8e+170) {
tmp = Math.sqrt((z * 2.0)) * ((x * 0.5) - y);
} else {
tmp = (1.0 + (t * (0.5 * t))) * Math.sqrt((2.0 * (y * (y * z))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 7.8e+170: tmp = math.sqrt((z * 2.0)) * ((x * 0.5) - y) else: tmp = (1.0 + (t * (0.5 * t))) * math.sqrt((2.0 * (y * (y * z)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 7.8e+170) tmp = Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(x * 0.5) - y)); else tmp = Float64(Float64(1.0 + Float64(t * Float64(0.5 * t))) * sqrt(Float64(2.0 * Float64(y * Float64(y * z))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 7.8e+170) tmp = sqrt((z * 2.0)) * ((x * 0.5) - y); else tmp = (1.0 + (t * (0.5 * t))) * sqrt((2.0 * (y * (y * z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 7.8e+170], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(t * N[(0.5 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(y * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7.8 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t \cdot \left(0.5 \cdot t\right)\right) \cdot \sqrt{2 \cdot \left(y \cdot \left(y \cdot z\right)\right)}\\
\end{array}
\end{array}
if t < 7.8000000000000005e170Initial program 99.8%
sqr-neg99.8%
associate-/l*99.8%
distribute-frac-neg99.8%
exp-neg99.8%
associate-*r/99.8%
*-rgt-identity99.8%
*-commutative99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 63.0%
if 7.8000000000000005e170 < t Initial program 100.0%
add-sqr-sqrt53.3%
sqrt-unprod46.7%
*-commutative46.7%
*-commutative46.7%
swap-sqr46.7%
add-sqr-sqrt46.7%
pow246.7%
Applied egg-rr46.7%
Taylor expanded in x around 0 40.0%
unpow240.0%
associate-*l*40.0%
Simplified40.0%
Taylor expanded in t around 0 40.0%
*-commutative40.0%
unpow240.0%
associate-*r*40.0%
Simplified40.0%
Final simplification60.3%
(FPCore (x y z t) :precision binary64 (* (* (sqrt (* z 2.0)) (- (* x 0.5) y)) (+ 1.0 (* t (* 0.5 t)))))
double code(double x, double y, double z, double t) {
return (sqrt((z * 2.0)) * ((x * 0.5) - y)) * (1.0 + (t * (0.5 * 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 = (sqrt((z * 2.0d0)) * ((x * 0.5d0) - y)) * (1.0d0 + (t * (0.5d0 * t)))
end function
public static double code(double x, double y, double z, double t) {
return (Math.sqrt((z * 2.0)) * ((x * 0.5) - y)) * (1.0 + (t * (0.5 * t)));
}
def code(x, y, z, t): return (math.sqrt((z * 2.0)) * ((x * 0.5) - y)) * (1.0 + (t * (0.5 * t)))
function code(x, y, z, t) return Float64(Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(x * 0.5) - y)) * Float64(1.0 + Float64(t * Float64(0.5 * t)))) end
function tmp = code(x, y, z, t) tmp = (sqrt((z * 2.0)) * ((x * 0.5) - y)) * (1.0 + (t * (0.5 * t))); end
code[x_, y_, z_, t_] := N[(N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(t * N[(0.5 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\right) \cdot \left(1 + t \cdot \left(0.5 \cdot t\right)\right)
\end{array}
Initial program 99.8%
Taylor expanded in t around 0 88.5%
*-commutative21.7%
unpow221.7%
associate-*r*21.7%
Simplified88.5%
Final simplification88.5%
(FPCore (x y z t) :precision binary64 (if (<= t 5.6e+26) (* y (- (sqrt (* z 2.0)))) (sqrt (* 2.0 (* y (* y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5.6e+26) {
tmp = y * -sqrt((z * 2.0));
} else {
tmp = sqrt((2.0 * (y * (y * z))));
}
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 <= 5.6d+26) then
tmp = y * -sqrt((z * 2.0d0))
else
tmp = sqrt((2.0d0 * (y * (y * z))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5.6e+26) {
tmp = y * -Math.sqrt((z * 2.0));
} else {
tmp = Math.sqrt((2.0 * (y * (y * z))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 5.6e+26: tmp = y * -math.sqrt((z * 2.0)) else: tmp = math.sqrt((2.0 * (y * (y * z)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 5.6e+26) tmp = Float64(y * Float64(-sqrt(Float64(z * 2.0)))); else tmp = sqrt(Float64(2.0 * Float64(y * Float64(y * z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 5.6e+26) tmp = y * -sqrt((z * 2.0)); else tmp = sqrt((2.0 * (y * (y * z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 5.6e+26], N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[Sqrt[N[(2.0 * N[(y * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.6 \cdot 10^{+26}:\\
\;\;\;\;y \cdot \left(-\sqrt{z \cdot 2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(y \cdot \left(y \cdot z\right)\right)}\\
\end{array}
\end{array}
if t < 5.59999999999999999e26Initial program 99.7%
sqr-neg99.7%
associate-/l*99.7%
distribute-frac-neg99.7%
exp-neg99.8%
associate-*r/99.8%
*-rgt-identity99.8%
*-commutative99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.7%
distribute-frac-neg99.7%
associate-/l*99.7%
sqr-neg99.7%
Simplified99.8%
Taylor expanded in t around 0 69.5%
associate-*r*70.0%
*-commutative70.0%
associate-*l*70.0%
Simplified70.0%
Taylor expanded in x around 0 35.6%
mul-1-neg35.6%
distribute-rgt-neg-in35.6%
Simplified35.6%
associate-*r*35.1%
*-commutative35.1%
distribute-rgt-neg-out35.1%
neg-sub035.1%
add-sqr-sqrt35.1%
sqr-neg35.1%
sqrt-unprod0.0%
add-sqr-sqrt3.5%
associate-*l*3.5%
add-sqr-sqrt0.0%
sqrt-unprod35.6%
sqr-neg35.6%
add-sqr-sqrt35.6%
sqrt-prod35.7%
*-commutative35.7%
Applied egg-rr35.7%
neg-sub035.7%
*-commutative35.7%
distribute-rgt-neg-in35.7%
Simplified35.7%
if 5.59999999999999999e26 < t Initial program 100.0%
sqr-neg100.0%
associate-/l*100.0%
distribute-frac-neg100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
*-commutative100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
exp-neg100.0%
distribute-frac-neg100.0%
associate-/l*100.0%
sqr-neg100.0%
Simplified100.0%
Taylor expanded in t around 0 17.4%
associate-*r*17.4%
*-commutative17.4%
associate-*l*17.4%
Simplified17.4%
Taylor expanded in x around 0 4.7%
mul-1-neg4.7%
distribute-rgt-neg-in4.7%
Simplified4.7%
add-sqr-sqrt3.3%
sqrt-unprod14.8%
swap-sqr16.4%
sqr-neg16.4%
add-sqr-sqrt16.4%
associate-*r*14.8%
sqrt-prod14.8%
pow1/214.8%
Applied egg-rr16.4%
unpow1/216.4%
*-commutative16.4%
unpow216.4%
associate-*r*16.4%
*-commutative16.4%
unpow216.4%
associate-*r*14.8%
Simplified14.8%
Final simplification30.9%
(FPCore (x y z t) :precision binary64 (if (<= x 1.1e+31) (* y (- (sqrt (* z 2.0)))) (sqrt (* z (* 0.5 (* x x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.1e+31) {
tmp = y * -sqrt((z * 2.0));
} else {
tmp = sqrt((z * (0.5 * (x * 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 (x <= 1.1d+31) then
tmp = y * -sqrt((z * 2.0d0))
else
tmp = sqrt((z * (0.5d0 * (x * x))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.1e+31) {
tmp = y * -Math.sqrt((z * 2.0));
} else {
tmp = Math.sqrt((z * (0.5 * (x * x))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 1.1e+31: tmp = y * -math.sqrt((z * 2.0)) else: tmp = math.sqrt((z * (0.5 * (x * x)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 1.1e+31) tmp = Float64(y * Float64(-sqrt(Float64(z * 2.0)))); else tmp = sqrt(Float64(z * Float64(0.5 * Float64(x * x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 1.1e+31) tmp = y * -sqrt((z * 2.0)); else tmp = sqrt((z * (0.5 * (x * x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 1.1e+31], N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[Sqrt[N[(z * N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.1 \cdot 10^{+31}:\\
\;\;\;\;y \cdot \left(-\sqrt{z \cdot 2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z \cdot \left(0.5 \cdot \left(x \cdot x\right)\right)}\\
\end{array}
\end{array}
if x < 1.10000000000000005e31Initial program 99.8%
sqr-neg99.8%
associate-/l*99.8%
distribute-frac-neg99.8%
exp-neg99.8%
associate-*r/99.8%
*-rgt-identity99.8%
*-commutative99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.9%
Taylor expanded in t around 0 54.4%
associate-*r*54.9%
*-commutative54.9%
associate-*l*54.8%
Simplified54.8%
Taylor expanded in x around 0 32.0%
mul-1-neg32.0%
distribute-rgt-neg-in32.0%
Simplified32.0%
associate-*r*31.6%
*-commutative31.6%
distribute-rgt-neg-out31.6%
neg-sub031.6%
add-sqr-sqrt31.6%
sqr-neg31.6%
sqrt-unprod0.0%
add-sqr-sqrt2.7%
associate-*l*2.7%
add-sqr-sqrt0.0%
sqrt-unprod32.0%
sqr-neg32.0%
add-sqr-sqrt32.0%
sqrt-prod32.1%
*-commutative32.1%
Applied egg-rr32.1%
neg-sub032.1%
*-commutative32.1%
distribute-rgt-neg-in32.1%
Simplified32.1%
if 1.10000000000000005e31 < x Initial program 99.7%
sqr-neg99.7%
associate-/l*99.7%
distribute-frac-neg99.7%
exp-neg99.7%
associate-*r/99.7%
*-rgt-identity99.7%
*-commutative99.7%
associate-*r/99.7%
*-rgt-identity99.7%
associate-*r/99.7%
exp-neg99.7%
distribute-frac-neg99.7%
associate-/l*99.7%
sqr-neg99.7%
Simplified99.7%
Taylor expanded in t around 0 70.2%
*-commutative70.2%
pow170.2%
metadata-eval70.2%
sqrt-pow155.0%
sqrt-prod56.9%
pow1/256.9%
*-commutative56.9%
Applied egg-rr56.9%
unpow1/256.9%
associate-*r*56.9%
Simplified56.9%
Taylor expanded in x around inf 53.3%
associate-*r*53.3%
unpow253.3%
Simplified53.3%
Final simplification36.4%
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (- (* x 0.5) y)))
double code(double x, double y, double z, double t) {
return 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((z * 2.0d0)) * ((x * 0.5d0) - y)
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * ((x * 0.5) - y);
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * ((x * 0.5) - y)
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(x * 0.5) - y)) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * ((x * 0.5) - y); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)
\end{array}
Initial program 99.8%
sqr-neg99.8%
associate-/l*99.8%
distribute-frac-neg99.8%
exp-neg99.8%
associate-*r/99.8%
*-rgt-identity99.8%
*-commutative99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 58.0%
Final simplification58.0%
(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%
sqr-neg99.8%
associate-/l*99.8%
distribute-frac-neg99.8%
exp-neg99.8%
associate-*r/99.8%
*-rgt-identity99.8%
*-commutative99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 57.5%
associate-*r*57.9%
*-commutative57.9%
associate-*l*57.8%
Simplified57.8%
Taylor expanded in x around 0 28.5%
mul-1-neg28.5%
distribute-rgt-neg-in28.5%
Simplified28.5%
associate-*r*28.1%
*-commutative28.1%
distribute-rgt-neg-out28.1%
neg-sub028.1%
add-sqr-sqrt28.1%
sqr-neg28.1%
sqrt-unprod0.0%
add-sqr-sqrt2.9%
associate-*l*2.9%
add-sqr-sqrt0.0%
sqrt-unprod28.5%
sqr-neg28.5%
add-sqr-sqrt28.5%
sqrt-prod28.6%
*-commutative28.6%
Applied egg-rr28.6%
neg-sub028.6%
*-commutative28.6%
distribute-rgt-neg-in28.6%
Simplified28.6%
Final simplification28.6%
(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%
sqr-neg99.8%
associate-/l*99.8%
distribute-frac-neg99.8%
exp-neg99.8%
associate-*r/99.8%
*-rgt-identity99.8%
*-commutative99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 57.5%
associate-*r*57.9%
*-commutative57.9%
associate-*l*57.8%
Simplified57.8%
Taylor expanded in x around 0 28.5%
mul-1-neg28.5%
distribute-rgt-neg-in28.5%
Simplified28.5%
associate-*r*28.1%
*-commutative28.1%
expm1-log1p-u16.5%
expm1-udef12.0%
associate-*l*12.4%
add-sqr-sqrt0.0%
sqrt-unprod2.2%
sqr-neg2.2%
add-sqr-sqrt2.2%
sqrt-prod2.2%
*-commutative2.2%
Applied egg-rr2.2%
expm1-def2.2%
expm1-log1p2.9%
Simplified2.9%
Final simplification2.9%
(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 2023297
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
:herbie-target
(* (* (- (* 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))))