
(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 12 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 (<=
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
4e+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)) <= 4e+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)) <= 4e+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], 4e+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 4 \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.0000000000000001e297Initial program 97.1%
+-commutative97.1%
associate-*r/99.8%
fma-def99.8%
*-commutative99.8%
fma-def99.8%
fma-def99.8%
*-commutative99.8%
fma-def99.8%
Simplified99.8%
if 4.0000000000000001e297 < (/.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.6%
associate-/l*9.5%
fma-def9.5%
fma-def9.5%
fma-def9.5%
Simplified9.5%
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))
4e+297)
(+
x
(*
(fma z (fma z 0.0692910599291889 0.4917317610505968) 0.279195317918525)
(/ y (fma z (+ z 6.012459259764103) 3.350343815022304))))
(+ 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)) <= 4e+297) {
tmp = x + (fma(z, fma(z, 0.0692910599291889, 0.4917317610505968), 0.279195317918525) * (y / fma(z, (z + 6.012459259764103), 3.350343815022304)));
} 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)) <= 4e+297) tmp = Float64(x + Float64(fma(z, fma(z, 0.0692910599291889, 0.4917317610505968), 0.279195317918525) * Float64(y / fma(z, Float64(z + 6.012459259764103), 3.350343815022304)))); 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], 4e+297], N[(x + N[(N[(z * N[(z * 0.0692910599291889 + 0.4917317610505968), $MachinePrecision] + 0.279195317918525), $MachinePrecision] * N[(y / N[(z * N[(z + 6.012459259764103), $MachinePrecision] + 3.350343815022304), $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 4 \cdot 10^{+297}:\\
\;\;\;\;x + \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right) \cdot \frac{y}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\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.0000000000000001e297Initial program 97.1%
associate-*l/97.9%
*-commutative97.9%
fma-def97.9%
*-commutative97.9%
fma-def97.9%
fma-def97.9%
Simplified97.9%
if 4.0000000000000001e297 < (/.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.6%
associate-/l*9.5%
fma-def9.5%
fma-def9.5%
fma-def9.5%
Simplified9.5%
Taylor expanded in z around inf 99.9%
Final simplification98.5%
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
4e+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)) <= 4e+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)) <= 4e+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], 4e+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 4 \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.0000000000000001e297Initial program 97.1%
associate-/l*99.4%
fma-def99.4%
fma-def99.4%
fma-def99.4%
Simplified99.4%
if 4.0000000000000001e297 < (/.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.6%
associate-/l*9.5%
fma-def9.5%
fma-def9.5%
fma-def9.5%
Simplified9.5%
Taylor expanded in z around inf 99.9%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= z -105000.0)
(+
x
(/
y
(-
(+ 14.431876219268936 (/ 101.23733352003822 (* z z)))
(/ 15.646356830292042 z))))
(if (<= z 0.000102)
(+
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
x)
(+ x (/ y 14.431876219268936)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -105000.0) {
tmp = x + (y / ((14.431876219268936 + (101.23733352003822 / (z * z))) - (15.646356830292042 / z)));
} else if (z <= 0.000102) {
tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x;
} 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 <= (-105000.0d0)) then
tmp = x + (y / ((14.431876219268936d0 + (101.23733352003822d0 / (z * z))) - (15.646356830292042d0 / z)))
else if (z <= 0.000102d0) then
tmp = ((y * ((z * ((z * 0.0692910599291889d0) + 0.4917317610505968d0)) + 0.279195317918525d0)) / ((z * (z + 6.012459259764103d0)) + 3.350343815022304d0)) + x
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 <= -105000.0) {
tmp = x + (y / ((14.431876219268936 + (101.23733352003822 / (z * z))) - (15.646356830292042 / z)));
} else if (z <= 0.000102) {
tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x;
} else {
tmp = x + (y / 14.431876219268936);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -105000.0: tmp = x + (y / ((14.431876219268936 + (101.23733352003822 / (z * z))) - (15.646356830292042 / z))) elif z <= 0.000102: tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x else: tmp = x + (y / 14.431876219268936) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -105000.0) tmp = Float64(x + Float64(y / Float64(Float64(14.431876219268936 + Float64(101.23733352003822 / Float64(z * z))) - Float64(15.646356830292042 / z)))); elseif (z <= 0.000102) 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); else tmp = Float64(x + Float64(y / 14.431876219268936)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -105000.0) tmp = x + (y / ((14.431876219268936 + (101.23733352003822 / (z * z))) - (15.646356830292042 / z))); elseif (z <= 0.000102) tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x; else tmp = x + (y / 14.431876219268936); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -105000.0], N[(x + N[(y / N[(N[(14.431876219268936 + N[(101.23733352003822 / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(15.646356830292042 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.000102], 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], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -105000:\\
\;\;\;\;x + \frac{y}{\left(14.431876219268936 + \frac{101.23733352003822}{z \cdot z}\right) - \frac{15.646356830292042}{z}}\\
\mathbf{elif}\;z \leq 0.000102:\\
\;\;\;\;\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\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\end{array}
\end{array}
if z < -105000Initial program 43.0%
associate-/l*50.5%
fma-def50.5%
fma-def50.5%
fma-def50.5%
Simplified50.5%
Taylor expanded in z around inf 99.9%
associate-*r/99.9%
metadata-eval99.9%
unpow299.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
if -105000 < z < 1.01999999999999999e-4Initial program 99.6%
if 1.01999999999999999e-4 < z Initial program 33.4%
associate-/l*44.0%
fma-def44.0%
fma-def44.0%
fma-def44.0%
Simplified44.0%
Taylor expanded in z around inf 99.9%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+
x
(/
y
(-
(+ 14.431876219268936 (/ 101.23733352003822 (* z z)))
(/ 15.646356830292042 z))))
(if (<= z 0.000102)
(+ 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 * z))) - (15.646356830292042 / z)));
} else if (z <= 0.000102) {
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 * z))) - (15.646356830292042d0 / z)))
else if (z <= 0.000102d0) 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 * z))) - (15.646356830292042 / z)));
} else if (z <= 0.000102) {
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 * z))) - (15.646356830292042 / z))) elif z <= 0.000102: 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(Float64(14.431876219268936 + Float64(101.23733352003822 / Float64(z * z))) - Float64(15.646356830292042 / z)))); elseif (z <= 0.000102) 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 * z))) - (15.646356830292042 / z))); elseif (z <= 0.000102) 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[(N[(14.431876219268936 + N[(101.23733352003822 / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(15.646356830292042 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.000102], 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}{\left(14.431876219268936 + \frac{101.23733352003822}{z \cdot z}\right) - \frac{15.646356830292042}{z}}\\
\mathbf{elif}\;z \leq 0.000102:\\
\;\;\;\;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 43.0%
associate-/l*50.5%
fma-def50.5%
fma-def50.5%
fma-def50.5%
Simplified50.5%
Taylor expanded in z around inf 99.9%
associate-*r/99.9%
metadata-eval99.9%
unpow299.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
if -5.4000000000000004 < z < 1.01999999999999999e-4Initial program 99.6%
associate-/l*99.4%
fma-def99.4%
fma-def99.4%
fma-def99.4%
Simplified99.4%
Taylor expanded in z around 0 99.4%
if 1.01999999999999999e-4 < z Initial program 33.4%
associate-/l*44.0%
fma-def44.0%
fma-def44.0%
fma-def44.0%
Simplified44.0%
Taylor expanded in z around inf 99.9%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x -5e-76)
x
(if (<= x -1.45e-118)
(* y 0.0692910599291889)
(if (<= x -5.5e-136)
x
(if (<= x 9.5e-297)
(* y 0.08333333333333323)
(if (<= x 2.8e-72) (* y 0.0692910599291889) x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -5e-76) {
tmp = x;
} else if (x <= -1.45e-118) {
tmp = y * 0.0692910599291889;
} else if (x <= -5.5e-136) {
tmp = x;
} else if (x <= 9.5e-297) {
tmp = y * 0.08333333333333323;
} else if (x <= 2.8e-72) {
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 <= (-5d-76)) then
tmp = x
else if (x <= (-1.45d-118)) then
tmp = y * 0.0692910599291889d0
else if (x <= (-5.5d-136)) then
tmp = x
else if (x <= 9.5d-297) then
tmp = y * 0.08333333333333323d0
else if (x <= 2.8d-72) 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 <= -5e-76) {
tmp = x;
} else if (x <= -1.45e-118) {
tmp = y * 0.0692910599291889;
} else if (x <= -5.5e-136) {
tmp = x;
} else if (x <= 9.5e-297) {
tmp = y * 0.08333333333333323;
} else if (x <= 2.8e-72) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5e-76: tmp = x elif x <= -1.45e-118: tmp = y * 0.0692910599291889 elif x <= -5.5e-136: tmp = x elif x <= 9.5e-297: tmp = y * 0.08333333333333323 elif x <= 2.8e-72: tmp = y * 0.0692910599291889 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5e-76) tmp = x; elseif (x <= -1.45e-118) tmp = Float64(y * 0.0692910599291889); elseif (x <= -5.5e-136) tmp = x; elseif (x <= 9.5e-297) tmp = Float64(y * 0.08333333333333323); elseif (x <= 2.8e-72) tmp = Float64(y * 0.0692910599291889); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5e-76) tmp = x; elseif (x <= -1.45e-118) tmp = y * 0.0692910599291889; elseif (x <= -5.5e-136) tmp = x; elseif (x <= 9.5e-297) tmp = y * 0.08333333333333323; elseif (x <= 2.8e-72) tmp = y * 0.0692910599291889; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5e-76], x, If[LessEqual[x, -1.45e-118], N[(y * 0.0692910599291889), $MachinePrecision], If[LessEqual[x, -5.5e-136], x, If[LessEqual[x, 9.5e-297], N[(y * 0.08333333333333323), $MachinePrecision], If[LessEqual[x, 2.8e-72], N[(y * 0.0692910599291889), $MachinePrecision], x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-76}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-118}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-136}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-297}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-72}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.9999999999999998e-76 or -1.4499999999999999e-118 < x < -5.4999999999999999e-136 or 2.7999999999999998e-72 < x Initial program 73.1%
+-commutative73.1%
associate-*r/76.5%
fma-def76.5%
*-commutative76.5%
fma-def76.5%
fma-def76.5%
*-commutative76.5%
fma-def76.5%
Simplified76.5%
Taylor expanded in y around 0 68.6%
if -4.9999999999999998e-76 < x < -1.4499999999999999e-118 or 9.5000000000000005e-297 < x < 2.7999999999999998e-72Initial program 57.9%
+-commutative57.9%
associate-*r/65.3%
fma-def65.3%
*-commutative65.3%
fma-def65.3%
fma-def65.3%
*-commutative65.3%
fma-def65.3%
Simplified65.3%
Taylor expanded in z around inf 75.1%
Taylor expanded in y around inf 63.4%
if -5.4999999999999999e-136 < x < 9.5000000000000005e-297Initial program 75.6%
+-commutative75.6%
associate-*r/79.9%
fma-def79.9%
*-commutative79.9%
fma-def79.9%
fma-def79.9%
*-commutative79.9%
fma-def79.9%
Simplified79.9%
Taylor expanded in z around 0 62.6%
Taylor expanded in y around inf 55.1%
Taylor expanded in z around 0 58.7%
*-commutative58.7%
Simplified58.7%
Final simplification66.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.4) (not (<= z 0.000102))) (+ 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 <= 0.000102)) {
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 <= 0.000102d0))) 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 <= 0.000102)) {
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 <= 0.000102): 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 <= 0.000102)) 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 <= 0.000102))) 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, 0.000102]], $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 0.000102\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 1.01999999999999999e-4 < z Initial program 39.1%
associate-/l*47.8%
fma-def47.8%
fma-def47.8%
fma-def47.8%
Simplified47.8%
Taylor expanded in z around inf 99.5%
if -5.4000000000000004 < z < 1.01999999999999999e-4Initial program 99.6%
associate-/l*99.4%
fma-def99.4%
fma-def99.4%
fma-def99.4%
Simplified99.4%
Taylor expanded in z around 0 99.4%
Final simplification99.5%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+ x (/ y (- 14.431876219268936 (/ 15.646356830292042 z))))
(if (<= z 0.000102)
(+ 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 <= 0.000102) {
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 <= 0.000102d0) 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 <= 0.000102) {
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 <= 0.000102: 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 <= 0.000102) 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 <= 0.000102) 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, 0.000102], 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 0.000102:\\
\;\;\;\;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 43.0%
associate-/l*50.5%
fma-def50.5%
fma-def50.5%
fma-def50.5%
Simplified50.5%
Taylor expanded in z around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
if -5.4000000000000004 < z < 1.01999999999999999e-4Initial program 99.6%
associate-/l*99.4%
fma-def99.4%
fma-def99.4%
fma-def99.4%
Simplified99.4%
Taylor expanded in z around 0 99.4%
if 1.01999999999999999e-4 < z Initial program 33.4%
associate-/l*44.0%
fma-def44.0%
fma-def44.0%
fma-def44.0%
Simplified44.0%
Taylor expanded in z around inf 99.9%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (if (or (<= x 1.02e-296) (not (<= x 6e-225))) (+ x (/ y 12.000000000000014)) (* y 0.0692910599291889)))
double code(double x, double y, double z) {
double tmp;
if ((x <= 1.02e-296) || !(x <= 6e-225)) {
tmp = x + (y / 12.000000000000014);
} 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 ((x <= 1.02d-296) .or. (.not. (x <= 6d-225))) then
tmp = x + (y / 12.000000000000014d0)
else
tmp = y * 0.0692910599291889d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= 1.02e-296) || !(x <= 6e-225)) {
tmp = x + (y / 12.000000000000014);
} else {
tmp = y * 0.0692910599291889;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= 1.02e-296) or not (x <= 6e-225): tmp = x + (y / 12.000000000000014) else: tmp = y * 0.0692910599291889 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= 1.02e-296) || !(x <= 6e-225)) tmp = Float64(x + Float64(y / 12.000000000000014)); else tmp = Float64(y * 0.0692910599291889); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= 1.02e-296) || ~((x <= 6e-225))) tmp = x + (y / 12.000000000000014); else tmp = y * 0.0692910599291889; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, 1.02e-296], N[Not[LessEqual[x, 6e-225]], $MachinePrecision]], N[(x + N[(y / 12.000000000000014), $MachinePrecision]), $MachinePrecision], N[(y * 0.0692910599291889), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.02 \cdot 10^{-296} \lor \neg \left(x \leq 6 \cdot 10^{-225}\right):\\
\;\;\;\;x + \frac{y}{12.000000000000014}\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if x < 1.02000000000000002e-296 or 6.00000000000000035e-225 < x Initial program 70.8%
associate-/l*74.5%
fma-def74.5%
fma-def74.5%
fma-def74.5%
Simplified74.5%
Taylor expanded in z around 0 80.5%
if 1.02000000000000002e-296 < x < 6.00000000000000035e-225Initial program 46.7%
+-commutative46.7%
associate-*r/60.8%
fma-def60.8%
*-commutative60.8%
fma-def60.8%
fma-def60.8%
*-commutative60.8%
fma-def60.8%
Simplified60.8%
Taylor expanded in z around inf 99.0%
Taylor expanded in y around inf 99.0%
Final simplification81.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.4) (not (<= z 0.000102))) (+ x (/ y 14.431876219268936)) (+ x (/ y 12.000000000000014))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.4) || !(z <= 0.000102)) {
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 <= 0.000102d0))) 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 <= 0.000102)) {
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 <= 0.000102): 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 <= 0.000102)) 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 <= 0.000102))) 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, 0.000102]], $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 0.000102\right):\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{12.000000000000014}\\
\end{array}
\end{array}
if z < -5.4000000000000004 or 1.01999999999999999e-4 < z Initial program 39.1%
associate-/l*47.8%
fma-def47.8%
fma-def47.8%
fma-def47.8%
Simplified47.8%
Taylor expanded in z around inf 99.5%
if -5.4000000000000004 < z < 1.01999999999999999e-4Initial program 99.6%
associate-/l*99.4%
fma-def99.4%
fma-def99.4%
fma-def99.4%
Simplified99.4%
Taylor expanded in z around 0 98.5%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (if (<= x -3.8e-76) x (if (<= x 5.5e-74) (* y 0.0692910599291889) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.8e-76) {
tmp = x;
} else if (x <= 5.5e-74) {
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.8d-76)) then
tmp = x
else if (x <= 5.5d-74) 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.8e-76) {
tmp = x;
} else if (x <= 5.5e-74) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.8e-76: tmp = x elif x <= 5.5e-74: tmp = y * 0.0692910599291889 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.8e-76) tmp = x; elseif (x <= 5.5e-74) 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.8e-76) tmp = x; elseif (x <= 5.5e-74) tmp = y * 0.0692910599291889; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.8e-76], x, If[LessEqual[x, 5.5e-74], N[(y * 0.0692910599291889), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-76}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-74}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.8000000000000002e-76 or 5.5000000000000001e-74 < x Initial program 73.4%
+-commutative73.4%
associate-*r/76.9%
fma-def76.9%
*-commutative76.9%
fma-def76.9%
fma-def76.9%
*-commutative76.9%
fma-def76.9%
Simplified76.9%
Taylor expanded in y around 0 68.0%
if -3.8000000000000002e-76 < x < 5.5000000000000001e-74Initial program 63.1%
+-commutative63.1%
associate-*r/69.2%
fma-def69.2%
*-commutative69.2%
fma-def69.2%
fma-def69.2%
*-commutative69.2%
fma-def69.2%
Simplified69.2%
Taylor expanded in z around inf 71.3%
Taylor expanded in y around inf 54.6%
Final simplification63.1%
(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.6%
+-commutative69.6%
associate-*r/74.0%
fma-def74.0%
*-commutative74.0%
fma-def74.0%
fma-def74.0%
*-commutative74.0%
fma-def74.0%
Simplified74.0%
Taylor expanded in y around 0 49.9%
Final simplification49.9%
(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 2023257
(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))))