
(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 (* (- (* 0.5 x) y) (sqrt (* z (* 2.0 (exp (* t t)))))))
double code(double x, double y, double z, double t) {
return ((0.5 * x) - 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 = ((0.5d0 * x) - y) * sqrt((z * (2.0d0 * exp((t * t)))))
end function
public static double code(double x, double y, double z, double t) {
return ((0.5 * x) - y) * Math.sqrt((z * (2.0 * Math.exp((t * t)))));
}
def code(x, y, z, t): return ((0.5 * x) - y) * math.sqrt((z * (2.0 * math.exp((t * t)))))
function code(x, y, z, t) return Float64(Float64(Float64(0.5 * x) - y) * sqrt(Float64(z * Float64(2.0 * exp(Float64(t * t)))))) end
function tmp = code(x, y, z, t) tmp = ((0.5 * x) - y) * sqrt((z * (2.0 * exp((t * t))))); end
code[x_, y_, z_, t_] := N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * N[(2.0 * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 \cdot x - y\right) \cdot \sqrt{z \cdot \left(2 \cdot e^{t \cdot t}\right)}
\end{array}
Initial program 99.1%
*-commutative99.1%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
exp-sqrt99.9%
associate-*r*99.1%
*-commutative99.1%
expm1-log1p-u52.3%
expm1-udef42.5%
Applied egg-rr42.5%
expm1-def52.3%
expm1-log1p99.9%
fma-neg99.9%
*-commutative99.9%
associate-*l*99.9%
Simplified99.9%
pow299.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -5.5e+56)
(sqrt (* 2.0 (* z (* y (- y x)))))
(if (<= y 3.8e-98)
(* x (sqrt (* 0.5 z)))
(if (or (<= y 2.8e-20) (not (<= y 9.5e+28)))
(* y (- (sqrt (* z 2.0))))
(* (* x (sqrt 0.5)) (sqrt z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e+56) {
tmp = sqrt((2.0 * (z * (y * (y - x)))));
} else if (y <= 3.8e-98) {
tmp = x * sqrt((0.5 * z));
} else if ((y <= 2.8e-20) || !(y <= 9.5e+28)) {
tmp = y * -sqrt((z * 2.0));
} else {
tmp = (x * sqrt(0.5)) * sqrt(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 (y <= (-5.5d+56)) then
tmp = sqrt((2.0d0 * (z * (y * (y - x)))))
else if (y <= 3.8d-98) then
tmp = x * sqrt((0.5d0 * z))
else if ((y <= 2.8d-20) .or. (.not. (y <= 9.5d+28))) then
tmp = y * -sqrt((z * 2.0d0))
else
tmp = (x * sqrt(0.5d0)) * sqrt(z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e+56) {
tmp = Math.sqrt((2.0 * (z * (y * (y - x)))));
} else if (y <= 3.8e-98) {
tmp = x * Math.sqrt((0.5 * z));
} else if ((y <= 2.8e-20) || !(y <= 9.5e+28)) {
tmp = y * -Math.sqrt((z * 2.0));
} else {
tmp = (x * Math.sqrt(0.5)) * Math.sqrt(z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.5e+56: tmp = math.sqrt((2.0 * (z * (y * (y - x))))) elif y <= 3.8e-98: tmp = x * math.sqrt((0.5 * z)) elif (y <= 2.8e-20) or not (y <= 9.5e+28): tmp = y * -math.sqrt((z * 2.0)) else: tmp = (x * math.sqrt(0.5)) * math.sqrt(z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.5e+56) tmp = sqrt(Float64(2.0 * Float64(z * Float64(y * Float64(y - x))))); elseif (y <= 3.8e-98) tmp = Float64(x * sqrt(Float64(0.5 * z))); elseif ((y <= 2.8e-20) || !(y <= 9.5e+28)) tmp = Float64(y * Float64(-sqrt(Float64(z * 2.0)))); else tmp = Float64(Float64(x * sqrt(0.5)) * sqrt(z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.5e+56) tmp = sqrt((2.0 * (z * (y * (y - x))))); elseif (y <= 3.8e-98) tmp = x * sqrt((0.5 * z)); elseif ((y <= 2.8e-20) || ~((y <= 9.5e+28))) tmp = y * -sqrt((z * 2.0)); else tmp = (x * sqrt(0.5)) * sqrt(z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.5e+56], N[Sqrt[N[(2.0 * N[(z * N[(y * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 3.8e-98], N[(x * N[Sqrt[N[(0.5 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 2.8e-20], N[Not[LessEqual[y, 9.5e+28]], $MachinePrecision]], N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(x * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+56}:\\
\;\;\;\;\sqrt{2 \cdot \left(z \cdot \left(y \cdot \left(y - x\right)\right)\right)}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-20} \lor \neg \left(y \leq 9.5 \cdot 10^{+28}\right):\\
\;\;\;\;y \cdot \left(-\sqrt{z \cdot 2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \sqrt{0.5}\right) \cdot \sqrt{z}\\
\end{array}
\end{array}
if y < -5.5000000000000002e56Initial program 99.9%
*-commutative99.9%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 51.0%
*-commutative51.0%
*-commutative51.0%
fma-neg51.0%
associate-*l*50.9%
fma-neg50.9%
*-commutative50.9%
Simplified50.9%
associate-*r*51.0%
*-commutative51.0%
add-sqr-sqrt47.0%
sqrt-unprod57.6%
*-commutative57.6%
associate-*r*57.6%
*-commutative57.6%
associate-*r*57.6%
swap-sqr57.6%
rem-square-sqrt57.7%
*-commutative57.7%
*-commutative57.7%
swap-sqr63.0%
add-sqr-sqrt63.0%
unpow263.0%
Applied egg-rr63.0%
Taylor expanded in x around 0 59.4%
+-commutative59.4%
unpow259.4%
associate-*r*59.4%
distribute-rgt-out61.2%
mul-1-neg61.2%
Simplified61.2%
if -5.5000000000000002e56 < y < 3.8000000000000003e-98Initial program 98.0%
*-commutative98.0%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 48.7%
*-commutative48.7%
*-commutative48.7%
fma-neg48.7%
associate-*l*48.8%
fma-neg48.8%
*-commutative48.8%
Simplified48.8%
associate-*r*48.7%
*-commutative48.7%
add-sqr-sqrt23.9%
sqrt-unprod24.4%
*-commutative24.4%
associate-*r*24.5%
*-commutative24.5%
associate-*r*24.4%
swap-sqr24.4%
rem-square-sqrt24.5%
*-commutative24.5%
*-commutative24.5%
swap-sqr22.7%
add-sqr-sqrt22.7%
unpow222.7%
Applied egg-rr22.7%
Taylor expanded in x around inf 20.4%
associate-*r*20.4%
unpow220.4%
associate-*l*20.4%
*-commutative20.4%
associate-*l*20.4%
unpow220.4%
Simplified20.4%
associate-*r*20.4%
sqrt-prod18.7%
*-commutative18.7%
unpow218.7%
sqrt-prod20.6%
add-sqr-sqrt43.1%
Applied egg-rr43.1%
if 3.8000000000000003e-98 < y < 2.8000000000000003e-20 or 9.49999999999999927e28 < y Initial program 99.8%
*-commutative99.8%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 58.7%
*-commutative58.7%
*-commutative58.7%
fma-neg58.7%
associate-*l*58.6%
fma-neg58.6%
*-commutative58.6%
Simplified58.6%
Taylor expanded in x around 0 48.1%
mul-1-neg48.1%
distribute-lft-neg-out48.1%
*-commutative48.1%
Simplified48.1%
associate-*r*48.1%
distribute-rgt-neg-out48.1%
add-sqr-sqrt48.1%
sqrt-unprod54.6%
sqr-neg54.6%
sqrt-unprod0.0%
add-sqr-sqrt1.1%
*-commutative1.1%
add-sqr-sqrt0.0%
sqrt-unprod54.6%
sqr-neg54.6%
sqrt-unprod48.1%
add-sqr-sqrt48.1%
sqrt-unprod48.2%
*-commutative48.2%
Applied egg-rr48.2%
distribute-rgt-neg-in48.2%
*-commutative48.2%
Simplified48.2%
if 2.8000000000000003e-20 < y < 9.49999999999999927e28Initial program 99.9%
*-commutative99.9%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 49.6%
*-commutative49.6%
*-commutative49.6%
fma-neg49.6%
associate-*l*49.4%
fma-neg49.4%
*-commutative49.4%
Simplified49.4%
associate-*r*49.6%
*-commutative49.6%
add-sqr-sqrt16.7%
sqrt-unprod23.9%
*-commutative23.9%
associate-*r*24.0%
*-commutative24.0%
associate-*r*24.0%
swap-sqr24.0%
rem-square-sqrt24.1%
*-commutative24.1%
*-commutative24.1%
swap-sqr23.9%
add-sqr-sqrt23.9%
unpow223.9%
Applied egg-rr23.9%
Taylor expanded in x around inf 19.5%
associate-*r*19.5%
unpow219.5%
associate-*l*19.5%
*-commutative19.5%
associate-*l*19.5%
unpow219.5%
Simplified19.5%
Taylor expanded in x around 0 45.2%
Final simplification48.6%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.6e+14)
(* x (sqrt (* 0.5 z)))
(if (<= x 1e-62)
(* y (- (sqrt (* z 2.0))))
(sqrt (* 2.0 (* 0.25 (* z (pow x 2.0))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e+14) {
tmp = x * sqrt((0.5 * z));
} else if (x <= 1e-62) {
tmp = y * -sqrt((z * 2.0));
} else {
tmp = sqrt((2.0 * (0.25 * (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 (x <= (-1.6d+14)) then
tmp = x * sqrt((0.5d0 * z))
else if (x <= 1d-62) then
tmp = y * -sqrt((z * 2.0d0))
else
tmp = sqrt((2.0d0 * (0.25d0 * (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 (x <= -1.6e+14) {
tmp = x * Math.sqrt((0.5 * z));
} else if (x <= 1e-62) {
tmp = y * -Math.sqrt((z * 2.0));
} else {
tmp = Math.sqrt((2.0 * (0.25 * (z * Math.pow(x, 2.0)))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.6e+14: tmp = x * math.sqrt((0.5 * z)) elif x <= 1e-62: tmp = y * -math.sqrt((z * 2.0)) else: tmp = math.sqrt((2.0 * (0.25 * (z * math.pow(x, 2.0))))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.6e+14) tmp = Float64(x * sqrt(Float64(0.5 * z))); elseif (x <= 1e-62) tmp = Float64(y * Float64(-sqrt(Float64(z * 2.0)))); else tmp = sqrt(Float64(2.0 * Float64(0.25 * Float64(z * (x ^ 2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.6e+14) tmp = x * sqrt((0.5 * z)); elseif (x <= 1e-62) tmp = y * -sqrt((z * 2.0)); else tmp = sqrt((2.0 * (0.25 * (z * (x ^ 2.0))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.6e+14], N[(x * N[Sqrt[N[(0.5 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1e-62], N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[Sqrt[N[(2.0 * N[(0.25 * N[(z * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\
\mathbf{elif}\;x \leq 10^{-62}:\\
\;\;\;\;y \cdot \left(-\sqrt{z \cdot 2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(0.25 \cdot \left(z \cdot {x}^{2}\right)\right)}\\
\end{array}
\end{array}
if x < -1.6e14Initial program 99.9%
*-commutative99.9%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 56.7%
*-commutative56.7%
*-commutative56.7%
fma-neg56.7%
associate-*l*56.6%
fma-neg56.6%
*-commutative56.6%
Simplified56.6%
associate-*r*56.7%
*-commutative56.7%
add-sqr-sqrt0.3%
sqrt-unprod3.4%
*-commutative3.4%
associate-*r*3.4%
*-commutative3.4%
associate-*r*3.4%
swap-sqr3.4%
rem-square-sqrt3.4%
*-commutative3.4%
*-commutative3.4%
swap-sqr3.4%
add-sqr-sqrt3.4%
unpow23.4%
Applied egg-rr3.4%
Taylor expanded in x around inf 2.0%
associate-*r*2.0%
unpow22.0%
associate-*l*2.0%
*-commutative2.0%
associate-*l*2.0%
unpow22.0%
Simplified2.0%
associate-*r*2.0%
sqrt-prod2.0%
*-commutative2.0%
unpow22.0%
sqrt-prod0.0%
add-sqr-sqrt47.4%
Applied egg-rr47.4%
if -1.6e14 < x < 1e-62Initial program 98.1%
*-commutative98.1%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 47.6%
*-commutative47.6%
*-commutative47.6%
fma-neg47.6%
associate-*l*47.6%
fma-neg47.6%
*-commutative47.6%
Simplified47.6%
Taylor expanded in x around 0 40.7%
mul-1-neg40.7%
distribute-lft-neg-out40.7%
*-commutative40.7%
Simplified40.7%
associate-*r*40.8%
distribute-rgt-neg-out40.8%
add-sqr-sqrt24.7%
sqrt-unprod27.8%
sqr-neg27.8%
sqrt-unprod0.7%
add-sqr-sqrt1.4%
*-commutative1.4%
add-sqr-sqrt0.7%
sqrt-unprod27.8%
sqr-neg27.8%
sqrt-unprod24.7%
add-sqr-sqrt40.8%
sqrt-unprod40.9%
*-commutative40.9%
Applied egg-rr40.9%
distribute-rgt-neg-in40.9%
*-commutative40.9%
Simplified40.9%
if 1e-62 < x Initial program 99.9%
*-commutative99.9%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 55.8%
*-commutative55.8%
*-commutative55.8%
fma-neg55.8%
associate-*l*55.7%
fma-neg55.7%
*-commutative55.7%
Simplified55.7%
associate-*r*55.8%
*-commutative55.8%
add-sqr-sqrt46.2%
sqrt-unprod58.7%
*-commutative58.7%
associate-*r*58.7%
*-commutative58.7%
associate-*r*58.7%
swap-sqr58.6%
rem-square-sqrt58.8%
*-commutative58.8%
*-commutative58.8%
swap-sqr61.3%
add-sqr-sqrt61.4%
unpow261.4%
Applied egg-rr61.4%
Taylor expanded in x around inf 52.9%
Final simplification46.1%
(FPCore (x y z t)
:precision binary64
(if (<= t 520000000.0)
(* (fma 0.5 x (- y)) (sqrt (* z 2.0)))
(if (<= t 1.4e+239)
(sqrt (* 2.0 (* 0.25 (* z (pow x 2.0)))))
(sqrt (* 2.0 (* z (* y (- y x))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 520000000.0) {
tmp = fma(0.5, x, -y) * sqrt((z * 2.0));
} else if (t <= 1.4e+239) {
tmp = sqrt((2.0 * (0.25 * (z * pow(x, 2.0)))));
} else {
tmp = sqrt((2.0 * (z * (y * (y - x)))));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 520000000.0) tmp = Float64(fma(0.5, x, Float64(-y)) * sqrt(Float64(z * 2.0))); elseif (t <= 1.4e+239) tmp = sqrt(Float64(2.0 * Float64(0.25 * Float64(z * (x ^ 2.0))))); else tmp = sqrt(Float64(2.0 * Float64(z * Float64(y * Float64(y - x))))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 520000000.0], N[(N[(0.5 * x + (-y)), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+239], N[Sqrt[N[(2.0 * N[(0.25 * N[(z * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(z * N[(y * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 520000000:\\
\;\;\;\;\mathsf{fma}\left(0.5, x, -y\right) \cdot \sqrt{z \cdot 2}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+239}:\\
\;\;\;\;\sqrt{2 \cdot \left(0.25 \cdot \left(z \cdot {x}^{2}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(z \cdot \left(y \cdot \left(y - x\right)\right)\right)}\\
\end{array}
\end{array}
if t < 5.2e8Initial program 99.3%
*-commutative99.3%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 64.1%
*-commutative64.1%
*-commutative64.1%
fma-neg64.1%
associate-*l*64.0%
fma-neg64.0%
*-commutative64.0%
Simplified64.0%
*-commutative64.0%
associate-*r*64.1%
sub-neg64.1%
distribute-lft-in64.1%
*-commutative64.1%
associate-*l*64.1%
*-commutative64.1%
associate-*l*64.1%
*-commutative64.1%
sqrt-unprod64.2%
*-commutative64.2%
sqrt-unprod64.3%
Applied egg-rr64.3%
*-commutative64.3%
*-commutative64.3%
associate-*r*64.3%
*-commutative64.3%
distribute-rgt-in64.3%
fma-udef64.3%
*-commutative64.3%
*-commutative64.3%
Simplified64.3%
if 5.2e8 < t < 1.40000000000000001e239Initial program 98.0%
*-commutative98.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 20.2%
*-commutative20.2%
*-commutative20.2%
fma-neg20.2%
associate-*l*20.2%
fma-neg20.2%
*-commutative20.2%
Simplified20.2%
associate-*r*20.2%
*-commutative20.2%
add-sqr-sqrt8.3%
sqrt-unprod24.9%
*-commutative24.9%
associate-*r*24.9%
*-commutative24.9%
associate-*r*24.9%
swap-sqr24.9%
rem-square-sqrt24.9%
*-commutative24.9%
*-commutative24.9%
swap-sqr26.8%
add-sqr-sqrt26.8%
unpow226.8%
Applied egg-rr26.8%
Taylor expanded in x around inf 23.0%
if 1.40000000000000001e239 < t Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 11.0%
*-commutative11.0%
*-commutative11.0%
fma-neg11.0%
associate-*l*11.0%
fma-neg11.0%
*-commutative11.0%
Simplified11.0%
associate-*r*11.0%
*-commutative11.0%
add-sqr-sqrt1.6%
sqrt-unprod8.1%
*-commutative8.1%
associate-*r*8.1%
*-commutative8.1%
associate-*r*8.1%
swap-sqr8.1%
rem-square-sqrt8.1%
*-commutative8.1%
*-commutative8.1%
swap-sqr8.0%
add-sqr-sqrt8.0%
unpow28.0%
Applied egg-rr8.0%
Taylor expanded in x around 0 7.7%
+-commutative7.7%
unpow27.7%
associate-*r*7.7%
distribute-rgt-out7.7%
mul-1-neg7.7%
Simplified7.7%
Final simplification52.9%
(FPCore (x y z t)
:precision binary64
(if (<= x -45000000000000.0)
(* x (sqrt (* 0.5 z)))
(if (<= x 1.25e-62)
(* y (- (sqrt (* z 2.0))))
(sqrt (* z (* 0.5 (pow x 2.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -45000000000000.0) {
tmp = x * sqrt((0.5 * z));
} else if (x <= 1.25e-62) {
tmp = y * -sqrt((z * 2.0));
} else {
tmp = sqrt((z * (0.5 * 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 (x <= (-45000000000000.0d0)) then
tmp = x * sqrt((0.5d0 * z))
else if (x <= 1.25d-62) then
tmp = y * -sqrt((z * 2.0d0))
else
tmp = sqrt((z * (0.5d0 * (x ** 2.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -45000000000000.0) {
tmp = x * Math.sqrt((0.5 * z));
} else if (x <= 1.25e-62) {
tmp = y * -Math.sqrt((z * 2.0));
} else {
tmp = Math.sqrt((z * (0.5 * Math.pow(x, 2.0))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -45000000000000.0: tmp = x * math.sqrt((0.5 * z)) elif x <= 1.25e-62: tmp = y * -math.sqrt((z * 2.0)) else: tmp = math.sqrt((z * (0.5 * math.pow(x, 2.0)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -45000000000000.0) tmp = Float64(x * sqrt(Float64(0.5 * z))); elseif (x <= 1.25e-62) tmp = Float64(y * Float64(-sqrt(Float64(z * 2.0)))); else tmp = sqrt(Float64(z * Float64(0.5 * (x ^ 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -45000000000000.0) tmp = x * sqrt((0.5 * z)); elseif (x <= 1.25e-62) tmp = y * -sqrt((z * 2.0)); else tmp = sqrt((z * (0.5 * (x ^ 2.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -45000000000000.0], N[(x * N[Sqrt[N[(0.5 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.25e-62], N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[Sqrt[N[(z * N[(0.5 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -45000000000000:\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-62}:\\
\;\;\;\;y \cdot \left(-\sqrt{z \cdot 2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z \cdot \left(0.5 \cdot {x}^{2}\right)}\\
\end{array}
\end{array}
if x < -4.5e13Initial program 99.9%
*-commutative99.9%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 56.7%
*-commutative56.7%
*-commutative56.7%
fma-neg56.7%
associate-*l*56.6%
fma-neg56.6%
*-commutative56.6%
Simplified56.6%
associate-*r*56.7%
*-commutative56.7%
add-sqr-sqrt0.3%
sqrt-unprod3.4%
*-commutative3.4%
associate-*r*3.4%
*-commutative3.4%
associate-*r*3.4%
swap-sqr3.4%
rem-square-sqrt3.4%
*-commutative3.4%
*-commutative3.4%
swap-sqr3.4%
add-sqr-sqrt3.4%
unpow23.4%
Applied egg-rr3.4%
Taylor expanded in x around inf 2.0%
associate-*r*2.0%
unpow22.0%
associate-*l*2.0%
*-commutative2.0%
associate-*l*2.0%
unpow22.0%
Simplified2.0%
associate-*r*2.0%
sqrt-prod2.0%
*-commutative2.0%
unpow22.0%
sqrt-prod0.0%
add-sqr-sqrt47.4%
Applied egg-rr47.4%
if -4.5e13 < x < 1.25e-62Initial program 98.1%
*-commutative98.1%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 47.6%
*-commutative47.6%
*-commutative47.6%
fma-neg47.6%
associate-*l*47.6%
fma-neg47.6%
*-commutative47.6%
Simplified47.6%
Taylor expanded in x around 0 40.7%
mul-1-neg40.7%
distribute-lft-neg-out40.7%
*-commutative40.7%
Simplified40.7%
associate-*r*40.8%
distribute-rgt-neg-out40.8%
add-sqr-sqrt24.7%
sqrt-unprod27.8%
sqr-neg27.8%
sqrt-unprod0.7%
add-sqr-sqrt1.4%
*-commutative1.4%
add-sqr-sqrt0.7%
sqrt-unprod27.8%
sqr-neg27.8%
sqrt-unprod24.7%
add-sqr-sqrt40.8%
sqrt-unprod40.9%
*-commutative40.9%
Applied egg-rr40.9%
distribute-rgt-neg-in40.9%
*-commutative40.9%
Simplified40.9%
if 1.25e-62 < x Initial program 99.9%
*-commutative99.9%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 55.8%
*-commutative55.8%
*-commutative55.8%
fma-neg55.8%
associate-*l*55.7%
fma-neg55.7%
*-commutative55.7%
Simplified55.7%
associate-*r*55.8%
*-commutative55.8%
add-sqr-sqrt46.2%
sqrt-unprod58.7%
*-commutative58.7%
associate-*r*58.7%
*-commutative58.7%
associate-*r*58.7%
swap-sqr58.6%
rem-square-sqrt58.8%
*-commutative58.8%
*-commutative58.8%
swap-sqr61.3%
add-sqr-sqrt61.4%
unpow261.4%
Applied egg-rr61.4%
Taylor expanded in x around inf 52.9%
associate-*r*52.9%
unpow252.9%
associate-*l*52.9%
*-commutative52.9%
associate-*l*52.9%
unpow252.9%
Simplified52.9%
Final simplification46.1%
(FPCore (x y z t) :precision binary64 (if (<= t 150000.0) (* (fma 0.5 x (- y)) (sqrt (* z 2.0))) (sqrt (* (* z 2.0) (pow (- (* 0.5 x) y) 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 150000.0) {
tmp = fma(0.5, x, -y) * sqrt((z * 2.0));
} else {
tmp = sqrt(((z * 2.0) * pow(((0.5 * x) - y), 2.0)));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 150000.0) tmp = Float64(fma(0.5, x, Float64(-y)) * sqrt(Float64(z * 2.0))); else tmp = sqrt(Float64(Float64(z * 2.0) * (Float64(Float64(0.5 * x) - y) ^ 2.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 150000.0], N[(N[(0.5 * x + (-y)), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 150000:\\
\;\;\;\;\mathsf{fma}\left(0.5, x, -y\right) \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {\left(0.5 \cdot x - y\right)}^{2}}\\
\end{array}
\end{array}
if t < 1.5e5Initial program 99.3%
*-commutative99.3%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 64.4%
*-commutative64.4%
*-commutative64.4%
fma-neg64.4%
associate-*l*64.4%
fma-neg64.4%
*-commutative64.4%
Simplified64.4%
*-commutative64.4%
associate-*r*64.4%
sub-neg64.4%
distribute-lft-in64.4%
*-commutative64.4%
associate-*l*64.4%
*-commutative64.4%
associate-*l*64.4%
*-commutative64.4%
sqrt-unprod64.5%
*-commutative64.5%
sqrt-unprod64.6%
Applied egg-rr64.6%
*-commutative64.6%
*-commutative64.6%
associate-*r*64.6%
*-commutative64.6%
distribute-rgt-in64.6%
fma-udef64.6%
*-commutative64.6%
*-commutative64.6%
Simplified64.6%
if 1.5e5 < t Initial program 98.5%
*-commutative98.5%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 17.9%
*-commutative17.9%
*-commutative17.9%
fma-neg17.9%
associate-*l*17.9%
fma-neg17.9%
*-commutative17.9%
Simplified17.9%
associate-*r*17.9%
*-commutative17.9%
add-sqr-sqrt6.7%
sqrt-unprod20.8%
*-commutative20.8%
associate-*r*20.8%
*-commutative20.8%
associate-*r*20.8%
swap-sqr20.8%
rem-square-sqrt20.8%
*-commutative20.8%
*-commutative20.8%
swap-sqr23.6%
add-sqr-sqrt23.6%
unpow223.6%
Applied egg-rr23.6%
Taylor expanded in z around 0 23.6%
associate-*r*23.6%
*-commutative23.6%
*-commutative23.6%
*-commutative23.6%
Simplified23.6%
Final simplification54.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.8e+56)
(sqrt (* 2.0 (* z (* y (- y x)))))
(if (or (<= y 1.25e-96) (and (not (<= y 5.3e-20)) (<= y 1.56e+29)))
(* x (sqrt (* 0.5 z)))
(* y (- (sqrt (* z 2.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.8e+56) {
tmp = sqrt((2.0 * (z * (y * (y - x)))));
} else if ((y <= 1.25e-96) || (!(y <= 5.3e-20) && (y <= 1.56e+29))) {
tmp = x * sqrt((0.5 * z));
} else {
tmp = y * -sqrt((z * 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 (y <= (-4.8d+56)) then
tmp = sqrt((2.0d0 * (z * (y * (y - x)))))
else if ((y <= 1.25d-96) .or. (.not. (y <= 5.3d-20)) .and. (y <= 1.56d+29)) then
tmp = x * sqrt((0.5d0 * z))
else
tmp = y * -sqrt((z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.8e+56) {
tmp = Math.sqrt((2.0 * (z * (y * (y - x)))));
} else if ((y <= 1.25e-96) || (!(y <= 5.3e-20) && (y <= 1.56e+29))) {
tmp = x * Math.sqrt((0.5 * z));
} else {
tmp = y * -Math.sqrt((z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.8e+56: tmp = math.sqrt((2.0 * (z * (y * (y - x))))) elif (y <= 1.25e-96) or (not (y <= 5.3e-20) and (y <= 1.56e+29)): tmp = x * math.sqrt((0.5 * z)) else: tmp = y * -math.sqrt((z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.8e+56) tmp = sqrt(Float64(2.0 * Float64(z * Float64(y * Float64(y - x))))); elseif ((y <= 1.25e-96) || (!(y <= 5.3e-20) && (y <= 1.56e+29))) tmp = Float64(x * sqrt(Float64(0.5 * z))); else tmp = Float64(y * Float64(-sqrt(Float64(z * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.8e+56) tmp = sqrt((2.0 * (z * (y * (y - x))))); elseif ((y <= 1.25e-96) || (~((y <= 5.3e-20)) && (y <= 1.56e+29))) tmp = x * sqrt((0.5 * z)); else tmp = y * -sqrt((z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.8e+56], N[Sqrt[N[(2.0 * N[(z * N[(y * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[y, 1.25e-96], And[N[Not[LessEqual[y, 5.3e-20]], $MachinePrecision], LessEqual[y, 1.56e+29]]], N[(x * N[Sqrt[N[(0.5 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+56}:\\
\;\;\;\;\sqrt{2 \cdot \left(z \cdot \left(y \cdot \left(y - x\right)\right)\right)}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-96} \lor \neg \left(y \leq 5.3 \cdot 10^{-20}\right) \land y \leq 1.56 \cdot 10^{+29}:\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-\sqrt{z \cdot 2}\right)\\
\end{array}
\end{array}
if y < -4.80000000000000027e56Initial program 99.9%
*-commutative99.9%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 51.0%
*-commutative51.0%
*-commutative51.0%
fma-neg51.0%
associate-*l*50.9%
fma-neg50.9%
*-commutative50.9%
Simplified50.9%
associate-*r*51.0%
*-commutative51.0%
add-sqr-sqrt47.0%
sqrt-unprod57.6%
*-commutative57.6%
associate-*r*57.6%
*-commutative57.6%
associate-*r*57.6%
swap-sqr57.6%
rem-square-sqrt57.7%
*-commutative57.7%
*-commutative57.7%
swap-sqr63.0%
add-sqr-sqrt63.0%
unpow263.0%
Applied egg-rr63.0%
Taylor expanded in x around 0 59.4%
+-commutative59.4%
unpow259.4%
associate-*r*59.4%
distribute-rgt-out61.2%
mul-1-neg61.2%
Simplified61.2%
if -4.80000000000000027e56 < y < 1.24999999999999999e-96 or 5.3000000000000002e-20 < y < 1.5599999999999999e29Initial program 98.2%
*-commutative98.2%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 48.8%
*-commutative48.8%
*-commutative48.8%
fma-neg48.8%
associate-*l*48.8%
fma-neg48.8%
*-commutative48.8%
Simplified48.8%
associate-*r*48.8%
*-commutative48.8%
add-sqr-sqrt23.1%
sqrt-unprod24.4%
*-commutative24.4%
associate-*r*24.4%
*-commutative24.4%
associate-*r*24.4%
swap-sqr24.3%
rem-square-sqrt24.5%
*-commutative24.5%
*-commutative24.5%
swap-sqr22.8%
add-sqr-sqrt22.9%
unpow222.9%
Applied egg-rr22.9%
Taylor expanded in x around inf 20.3%
associate-*r*20.3%
unpow220.3%
associate-*l*20.3%
*-commutative20.3%
associate-*l*20.3%
unpow220.3%
Simplified20.3%
associate-*r*20.3%
sqrt-prod18.7%
*-commutative18.7%
unpow218.7%
sqrt-prod19.7%
add-sqr-sqrt43.3%
Applied egg-rr43.3%
if 1.24999999999999999e-96 < y < 5.3000000000000002e-20 or 1.5599999999999999e29 < y Initial program 99.8%
*-commutative99.8%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 58.7%
*-commutative58.7%
*-commutative58.7%
fma-neg58.7%
associate-*l*58.6%
fma-neg58.6%
*-commutative58.6%
Simplified58.6%
Taylor expanded in x around 0 48.1%
mul-1-neg48.1%
distribute-lft-neg-out48.1%
*-commutative48.1%
Simplified48.1%
associate-*r*48.1%
distribute-rgt-neg-out48.1%
add-sqr-sqrt48.1%
sqrt-unprod54.6%
sqr-neg54.6%
sqrt-unprod0.0%
add-sqr-sqrt1.1%
*-commutative1.1%
add-sqr-sqrt0.0%
sqrt-unprod54.6%
sqr-neg54.6%
sqrt-unprod48.1%
add-sqr-sqrt48.1%
sqrt-unprod48.2%
*-commutative48.2%
Applied egg-rr48.2%
distribute-rgt-neg-in48.2%
*-commutative48.2%
Simplified48.2%
Final simplification48.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -10000000000000.0) (not (<= x 3.7e+146))) (* x (sqrt (* 0.5 z))) (* y (- (sqrt (* z 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -10000000000000.0) || !(x <= 3.7e+146)) {
tmp = x * sqrt((0.5 * z));
} else {
tmp = y * -sqrt((z * 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 ((x <= (-10000000000000.0d0)) .or. (.not. (x <= 3.7d+146))) then
tmp = x * sqrt((0.5d0 * z))
else
tmp = y * -sqrt((z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -10000000000000.0) || !(x <= 3.7e+146)) {
tmp = x * Math.sqrt((0.5 * z));
} else {
tmp = y * -Math.sqrt((z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -10000000000000.0) or not (x <= 3.7e+146): tmp = x * math.sqrt((0.5 * z)) else: tmp = y * -math.sqrt((z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -10000000000000.0) || !(x <= 3.7e+146)) tmp = Float64(x * sqrt(Float64(0.5 * z))); else tmp = Float64(y * Float64(-sqrt(Float64(z * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -10000000000000.0) || ~((x <= 3.7e+146))) tmp = x * sqrt((0.5 * z)); else tmp = y * -sqrt((z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -10000000000000.0], N[Not[LessEqual[x, 3.7e+146]], $MachinePrecision]], N[(x * N[Sqrt[N[(0.5 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -10000000000000 \lor \neg \left(x \leq 3.7 \cdot 10^{+146}\right):\\
\;\;\;\;x \cdot \sqrt{0.5 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-\sqrt{z \cdot 2}\right)\\
\end{array}
\end{array}
if x < -1e13 or 3.70000000000000004e146 < x Initial program 99.9%
*-commutative99.9%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 58.7%
*-commutative58.7%
*-commutative58.7%
fma-neg58.7%
associate-*l*58.6%
fma-neg58.6%
*-commutative58.6%
Simplified58.6%
associate-*r*58.7%
*-commutative58.7%
add-sqr-sqrt19.4%
sqrt-unprod24.2%
*-commutative24.2%
associate-*r*24.2%
*-commutative24.2%
associate-*r*24.2%
swap-sqr24.2%
rem-square-sqrt24.2%
*-commutative24.2%
*-commutative24.2%
swap-sqr25.1%
add-sqr-sqrt25.1%
unpow225.1%
Applied egg-rr25.1%
Taylor expanded in x around inf 24.2%
associate-*r*24.2%
unpow224.2%
associate-*l*24.2%
*-commutative24.2%
associate-*l*24.2%
unpow224.2%
Simplified24.2%
associate-*r*24.2%
sqrt-prod25.1%
*-commutative25.1%
unpow225.1%
sqrt-prod19.2%
add-sqr-sqrt50.6%
Applied egg-rr50.6%
if -1e13 < x < 3.70000000000000004e146Initial program 98.5%
*-commutative98.5%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 48.2%
*-commutative48.2%
*-commutative48.2%
fma-neg48.2%
associate-*l*48.2%
fma-neg48.2%
*-commutative48.2%
Simplified48.2%
Taylor expanded in x around 0 37.2%
mul-1-neg37.2%
distribute-lft-neg-out37.2%
*-commutative37.2%
Simplified37.2%
associate-*r*37.2%
distribute-rgt-neg-out37.2%
add-sqr-sqrt21.6%
sqrt-unprod24.1%
sqr-neg24.1%
sqrt-unprod0.6%
add-sqr-sqrt1.6%
*-commutative1.6%
add-sqr-sqrt0.6%
sqrt-unprod24.1%
sqr-neg24.1%
sqrt-unprod21.6%
add-sqr-sqrt37.2%
sqrt-unprod37.4%
*-commutative37.4%
Applied egg-rr37.4%
distribute-rgt-neg-in37.4%
*-commutative37.4%
Simplified37.4%
Final simplification42.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.1%
*-commutative99.1%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 52.4%
*-commutative52.4%
*-commutative52.4%
fma-neg52.4%
associate-*l*52.4%
fma-neg52.4%
*-commutative52.4%
Simplified52.4%
Taylor expanded in x around 0 27.0%
mul-1-neg27.0%
distribute-lft-neg-out27.0%
*-commutative27.0%
Simplified27.0%
expm1-log1p-u13.6%
expm1-udef9.4%
associate-*r*9.4%
*-commutative9.4%
add-sqr-sqrt8.8%
sqrt-unprod13.0%
sqr-neg13.0%
sqrt-unprod0.9%
add-sqr-sqrt1.4%
sqrt-unprod1.4%
*-commutative1.4%
Applied egg-rr1.4%
expm1-def1.4%
expm1-log1p1.7%
*-commutative1.7%
Simplified1.7%
Final simplification1.7%
(FPCore (x y z t) :precision binary64 (* x (sqrt (* 0.5 z))))
double code(double x, double y, double z, double t) {
return x * sqrt((0.5 * z));
}
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 * sqrt((0.5d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return x * Math.sqrt((0.5 * z));
}
def code(x, y, z, t): return x * math.sqrt((0.5 * z))
function code(x, y, z, t) return Float64(x * sqrt(Float64(0.5 * z))) end
function tmp = code(x, y, z, t) tmp = x * sqrt((0.5 * z)); end
code[x_, y_, z_, t_] := N[(x * N[Sqrt[N[(0.5 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \sqrt{0.5 \cdot z}
\end{array}
Initial program 99.1%
*-commutative99.1%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
Taylor expanded in t around 0 52.4%
*-commutative52.4%
*-commutative52.4%
fma-neg52.4%
associate-*l*52.4%
fma-neg52.4%
*-commutative52.4%
Simplified52.4%
associate-*r*52.4%
*-commutative52.4%
add-sqr-sqrt22.1%
sqrt-unprod27.0%
*-commutative27.0%
associate-*r*27.0%
*-commutative27.0%
associate-*r*27.0%
swap-sqr27.0%
rem-square-sqrt27.1%
*-commutative27.1%
*-commutative27.1%
swap-sqr27.4%
add-sqr-sqrt27.4%
unpow227.4%
Applied egg-rr27.4%
Taylor expanded in x around inf 17.9%
associate-*r*17.9%
unpow217.9%
associate-*l*17.9%
*-commutative17.9%
associate-*l*17.9%
unpow217.9%
Simplified17.9%
associate-*r*17.9%
sqrt-prod15.6%
*-commutative15.6%
unpow215.6%
sqrt-prod13.1%
add-sqr-sqrt27.6%
Applied egg-rr27.6%
Final simplification27.6%
(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 2024026
(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))))