
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= z -330000.0)
(+
x
(/
y
(-
(+ 14.431876219268936 (/ 101.23733352003822 (pow z 2.0)))
(/ 15.646356830292042 z))))
(if (<= z 9e-9)
(+ x (/ y (+ 12.000000000000014 (* z 0.39999999996247915))))
(+ x (/ 1.0 (/ 14.431876219268936 y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y / ((14.431876219268936 + (101.23733352003822 / pow(z, 2.0))) - (15.646356830292042 / z)));
} else if (z <= 9e-9) {
tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915)));
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-330000.0d0)) then
tmp = x + (y / ((14.431876219268936d0 + (101.23733352003822d0 / (z ** 2.0d0))) - (15.646356830292042d0 / z)))
else if (z <= 9d-9) then
tmp = x + (y / (12.000000000000014d0 + (z * 0.39999999996247915d0)))
else
tmp = x + (1.0d0 / (14.431876219268936d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y / ((14.431876219268936 + (101.23733352003822 / Math.pow(z, 2.0))) - (15.646356830292042 / z)));
} else if (z <= 9e-9) {
tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915)));
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -330000.0: tmp = x + (y / ((14.431876219268936 + (101.23733352003822 / math.pow(z, 2.0))) - (15.646356830292042 / z))) elif z <= 9e-9: tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915))) else: tmp = x + (1.0 / (14.431876219268936 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -330000.0) tmp = Float64(x + Float64(y / Float64(Float64(14.431876219268936 + Float64(101.23733352003822 / (z ^ 2.0))) - Float64(15.646356830292042 / z)))); elseif (z <= 9e-9) tmp = Float64(x + Float64(y / Float64(12.000000000000014 + Float64(z * 0.39999999996247915)))); else tmp = Float64(x + Float64(1.0 / Float64(14.431876219268936 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -330000.0) tmp = x + (y / ((14.431876219268936 + (101.23733352003822 / (z ^ 2.0))) - (15.646356830292042 / z))); elseif (z <= 9e-9) tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915))); else tmp = x + (1.0 / (14.431876219268936 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -330000.0], N[(x + N[(y / N[(N[(14.431876219268936 + N[(101.23733352003822 / N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(15.646356830292042 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-9], N[(x + N[(y / N[(12.000000000000014 + N[(z * 0.39999999996247915), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(14.431876219268936 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -330000:\\
\;\;\;\;x + \frac{y}{\left(14.431876219268936 + \frac{101.23733352003822}{{z}^{2}}\right) - \frac{15.646356830292042}{z}}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-9}:\\
\;\;\;\;x + \frac{y}{12.000000000000014 + z \cdot 0.39999999996247915}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{14.431876219268936}{y}}\\
\end{array}
\end{array}
if z < -3.3e5Initial program 47.3%
associate-/l*57.5%
fma-def57.5%
fma-def57.5%
fma-def57.5%
Simplified57.5%
Taylor expanded in z around inf 100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
if -3.3e5 < z < 8.99999999999999953e-9Initial program 99.7%
associate-/l*99.3%
fma-def99.3%
fma-def99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in z around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 8.99999999999999953e-9 < z Initial program 46.8%
+-commutative46.8%
remove-double-neg46.8%
unsub-neg46.8%
*-commutative46.8%
associate-*l/51.5%
*-commutative51.5%
fma-neg51.5%
*-commutative51.5%
fma-def51.5%
fma-def51.5%
*-commutative51.5%
fma-def51.5%
remove-double-neg51.5%
Simplified51.5%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
metadata-eval99.7%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
1e+306)
(fma
y
(/
(fma z (fma z 0.0692910599291889 0.4917317610505968) 0.279195317918525)
(fma z (+ z 6.012459259764103) 3.350343815022304))
x)
(+ x (/ y 14.431876219268936))))
double code(double x, double y, double z) {
double tmp;
if (((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) <= 1e+306) {
tmp = fma(y, (fma(z, fma(z, 0.0692910599291889, 0.4917317610505968), 0.279195317918525) / fma(z, (z + 6.012459259764103), 3.350343815022304)), x);
} else {
tmp = x + (y / 14.431876219268936);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) <= 1e+306) tmp = fma(y, Float64(fma(z, fma(z, 0.0692910599291889, 0.4917317610505968), 0.279195317918525) / fma(z, Float64(z + 6.012459259764103), 3.350343815022304)), x); else tmp = Float64(x + Float64(y / 14.431876219268936)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision], 1e+306], N[(y * N[(N[(z * N[(z * 0.0692910599291889 + 0.4917317610505968), $MachinePrecision] + 0.279195317918525), $MachinePrecision] / N[(z * N[(z + 6.012459259764103), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} \leq 10^{+306}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (+.f64 (*.f64 (+.f64 z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000)) < 1.00000000000000002e306Initial program 97.7%
+-commutative97.7%
remove-double-neg97.7%
unsub-neg97.7%
*-commutative97.7%
associate-*l/99.8%
*-commutative99.8%
fma-neg99.8%
*-commutative99.8%
fma-def99.8%
fma-def99.8%
*-commutative99.8%
fma-def99.8%
remove-double-neg99.8%
Simplified99.8%
if 1.00000000000000002e306 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (+.f64 (*.f64 (+.f64 z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000)) Initial program 0.4%
associate-/l*9.5%
fma-def9.5%
fma-def9.5%
fma-def9.5%
Simplified9.5%
Taylor expanded in z around inf 100.0%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
1e+306)
(+
x
(/
y
(/
(fma (+ z 6.012459259764103) z 3.350343815022304)
(fma
(fma z 0.0692910599291889 0.4917317610505968)
z
0.279195317918525))))
(+ x (/ y 14.431876219268936))))
double code(double x, double y, double z) {
double tmp;
if (((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) <= 1e+306) {
tmp = x + (y / (fma((z + 6.012459259764103), z, 3.350343815022304) / fma(fma(z, 0.0692910599291889, 0.4917317610505968), z, 0.279195317918525)));
} else {
tmp = x + (y / 14.431876219268936);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) <= 1e+306) tmp = Float64(x + Float64(y / Float64(fma(Float64(z + 6.012459259764103), z, 3.350343815022304) / fma(fma(z, 0.0692910599291889, 0.4917317610505968), z, 0.279195317918525)))); else tmp = Float64(x + Float64(y / 14.431876219268936)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision], 1e+306], N[(x + N[(y / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z + 3.350343815022304), $MachinePrecision] / N[(N[(z * 0.0692910599291889 + 0.4917317610505968), $MachinePrecision] * z + 0.279195317918525), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} \leq 10^{+306}:\\
\;\;\;\;x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (+.f64 (*.f64 (+.f64 z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000)) < 1.00000000000000002e306Initial program 97.7%
associate-/l*99.4%
fma-def99.4%
fma-def99.4%
fma-def99.4%
Simplified99.4%
if 1.00000000000000002e306 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (+.f64 (*.f64 (+.f64 z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000)) Initial program 0.4%
associate-/l*9.5%
fma-def9.5%
fma-def9.5%
fma-def9.5%
Simplified9.5%
Taylor expanded in z around inf 100.0%
Final simplification99.5%
(FPCore (x y z)
:precision binary64
(if (<= z -330000.0)
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z))))
(if (<= z 9e-9)
(+ x (* y (+ 0.08333333333333323 (* z -0.00277777777751721))))
(+ x (/ 1.0 (/ 14.431876219268936 y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 9e-9) {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-330000.0d0)) then
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
else if (z <= 9d-9) then
tmp = x + (y * (0.08333333333333323d0 + (z * (-0.00277777777751721d0))))
else
tmp = x + (1.0d0 / (14.431876219268936d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 9e-9) {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -330000.0: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) elif z <= 9e-9: tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))) else: tmp = x + (1.0 / (14.431876219268936 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -330000.0) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); elseif (z <= 9e-9) tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(z * -0.00277777777751721)))); else tmp = Float64(x + Float64(1.0 / Float64(14.431876219268936 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -330000.0) tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); elseif (z <= 9e-9) tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))); else tmp = x + (1.0 / (14.431876219268936 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -330000.0], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-9], N[(x + N[(y * N[(0.08333333333333323 + N[(z * -0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(14.431876219268936 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -330000:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-9}:\\
\;\;\;\;x + y \cdot \left(0.08333333333333323 + z \cdot -0.00277777777751721\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{14.431876219268936}{y}}\\
\end{array}
\end{array}
if z < -3.3e5Initial program 47.3%
associate-/l*57.5%
fma-def57.5%
fma-def57.5%
fma-def57.5%
Simplified57.5%
Taylor expanded in z around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 99.3%
*-lft-identity99.3%
associate-*l/99.3%
associate-*l*99.3%
distribute-rgt-in99.3%
associate-*r/99.3%
metadata-eval99.3%
Simplified99.3%
if -3.3e5 < z < 8.99999999999999953e-9Initial program 99.7%
+-commutative99.7%
remove-double-neg99.7%
unsub-neg99.7%
*-commutative99.7%
associate-*l/99.9%
*-commutative99.9%
fma-neg99.9%
*-commutative99.9%
fma-def99.9%
fma-def99.9%
*-commutative99.9%
fma-def99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 99.9%
if 8.99999999999999953e-9 < z Initial program 46.8%
+-commutative46.8%
remove-double-neg46.8%
unsub-neg46.8%
*-commutative46.8%
associate-*l/51.5%
*-commutative51.5%
fma-neg51.5%
*-commutative51.5%
fma-def51.5%
fma-def51.5%
*-commutative51.5%
fma-def51.5%
remove-double-neg51.5%
Simplified51.5%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
metadata-eval99.7%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= z -330000.0)
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z))))
(if (<= z 9e-9)
(+ x (/ y (+ 12.000000000000014 (* z 0.39999999996247915))))
(+ x (/ 1.0 (/ 14.431876219268936 y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 9e-9) {
tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915)));
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-330000.0d0)) then
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
else if (z <= 9d-9) then
tmp = x + (y / (12.000000000000014d0 + (z * 0.39999999996247915d0)))
else
tmp = x + (1.0d0 / (14.431876219268936d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 9e-9) {
tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915)));
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -330000.0: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) elif z <= 9e-9: tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915))) else: tmp = x + (1.0 / (14.431876219268936 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -330000.0) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); elseif (z <= 9e-9) tmp = Float64(x + Float64(y / Float64(12.000000000000014 + Float64(z * 0.39999999996247915)))); else tmp = Float64(x + Float64(1.0 / Float64(14.431876219268936 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -330000.0) tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); elseif (z <= 9e-9) tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915))); else tmp = x + (1.0 / (14.431876219268936 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -330000.0], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-9], N[(x + N[(y / N[(12.000000000000014 + N[(z * 0.39999999996247915), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(14.431876219268936 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -330000:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-9}:\\
\;\;\;\;x + \frac{y}{12.000000000000014 + z \cdot 0.39999999996247915}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{14.431876219268936}{y}}\\
\end{array}
\end{array}
if z < -3.3e5Initial program 47.3%
associate-/l*57.5%
fma-def57.5%
fma-def57.5%
fma-def57.5%
Simplified57.5%
Taylor expanded in z around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 99.3%
*-lft-identity99.3%
associate-*l/99.3%
associate-*l*99.3%
distribute-rgt-in99.3%
associate-*r/99.3%
metadata-eval99.3%
Simplified99.3%
if -3.3e5 < z < 8.99999999999999953e-9Initial program 99.7%
associate-/l*99.3%
fma-def99.3%
fma-def99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in z around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 8.99999999999999953e-9 < z Initial program 46.8%
+-commutative46.8%
remove-double-neg46.8%
unsub-neg46.8%
*-commutative46.8%
associate-*l/51.5%
*-commutative51.5%
fma-neg51.5%
*-commutative51.5%
fma-def51.5%
fma-def51.5%
*-commutative51.5%
fma-def51.5%
remove-double-neg51.5%
Simplified51.5%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
metadata-eval99.7%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(if (<= z -330000.0)
(+ x (/ y (- 14.431876219268936 (/ 15.646356830292042 z))))
(if (<= z 9e-9)
(+ x (/ y (+ 12.000000000000014 (* z 0.39999999996247915))))
(+ x (/ 1.0 (/ 14.431876219268936 y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y / (14.431876219268936 - (15.646356830292042 / z)));
} else if (z <= 9e-9) {
tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915)));
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-330000.0d0)) then
tmp = x + (y / (14.431876219268936d0 - (15.646356830292042d0 / z)))
else if (z <= 9d-9) then
tmp = x + (y / (12.000000000000014d0 + (z * 0.39999999996247915d0)))
else
tmp = x + (1.0d0 / (14.431876219268936d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y / (14.431876219268936 - (15.646356830292042 / z)));
} else if (z <= 9e-9) {
tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915)));
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -330000.0: tmp = x + (y / (14.431876219268936 - (15.646356830292042 / z))) elif z <= 9e-9: tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915))) else: tmp = x + (1.0 / (14.431876219268936 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -330000.0) tmp = Float64(x + Float64(y / Float64(14.431876219268936 - Float64(15.646356830292042 / z)))); elseif (z <= 9e-9) tmp = Float64(x + Float64(y / Float64(12.000000000000014 + Float64(z * 0.39999999996247915)))); else tmp = Float64(x + Float64(1.0 / Float64(14.431876219268936 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -330000.0) tmp = x + (y / (14.431876219268936 - (15.646356830292042 / z))); elseif (z <= 9e-9) tmp = x + (y / (12.000000000000014 + (z * 0.39999999996247915))); else tmp = x + (1.0 / (14.431876219268936 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -330000.0], N[(x + N[(y / N[(14.431876219268936 - N[(15.646356830292042 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-9], N[(x + N[(y / N[(12.000000000000014 + N[(z * 0.39999999996247915), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(14.431876219268936 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -330000:\\
\;\;\;\;x + \frac{y}{14.431876219268936 - \frac{15.646356830292042}{z}}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-9}:\\
\;\;\;\;x + \frac{y}{12.000000000000014 + z \cdot 0.39999999996247915}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{14.431876219268936}{y}}\\
\end{array}
\end{array}
if z < -3.3e5Initial program 47.3%
associate-/l*57.5%
fma-def57.5%
fma-def57.5%
fma-def57.5%
Simplified57.5%
Taylor expanded in z around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
if -3.3e5 < z < 8.99999999999999953e-9Initial program 99.7%
associate-/l*99.3%
fma-def99.3%
fma-def99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in z around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 8.99999999999999953e-9 < z Initial program 46.8%
+-commutative46.8%
remove-double-neg46.8%
unsub-neg46.8%
*-commutative46.8%
associate-*l/51.5%
*-commutative51.5%
fma-neg51.5%
*-commutative51.5%
fma-def51.5%
fma-def51.5%
*-commutative51.5%
fma-def51.5%
remove-double-neg51.5%
Simplified51.5%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
metadata-eval99.7%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= z -330000.0)
(+ x (/ y 14.431876219268936))
(if (<= z 9e-9)
(+ x (/ y 12.000000000000014))
(+ x (/ 1.0 (/ 14.431876219268936 y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y / 14.431876219268936);
} else if (z <= 9e-9) {
tmp = x + (y / 12.000000000000014);
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-330000.0d0)) then
tmp = x + (y / 14.431876219268936d0)
else if (z <= 9d-9) then
tmp = x + (y / 12.000000000000014d0)
else
tmp = x + (1.0d0 / (14.431876219268936d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y / 14.431876219268936);
} else if (z <= 9e-9) {
tmp = x + (y / 12.000000000000014);
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -330000.0: tmp = x + (y / 14.431876219268936) elif z <= 9e-9: tmp = x + (y / 12.000000000000014) else: tmp = x + (1.0 / (14.431876219268936 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -330000.0) tmp = Float64(x + Float64(y / 14.431876219268936)); elseif (z <= 9e-9) tmp = Float64(x + Float64(y / 12.000000000000014)); else tmp = Float64(x + Float64(1.0 / Float64(14.431876219268936 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -330000.0) tmp = x + (y / 14.431876219268936); elseif (z <= 9e-9) tmp = x + (y / 12.000000000000014); else tmp = x + (1.0 / (14.431876219268936 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -330000.0], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-9], N[(x + N[(y / 12.000000000000014), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(14.431876219268936 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -330000:\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-9}:\\
\;\;\;\;x + \frac{y}{12.000000000000014}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{14.431876219268936}{y}}\\
\end{array}
\end{array}
if z < -3.3e5Initial program 47.3%
associate-/l*57.5%
fma-def57.5%
fma-def57.5%
fma-def57.5%
Simplified57.5%
Taylor expanded in z around inf 99.2%
if -3.3e5 < z < 8.99999999999999953e-9Initial program 99.7%
associate-/l*99.3%
fma-def99.3%
fma-def99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in z around 0 99.1%
if 8.99999999999999953e-9 < z Initial program 46.8%
+-commutative46.8%
remove-double-neg46.8%
unsub-neg46.8%
*-commutative46.8%
associate-*l/51.5%
*-commutative51.5%
fma-neg51.5%
*-commutative51.5%
fma-def51.5%
fma-def51.5%
*-commutative51.5%
fma-def51.5%
remove-double-neg51.5%
Simplified51.5%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
metadata-eval99.7%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(if (<= z -330000.0)
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z))))
(if (<= z 9e-9)
(+ x (/ y 12.000000000000014))
(+ x (/ 1.0 (/ 14.431876219268936 y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 9e-9) {
tmp = x + (y / 12.000000000000014);
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-330000.0d0)) then
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
else if (z <= 9d-9) then
tmp = x + (y / 12.000000000000014d0)
else
tmp = x + (1.0d0 / (14.431876219268936d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -330000.0) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 9e-9) {
tmp = x + (y / 12.000000000000014);
} else {
tmp = x + (1.0 / (14.431876219268936 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -330000.0: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) elif z <= 9e-9: tmp = x + (y / 12.000000000000014) else: tmp = x + (1.0 / (14.431876219268936 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -330000.0) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); elseif (z <= 9e-9) tmp = Float64(x + Float64(y / 12.000000000000014)); else tmp = Float64(x + Float64(1.0 / Float64(14.431876219268936 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -330000.0) tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); elseif (z <= 9e-9) tmp = x + (y / 12.000000000000014); else tmp = x + (1.0 / (14.431876219268936 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -330000.0], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-9], N[(x + N[(y / 12.000000000000014), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(14.431876219268936 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -330000:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-9}:\\
\;\;\;\;x + \frac{y}{12.000000000000014}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{14.431876219268936}{y}}\\
\end{array}
\end{array}
if z < -3.3e5Initial program 47.3%
associate-/l*57.5%
fma-def57.5%
fma-def57.5%
fma-def57.5%
Simplified57.5%
Taylor expanded in z around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 99.3%
*-lft-identity99.3%
associate-*l/99.3%
associate-*l*99.3%
distribute-rgt-in99.3%
associate-*r/99.3%
metadata-eval99.3%
Simplified99.3%
if -3.3e5 < z < 8.99999999999999953e-9Initial program 99.7%
associate-/l*99.3%
fma-def99.3%
fma-def99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in z around 0 99.1%
if 8.99999999999999953e-9 < z Initial program 46.8%
+-commutative46.8%
remove-double-neg46.8%
unsub-neg46.8%
*-commutative46.8%
associate-*l/51.5%
*-commutative51.5%
fma-neg51.5%
*-commutative51.5%
fma-def51.5%
fma-def51.5%
*-commutative51.5%
fma-def51.5%
remove-double-neg51.5%
Simplified51.5%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
metadata-eval99.7%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
Final simplification99.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -330000.0) (not (<= z 9e-9))) (+ x (/ y 14.431876219268936)) (+ x (/ y 12.000000000000014))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -330000.0) || !(z <= 9e-9)) {
tmp = x + (y / 14.431876219268936);
} else {
tmp = x + (y / 12.000000000000014);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-330000.0d0)) .or. (.not. (z <= 9d-9))) then
tmp = x + (y / 14.431876219268936d0)
else
tmp = x + (y / 12.000000000000014d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -330000.0) || !(z <= 9e-9)) {
tmp = x + (y / 14.431876219268936);
} else {
tmp = x + (y / 12.000000000000014);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -330000.0) or not (z <= 9e-9): tmp = x + (y / 14.431876219268936) else: tmp = x + (y / 12.000000000000014) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -330000.0) || !(z <= 9e-9)) tmp = Float64(x + Float64(y / 14.431876219268936)); else tmp = Float64(x + Float64(y / 12.000000000000014)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -330000.0) || ~((z <= 9e-9))) tmp = x + (y / 14.431876219268936); else tmp = x + (y / 12.000000000000014); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -330000.0], N[Not[LessEqual[z, 9e-9]], $MachinePrecision]], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / 12.000000000000014), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -330000 \lor \neg \left(z \leq 9 \cdot 10^{-9}\right):\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{12.000000000000014}\\
\end{array}
\end{array}
if z < -3.3e5 or 8.99999999999999953e-9 < z Initial program 47.0%
associate-/l*54.5%
fma-def54.5%
fma-def54.5%
fma-def54.5%
Simplified54.5%
Taylor expanded in z around inf 99.5%
if -3.3e5 < z < 8.99999999999999953e-9Initial program 99.7%
associate-/l*99.3%
fma-def99.3%
fma-def99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in z around 0 99.1%
Final simplification99.3%
(FPCore (x y z) :precision binary64 (if (<= x -3.1e-126) x (if (<= x 1.4e-98) (* y 0.0692910599291889) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e-126) {
tmp = x;
} else if (x <= 1.4e-98) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.1d-126)) then
tmp = x
else if (x <= 1.4d-98) then
tmp = y * 0.0692910599291889d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e-126) {
tmp = x;
} else if (x <= 1.4e-98) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.1e-126: tmp = x elif x <= 1.4e-98: tmp = y * 0.0692910599291889 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.1e-126) tmp = x; elseif (x <= 1.4e-98) tmp = Float64(y * 0.0692910599291889); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.1e-126) tmp = x; elseif (x <= 1.4e-98) tmp = y * 0.0692910599291889; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.1e-126], x, If[LessEqual[x, 1.4e-98], N[(y * 0.0692910599291889), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-126}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-98}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.1000000000000001e-126 or 1.3999999999999999e-98 < x Initial program 74.0%
+-commutative74.0%
remove-double-neg74.0%
unsub-neg74.0%
*-commutative74.0%
associate-*l/76.9%
*-commutative76.9%
fma-neg76.9%
*-commutative76.9%
fma-def76.9%
fma-def76.9%
*-commutative76.9%
fma-def76.9%
remove-double-neg76.9%
Simplified76.9%
Taylor expanded in y around 0 71.6%
if -3.1000000000000001e-126 < x < 1.3999999999999999e-98Initial program 73.4%
+-commutative73.4%
remove-double-neg73.4%
unsub-neg73.4%
*-commutative73.4%
associate-*l/78.9%
*-commutative78.9%
fma-neg78.9%
*-commutative78.9%
fma-def78.9%
fma-def78.9%
*-commutative78.9%
fma-def78.9%
remove-double-neg78.9%
Simplified78.9%
Taylor expanded in z around inf 63.8%
+-commutative63.8%
*-commutative63.8%
Simplified63.8%
Taylor expanded in y around inf 48.5%
*-commutative48.5%
Simplified48.5%
Final simplification63.7%
(FPCore (x y z) :precision binary64 (if (<= x -1.55e-119) x (if (<= x 1.32e-98) (/ y 14.431876219268936) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.55e-119) {
tmp = x;
} else if (x <= 1.32e-98) {
tmp = y / 14.431876219268936;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.55d-119)) then
tmp = x
else if (x <= 1.32d-98) then
tmp = y / 14.431876219268936d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.55e-119) {
tmp = x;
} else if (x <= 1.32e-98) {
tmp = y / 14.431876219268936;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.55e-119: tmp = x elif x <= 1.32e-98: tmp = y / 14.431876219268936 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.55e-119) tmp = x; elseif (x <= 1.32e-98) tmp = Float64(y / 14.431876219268936); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.55e-119) tmp = x; elseif (x <= 1.32e-98) tmp = y / 14.431876219268936; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.55e-119], x, If[LessEqual[x, 1.32e-98], N[(y / 14.431876219268936), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-119}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{-98}:\\
\;\;\;\;\frac{y}{14.431876219268936}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.54999999999999989e-119 or 1.31999999999999995e-98 < x Initial program 74.0%
+-commutative74.0%
remove-double-neg74.0%
unsub-neg74.0%
*-commutative74.0%
associate-*l/76.9%
*-commutative76.9%
fma-neg76.9%
*-commutative76.9%
fma-def76.9%
fma-def76.9%
*-commutative76.9%
fma-def76.9%
remove-double-neg76.9%
Simplified76.9%
Taylor expanded in y around 0 71.6%
if -1.54999999999999989e-119 < x < 1.31999999999999995e-98Initial program 73.4%
+-commutative73.4%
remove-double-neg73.4%
unsub-neg73.4%
*-commutative73.4%
associate-*l/78.9%
*-commutative78.9%
fma-neg78.9%
*-commutative78.9%
fma-def78.9%
fma-def78.9%
*-commutative78.9%
fma-def78.9%
remove-double-neg78.9%
Simplified78.9%
Taylor expanded in z around inf 63.8%
+-commutative63.8%
*-commutative63.8%
Simplified63.8%
Taylor expanded in y around inf 48.5%
*-commutative48.5%
Simplified48.5%
metadata-eval48.5%
div-inv48.8%
Applied egg-rr48.8%
Final simplification63.8%
(FPCore (x y z) :precision binary64 (+ x (/ y 12.000000000000014)))
double code(double x, double y, double z) {
return x + (y / 12.000000000000014);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (y / 12.000000000000014d0)
end function
public static double code(double x, double y, double z) {
return x + (y / 12.000000000000014);
}
def code(x, y, z): return x + (y / 12.000000000000014)
function code(x, y, z) return Float64(x + Float64(y / 12.000000000000014)) end
function tmp = code(x, y, z) tmp = x + (y / 12.000000000000014); end
code[x_, y_, z_] := N[(x + N[(y / 12.000000000000014), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{12.000000000000014}
\end{array}
Initial program 73.8%
associate-/l*77.3%
fma-def77.3%
fma-def77.3%
fma-def77.3%
Simplified77.3%
Taylor expanded in z around 0 82.6%
Final simplification82.6%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 73.8%
+-commutative73.8%
remove-double-neg73.8%
unsub-neg73.8%
*-commutative73.8%
associate-*l/77.6%
*-commutative77.6%
fma-neg77.6%
*-commutative77.6%
fma-def77.6%
fma-def77.6%
*-commutative77.6%
fma-def77.6%
remove-double-neg77.6%
Simplified77.6%
Taylor expanded in y around 0 53.4%
Final simplification53.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(-
(* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y)
(- (/ (* 0.40462203869992125 y) (* z z)) x))))
(if (< z -8120153.652456675)
t_0
(if (< z 6.576118972787377e+20)
(+
x
(*
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(/ 1.0 (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
t_0))))
double code(double x, double y, double z) {
double t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x);
double tmp;
if (z < -8120153.652456675) {
tmp = t_0;
} else if (z < 6.576118972787377e+20) {
tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((0.07512208616047561d0 / z) + 0.0692910599291889d0) * y) - (((0.40462203869992125d0 * y) / (z * z)) - x)
if (z < (-8120153.652456675d0)) then
tmp = t_0
else if (z < 6.576118972787377d+20) then
tmp = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) * (1.0d0 / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x);
double tmp;
if (z < -8120153.652456675) {
tmp = t_0;
} else if (z < 6.576118972787377e+20) {
tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x) tmp = 0 if z < -8120153.652456675: tmp = t_0 elif z < 6.576118972787377e+20: tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304))) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(0.07512208616047561 / z) + 0.0692910599291889) * y) - Float64(Float64(Float64(0.40462203869992125 * y) / Float64(z * z)) - x)) tmp = 0.0 if (z < -8120153.652456675) tmp = t_0; elseif (z < 6.576118972787377e+20) tmp = Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * Float64(1.0 / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x); tmp = 0.0; if (z < -8120153.652456675) tmp = t_0; elseif (z < 6.576118972787377e+20) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(0.07512208616047561 / z), $MachinePrecision] + 0.0692910599291889), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(0.40462203869992125 * y), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -8120153.652456675], t$95$0, If[Less[z, 6.576118972787377e+20], N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{0.07512208616047561}{z} + 0.0692910599291889\right) \cdot y - \left(\frac{0.40462203869992125 \cdot y}{z \cdot z} - x\right)\\
\mathbf{if}\;z < -8120153.652456675:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z < 6.576118972787377 \cdot 10^{+20}:\\
\;\;\;\;x + \left(y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)\right) \cdot \frac{1}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2024024
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(if (< z -8120153.652456675) (- (* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y) (- (/ (* 0.40462203869992125 y) (* z z)) x)) (if (< z 6.576118972787377e+20) (+ x (* (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (/ 1.0 (+ (* (+ z 6.012459259764103) z) 3.350343815022304)))) (- (* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y) (- (/ (* 0.40462203869992125 y) (* z z)) x))))
(+ x (/ (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))