
(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 (or (<= z -9.6e+35) (not (<= z 3.5)))
(+ x (/ y 14.431876219268936))
(+
x
(/
(*
y
(+
0.279195317918525
(* z (+ 0.4917317610505968 (pow (cbrt (* z 0.0692910599291889)) 3.0)))))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9.6e+35) || !(z <= 3.5)) {
tmp = x + (y / 14.431876219268936);
} else {
tmp = x + ((y * (0.279195317918525 + (z * (0.4917317610505968 + pow(cbrt((z * 0.0692910599291889)), 3.0))))) / ((z * (z + 6.012459259764103)) + 3.350343815022304));
}
return tmp;
}
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -9.6e+35) || !(z <= 3.5)) {
tmp = x + (y / 14.431876219268936);
} else {
tmp = x + ((y * (0.279195317918525 + (z * (0.4917317610505968 + Math.pow(Math.cbrt((z * 0.0692910599291889)), 3.0))))) / ((z * (z + 6.012459259764103)) + 3.350343815022304));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if ((z <= -9.6e+35) || !(z <= 3.5)) tmp = Float64(x + Float64(y / 14.431876219268936)); else tmp = Float64(x + Float64(Float64(y * Float64(0.279195317918525 + Float64(z * Float64(0.4917317610505968 + (cbrt(Float64(z * 0.0692910599291889)) ^ 3.0))))) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304))); end return tmp end
code[x_, y_, z_] := If[Or[LessEqual[z, -9.6e+35], N[Not[LessEqual[z, 3.5]], $MachinePrecision]], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(0.279195317918525 + N[(z * N[(0.4917317610505968 + N[Power[N[Power[N[(z * 0.0692910599291889), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{+35} \lor \neg \left(z \leq 3.5\right):\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(0.279195317918525 + z \cdot \left(0.4917317610505968 + {\left(\sqrt[3]{z \cdot 0.0692910599291889}\right)}^{3}\right)\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304}\\
\end{array}
\end{array}
if z < -9.60000000000000058e35 or 3.5 < z Initial program 32.4%
associate-/l*43.7%
fma-def43.7%
fma-def43.7%
fma-def43.7%
Simplified43.7%
Taylor expanded in z around inf 99.9%
if -9.60000000000000058e35 < z < 3.5Initial program 99.7%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
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))
5e+297)
(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)) <= 5e+297) {
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)) <= 5e+297) 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], 5e+297], 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 5 \cdot 10^{+297}:\\
\;\;\;\;\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)) < 4.9999999999999998e297Initial program 96.5%
+-commutative96.5%
associate-*r/99.7%
fma-def99.7%
*-commutative99.7%
fma-def99.7%
fma-def99.7%
*-commutative99.7%
fma-def99.7%
Simplified99.7%
if 4.9999999999999998e297 < (/.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.7%
associate-/l*10.8%
fma-def10.8%
fma-def10.8%
fma-def10.8%
Simplified10.8%
Taylor expanded in z around inf 99.9%
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))
5e+297)
(+
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)) <= 5e+297) {
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)) <= 5e+297) 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], 5e+297], 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 5 \cdot 10^{+297}:\\
\;\;\;\;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)) < 4.9999999999999998e297Initial program 96.5%
associate-/l*99.4%
fma-def99.4%
fma-def99.4%
fma-def99.4%
Simplified99.4%
if 4.9999999999999998e297 < (/.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.7%
associate-/l*10.8%
fma-def10.8%
fma-def10.8%
fma-def10.8%
Simplified10.8%
Taylor expanded in z around inf 99.9%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.2e+30) (not (<= z 3.5)))
(+ x (/ y 14.431876219268936))
(+
x
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ 3.350343815022304 (+ (* z z) (* z 6.012459259764103)))))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.2e+30) || !(z <= 3.5)) {
tmp = x + (y / 14.431876219268936);
} else {
tmp = x + ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / (3.350343815022304 + ((z * z) + (z * 6.012459259764103))));
}
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 <= (-1.2d+30)) .or. (.not. (z <= 3.5d0))) then
tmp = x + (y / 14.431876219268936d0)
else
tmp = x + ((y * ((z * ((z * 0.0692910599291889d0) + 0.4917317610505968d0)) + 0.279195317918525d0)) / (3.350343815022304d0 + ((z * z) + (z * 6.012459259764103d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.2e+30) || !(z <= 3.5)) {
tmp = x + (y / 14.431876219268936);
} else {
tmp = x + ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / (3.350343815022304 + ((z * z) + (z * 6.012459259764103))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.2e+30) or not (z <= 3.5): tmp = x + (y / 14.431876219268936) else: tmp = x + ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / (3.350343815022304 + ((z * z) + (z * 6.012459259764103)))) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.2e+30) || !(z <= 3.5)) tmp = Float64(x + Float64(y / 14.431876219268936)); else tmp = Float64(x + Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / Float64(3.350343815022304 + Float64(Float64(z * z) + Float64(z * 6.012459259764103))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.2e+30) || ~((z <= 3.5))) tmp = x + (y / 14.431876219268936); else tmp = x + ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / (3.350343815022304 + ((z * z) + (z * 6.012459259764103)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.2e+30], N[Not[LessEqual[z, 3.5]], $MachinePrecision]], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(3.350343815022304 + N[(N[(z * z), $MachinePrecision] + N[(z * 6.012459259764103), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+30} \lor \neg \left(z \leq 3.5\right):\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{3.350343815022304 + \left(z \cdot z + z \cdot 6.012459259764103\right)}\\
\end{array}
\end{array}
if z < -1.2e30 or 3.5 < z Initial program 33.0%
associate-/l*44.2%
fma-def44.2%
fma-def44.2%
fma-def44.2%
Simplified44.2%
Taylor expanded in z around inf 99.9%
if -1.2e30 < z < 3.5Initial program 99.7%
*-commutative99.7%
distribute-lft-in99.7%
Applied egg-rr99.7%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(if (or (<= z -5e+30) (not (<= z 3.5)))
(+ x (/ y 14.431876219268936))
(+
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5e+30) || !(z <= 3.5)) {
tmp = x + (y / 14.431876219268936);
} else {
tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + 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 ((z <= (-5d+30)) .or. (.not. (z <= 3.5d0))) then
tmp = x + (y / 14.431876219268936d0)
else
tmp = ((y * ((z * ((z * 0.0692910599291889d0) + 0.4917317610505968d0)) + 0.279195317918525d0)) / ((z * (z + 6.012459259764103d0)) + 3.350343815022304d0)) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5e+30) || !(z <= 3.5)) {
tmp = x + (y / 14.431876219268936);
} else {
tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5e+30) or not (z <= 3.5): tmp = x + (y / 14.431876219268936) else: tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5e+30) || !(z <= 3.5)) tmp = Float64(x + Float64(y / 14.431876219268936)); else tmp = Float64(Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5e+30) || ~((z <= 3.5))) tmp = x + (y / 14.431876219268936); else tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5e+30], N[Not[LessEqual[z, 3.5]], $MachinePrecision]], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision], N[(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] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+30} \lor \neg \left(z \leq 3.5\right):\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\mathbf{else}:\\
\;\;\;\;\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} + x\\
\end{array}
\end{array}
if z < -4.9999999999999998e30 or 3.5 < z Initial program 33.0%
associate-/l*44.2%
fma-def44.2%
fma-def44.2%
fma-def44.2%
Simplified44.2%
Taylor expanded in z around inf 99.9%
if -4.9999999999999998e30 < z < 3.5Initial program 99.7%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+
x
(/
y
(+
14.431876219268936
(/ (- (/ 101.23733352003822 z) 15.646356830292042) z))))
(if (<= z 3.5)
(+ x (/ y (+ (* z 0.39999999996247915) 12.000000000000014)))
(+ x (/ y 14.431876219268936)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y / (14.431876219268936 + (((101.23733352003822 / z) - 15.646356830292042) / z)));
} else if (z <= 3.5) {
tmp = x + (y / ((z * 0.39999999996247915) + 12.000000000000014));
} else {
tmp = x + (y / 14.431876219268936);
}
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 <= (-5.4d0)) then
tmp = x + (y / (14.431876219268936d0 + (((101.23733352003822d0 / z) - 15.646356830292042d0) / z)))
else if (z <= 3.5d0) then
tmp = x + (y / ((z * 0.39999999996247915d0) + 12.000000000000014d0))
else
tmp = x + (y / 14.431876219268936d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y / (14.431876219268936 + (((101.23733352003822 / z) - 15.646356830292042) / z)));
} else if (z <= 3.5) {
tmp = x + (y / ((z * 0.39999999996247915) + 12.000000000000014));
} else {
tmp = x + (y / 14.431876219268936);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4: tmp = x + (y / (14.431876219268936 + (((101.23733352003822 / z) - 15.646356830292042) / z))) elif z <= 3.5: tmp = x + (y / ((z * 0.39999999996247915) + 12.000000000000014)) else: tmp = x + (y / 14.431876219268936) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4) tmp = Float64(x + Float64(y / Float64(14.431876219268936 + Float64(Float64(Float64(101.23733352003822 / z) - 15.646356830292042) / z)))); elseif (z <= 3.5) tmp = Float64(x + Float64(y / Float64(Float64(z * 0.39999999996247915) + 12.000000000000014))); else tmp = Float64(x + Float64(y / 14.431876219268936)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4) tmp = x + (y / (14.431876219268936 + (((101.23733352003822 / z) - 15.646356830292042) / z))); elseif (z <= 3.5) tmp = x + (y / ((z * 0.39999999996247915) + 12.000000000000014)); else tmp = x + (y / 14.431876219268936); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4], N[(x + N[(y / N[(14.431876219268936 + N[(N[(N[(101.23733352003822 / z), $MachinePrecision] - 15.646356830292042), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5], N[(x + N[(y / N[(N[(z * 0.39999999996247915), $MachinePrecision] + 12.000000000000014), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;x + \frac{y}{14.431876219268936 + \frac{\frac{101.23733352003822}{z} - 15.646356830292042}{z}}\\
\mathbf{elif}\;z \leq 3.5:\\
\;\;\;\;x + \frac{y}{z \cdot 0.39999999996247915 + 12.000000000000014}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\end{array}
\end{array}
if z < -5.4000000000000004Initial program 42.7%
associate-/l*53.6%
fma-def53.6%
fma-def53.6%
fma-def53.6%
Simplified53.6%
Taylor expanded in z around inf 99.2%
associate-*r/99.2%
metadata-eval99.2%
unpow299.2%
associate-*r/99.2%
metadata-eval99.2%
Simplified99.2%
associate--l+99.2%
associate-/r*99.2%
sub-div99.2%
Applied egg-rr99.2%
if -5.4000000000000004 < z < 3.5Initial 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.5%
if 3.5 < z Initial program 31.4%
associate-/l*42.1%
fma-def42.1%
fma-def42.1%
fma-def42.1%
Simplified42.1%
Taylor expanded in z around inf 99.9%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.4) (not (<= z 3.5))) (+ x (/ y 14.431876219268936)) (+ x (/ y (+ (* z 0.39999999996247915) 12.000000000000014)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.4) || !(z <= 3.5)) {
tmp = x + (y / 14.431876219268936);
} else {
tmp = x + (y / ((z * 0.39999999996247915) + 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 <= (-5.4d0)) .or. (.not. (z <= 3.5d0))) then
tmp = x + (y / 14.431876219268936d0)
else
tmp = x + (y / ((z * 0.39999999996247915d0) + 12.000000000000014d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.4) || !(z <= 3.5)) {
tmp = x + (y / 14.431876219268936);
} else {
tmp = x + (y / ((z * 0.39999999996247915) + 12.000000000000014));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.4) or not (z <= 3.5): tmp = x + (y / 14.431876219268936) else: tmp = x + (y / ((z * 0.39999999996247915) + 12.000000000000014)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.4) || !(z <= 3.5)) tmp = Float64(x + Float64(y / 14.431876219268936)); else tmp = Float64(x + Float64(y / Float64(Float64(z * 0.39999999996247915) + 12.000000000000014))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.4) || ~((z <= 3.5))) tmp = x + (y / 14.431876219268936); else tmp = x + (y / ((z * 0.39999999996247915) + 12.000000000000014)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.4], N[Not[LessEqual[z, 3.5]], $MachinePrecision]], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z * 0.39999999996247915), $MachinePrecision] + 12.000000000000014), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \lor \neg \left(z \leq 3.5\right):\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot 0.39999999996247915 + 12.000000000000014}\\
\end{array}
\end{array}
if z < -5.4000000000000004 or 3.5 < z Initial program 36.2%
associate-/l*46.9%
fma-def46.9%
fma-def46.9%
fma-def46.9%
Simplified46.9%
Taylor expanded in z around inf 99.4%
if -5.4000000000000004 < z < 3.5Initial 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.5%
Final simplification99.4%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+ x (/ y (- 14.431876219268936 (/ 15.646356830292042 z))))
(if (<= z 3.5)
(+ x (/ y (+ (* z 0.39999999996247915) 12.000000000000014)))
(+ x (/ y 14.431876219268936)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y / (14.431876219268936 - (15.646356830292042 / z)));
} else if (z <= 3.5) {
tmp = x + (y / ((z * 0.39999999996247915) + 12.000000000000014));
} else {
tmp = x + (y / 14.431876219268936);
}
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 <= (-5.4d0)) then
tmp = x + (y / (14.431876219268936d0 - (15.646356830292042d0 / z)))
else if (z <= 3.5d0) then
tmp = x + (y / ((z * 0.39999999996247915d0) + 12.000000000000014d0))
else
tmp = x + (y / 14.431876219268936d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y / (14.431876219268936 - (15.646356830292042 / z)));
} else if (z <= 3.5) {
tmp = x + (y / ((z * 0.39999999996247915) + 12.000000000000014));
} else {
tmp = x + (y / 14.431876219268936);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4: tmp = x + (y / (14.431876219268936 - (15.646356830292042 / z))) elif z <= 3.5: tmp = x + (y / ((z * 0.39999999996247915) + 12.000000000000014)) else: tmp = x + (y / 14.431876219268936) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4) tmp = Float64(x + Float64(y / Float64(14.431876219268936 - Float64(15.646356830292042 / z)))); elseif (z <= 3.5) tmp = Float64(x + Float64(y / Float64(Float64(z * 0.39999999996247915) + 12.000000000000014))); else tmp = Float64(x + Float64(y / 14.431876219268936)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4) tmp = x + (y / (14.431876219268936 - (15.646356830292042 / z))); elseif (z <= 3.5) tmp = x + (y / ((z * 0.39999999996247915) + 12.000000000000014)); else tmp = x + (y / 14.431876219268936); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4], N[(x + N[(y / N[(14.431876219268936 - N[(15.646356830292042 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5], N[(x + N[(y / N[(N[(z * 0.39999999996247915), $MachinePrecision] + 12.000000000000014), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;x + \frac{y}{14.431876219268936 - \frac{15.646356830292042}{z}}\\
\mathbf{elif}\;z \leq 3.5:\\
\;\;\;\;x + \frac{y}{z \cdot 0.39999999996247915 + 12.000000000000014}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\end{array}
\end{array}
if z < -5.4000000000000004Initial program 42.7%
associate-/l*53.6%
fma-def53.6%
fma-def53.6%
fma-def53.6%
Simplified53.6%
Taylor expanded in z around inf 98.9%
associate-*r/98.9%
metadata-eval98.9%
Simplified98.9%
if -5.4000000000000004 < z < 3.5Initial 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.5%
if 3.5 < z Initial program 31.4%
associate-/l*42.1%
fma-def42.1%
fma-def42.1%
fma-def42.1%
Simplified42.1%
Taylor expanded in z around inf 99.9%
Final simplification99.5%
(FPCore (x y z)
:precision binary64
(if (<= y -7e+59)
(* y 0.08333333333333323)
(if (<= y 2.3e-31)
x
(if (<= y 6e+32)
(* y 0.0692910599291889)
(if (<= y 4.4e+80) x (* y 0.0692910599291889))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7e+59) {
tmp = y * 0.08333333333333323;
} else if (y <= 2.3e-31) {
tmp = x;
} else if (y <= 6e+32) {
tmp = y * 0.0692910599291889;
} else if (y <= 4.4e+80) {
tmp = x;
} else {
tmp = y * 0.0692910599291889;
}
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 (y <= (-7d+59)) then
tmp = y * 0.08333333333333323d0
else if (y <= 2.3d-31) then
tmp = x
else if (y <= 6d+32) then
tmp = y * 0.0692910599291889d0
else if (y <= 4.4d+80) then
tmp = x
else
tmp = y * 0.0692910599291889d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7e+59) {
tmp = y * 0.08333333333333323;
} else if (y <= 2.3e-31) {
tmp = x;
} else if (y <= 6e+32) {
tmp = y * 0.0692910599291889;
} else if (y <= 4.4e+80) {
tmp = x;
} else {
tmp = y * 0.0692910599291889;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7e+59: tmp = y * 0.08333333333333323 elif y <= 2.3e-31: tmp = x elif y <= 6e+32: tmp = y * 0.0692910599291889 elif y <= 4.4e+80: tmp = x else: tmp = y * 0.0692910599291889 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7e+59) tmp = Float64(y * 0.08333333333333323); elseif (y <= 2.3e-31) tmp = x; elseif (y <= 6e+32) tmp = Float64(y * 0.0692910599291889); elseif (y <= 4.4e+80) tmp = x; else tmp = Float64(y * 0.0692910599291889); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7e+59) tmp = y * 0.08333333333333323; elseif (y <= 2.3e-31) tmp = x; elseif (y <= 6e+32) tmp = y * 0.0692910599291889; elseif (y <= 4.4e+80) tmp = x; else tmp = y * 0.0692910599291889; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7e+59], N[(y * 0.08333333333333323), $MachinePrecision], If[LessEqual[y, 2.3e-31], x, If[LessEqual[y, 6e+32], N[(y * 0.0692910599291889), $MachinePrecision], If[LessEqual[y, 4.4e+80], x, N[(y * 0.0692910599291889), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+59}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-31}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+32}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+80}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if y < -7e59Initial program 58.5%
associate-/l*70.1%
fma-def70.1%
fma-def70.1%
fma-def70.1%
Simplified70.1%
Taylor expanded in z around 0 62.6%
Taylor expanded in x around 0 48.3%
Taylor expanded in z around 0 55.1%
*-commutative55.1%
Simplified55.1%
if -7e59 < y < 2.2999999999999998e-31 or 6e32 < y < 4.40000000000000005e80Initial program 76.4%
+-commutative76.4%
associate-*r/77.1%
fma-def77.1%
*-commutative77.1%
fma-def77.1%
fma-def77.1%
*-commutative77.1%
fma-def77.1%
Simplified77.1%
Taylor expanded in y around 0 74.9%
if 2.2999999999999998e-31 < y < 6e32 or 4.40000000000000005e80 < y Initial program 60.7%
+-commutative60.7%
associate-*r/71.0%
fma-def71.0%
*-commutative71.0%
fma-def71.0%
fma-def71.0%
*-commutative71.0%
fma-def71.0%
Simplified71.0%
Taylor expanded in z around inf 68.3%
Taylor expanded in y around inf 55.0%
Final simplification66.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -9.2e+32) (and (not (<= z 5.2e+117)) (<= z 4.5e+192))) (* y 0.0692910599291889) (+ x (/ y 12.000000000000014))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9.2e+32) || (!(z <= 5.2e+117) && (z <= 4.5e+192))) {
tmp = y * 0.0692910599291889;
} 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 <= (-9.2d+32)) .or. (.not. (z <= 5.2d+117)) .and. (z <= 4.5d+192)) then
tmp = y * 0.0692910599291889d0
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 <= -9.2e+32) || (!(z <= 5.2e+117) && (z <= 4.5e+192))) {
tmp = y * 0.0692910599291889;
} else {
tmp = x + (y / 12.000000000000014);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -9.2e+32) or (not (z <= 5.2e+117) and (z <= 4.5e+192)): tmp = y * 0.0692910599291889 else: tmp = x + (y / 12.000000000000014) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -9.2e+32) || (!(z <= 5.2e+117) && (z <= 4.5e+192))) tmp = Float64(y * 0.0692910599291889); else tmp = Float64(x + Float64(y / 12.000000000000014)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -9.2e+32) || (~((z <= 5.2e+117)) && (z <= 4.5e+192))) tmp = y * 0.0692910599291889; else tmp = x + (y / 12.000000000000014); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -9.2e+32], And[N[Not[LessEqual[z, 5.2e+117]], $MachinePrecision], LessEqual[z, 4.5e+192]]], N[(y * 0.0692910599291889), $MachinePrecision], N[(x + N[(y / 12.000000000000014), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+32} \lor \neg \left(z \leq 5.2 \cdot 10^{+117}\right) \land z \leq 4.5 \cdot 10^{+192}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{12.000000000000014}\\
\end{array}
\end{array}
if z < -9.1999999999999998e32 or 5.1999999999999999e117 < z < 4.5e192Initial program 30.0%
+-commutative30.0%
associate-*r/45.8%
fma-def45.8%
*-commutative45.8%
fma-def45.8%
fma-def45.8%
*-commutative45.8%
fma-def45.8%
Simplified45.8%
Taylor expanded in z around inf 99.5%
Taylor expanded in y around inf 68.5%
if -9.1999999999999998e32 < z < 5.1999999999999999e117 or 4.5e192 < z Initial program 82.5%
associate-/l*83.8%
fma-def83.8%
fma-def83.8%
fma-def83.8%
Simplified83.8%
Taylor expanded in z around 0 89.5%
Final simplification84.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.4) (not (<= z 3.5))) (+ x (/ y 14.431876219268936)) (+ x (/ y 12.000000000000014))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.4) || !(z <= 3.5)) {
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 <= (-5.4d0)) .or. (.not. (z <= 3.5d0))) 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 <= -5.4) || !(z <= 3.5)) {
tmp = x + (y / 14.431876219268936);
} else {
tmp = x + (y / 12.000000000000014);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.4) or not (z <= 3.5): tmp = x + (y / 14.431876219268936) else: tmp = x + (y / 12.000000000000014) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.4) || !(z <= 3.5)) 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 <= -5.4) || ~((z <= 3.5))) tmp = x + (y / 14.431876219268936); else tmp = x + (y / 12.000000000000014); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.4], N[Not[LessEqual[z, 3.5]], $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 -5.4 \lor \neg \left(z \leq 3.5\right):\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{12.000000000000014}\\
\end{array}
\end{array}
if z < -5.4000000000000004 or 3.5 < z Initial program 36.2%
associate-/l*46.9%
fma-def46.9%
fma-def46.9%
fma-def46.9%
Simplified46.9%
Taylor expanded in z around inf 99.4%
if -5.4000000000000004 < z < 3.5Initial 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.4%
Final simplification99.4%
(FPCore (x y z) :precision binary64 (if (<= x -1.65e-75) x (if (<= x 3.9e-41) (* y 0.0692910599291889) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.65e-75) {
tmp = x;
} else if (x <= 3.9e-41) {
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 <= (-1.65d-75)) then
tmp = x
else if (x <= 3.9d-41) 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 <= -1.65e-75) {
tmp = x;
} else if (x <= 3.9e-41) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.65e-75: tmp = x elif x <= 3.9e-41: tmp = y * 0.0692910599291889 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.65e-75) tmp = x; elseif (x <= 3.9e-41) tmp = Float64(y * 0.0692910599291889); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.65e-75) tmp = x; elseif (x <= 3.9e-41) tmp = y * 0.0692910599291889; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.65e-75], x, If[LessEqual[x, 3.9e-41], N[(y * 0.0692910599291889), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-75}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-41}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.65e-75 or 3.89999999999999991e-41 < x Initial program 68.6%
+-commutative68.6%
associate-*r/74.2%
fma-def74.2%
*-commutative74.2%
fma-def74.2%
fma-def74.2%
*-commutative74.2%
fma-def74.2%
Simplified74.2%
Taylor expanded in y around 0 69.8%
if -1.65e-75 < x < 3.89999999999999991e-41Initial program 70.1%
+-commutative70.1%
associate-*r/74.6%
fma-def74.6%
*-commutative74.6%
fma-def74.6%
fma-def74.6%
*-commutative74.6%
fma-def74.6%
Simplified74.6%
Taylor expanded in z around inf 68.1%
Taylor expanded in y around inf 52.6%
Final simplification62.8%
(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 69.2%
+-commutative69.2%
associate-*r/74.4%
fma-def74.4%
*-commutative74.4%
fma-def74.4%
fma-def74.4%
*-commutative74.4%
fma-def74.4%
Simplified74.4%
Taylor expanded in y around 0 48.8%
Final simplification48.8%
(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 2023181
(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))))