
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= z -2.7e+18)
(+ x (* y 0.0692910599291889))
(if (<= z 9.5e-13)
(+ x (* y 0.08333333333333323))
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.7e+18) {
tmp = x + (y * 0.0692910599291889);
} else if (z <= 9.5e-13) {
tmp = x + (y * 0.08333333333333323);
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
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 <= (-2.7d+18)) then
tmp = x + (y * 0.0692910599291889d0)
else if (z <= 9.5d-13) then
tmp = x + (y * 0.08333333333333323d0)
else
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.7e+18) {
tmp = x + (y * 0.0692910599291889);
} else if (z <= 9.5e-13) {
tmp = x + (y * 0.08333333333333323);
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.7e+18: tmp = x + (y * 0.0692910599291889) elif z <= 9.5e-13: tmp = x + (y * 0.08333333333333323) else: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.7e+18) tmp = Float64(x + Float64(y * 0.0692910599291889)); elseif (z <= 9.5e-13) tmp = Float64(x + Float64(y * 0.08333333333333323)); else tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.7e+18) tmp = x + (y * 0.0692910599291889); elseif (z <= 9.5e-13) tmp = x + (y * 0.08333333333333323); else tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.7e+18], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-13], N[(x + N[(y * 0.08333333333333323), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+18}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-13}:\\
\;\;\;\;x + y \cdot 0.08333333333333323\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if z < -2.7e18Initial program 43.7%
+-commutative43.7%
*-commutative43.7%
associate-/l*55.3%
fma-define55.3%
*-commutative55.3%
fma-define55.3%
fma-define55.3%
*-commutative55.3%
fma-define55.3%
Simplified55.3%
Taylor expanded in z around inf 99.6%
+-commutative99.6%
Simplified99.6%
if -2.7e18 < z < 9.49999999999999991e-13Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
associate-/l*99.7%
fma-define99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
*-commutative99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in z around 0 99.9%
+-commutative99.9%
Simplified99.9%
if 9.49999999999999991e-13 < z Initial program 46.9%
remove-double-neg46.9%
associate-/l*55.1%
distribute-rgt-neg-in55.1%
distribute-lft-neg-in55.1%
distribute-lft-neg-in55.1%
distribute-rgt-neg-in55.1%
remove-double-neg55.1%
fma-define55.1%
fma-define55.1%
fma-define55.1%
Simplified55.1%
Taylor expanded in z around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
INFINITY)
(+
x
(*
y
(/
(fma
(/
(- 0.24180012482592123 (* (pow z 2.0) 0.004801250986110448))
(- 0.4917317610505968 (* z 0.0692910599291889)))
z
0.279195317918525)
(fma (+ z 6.012459259764103) z 3.350343815022304))))
(+ x (* y 0.0692910599291889))))
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)) <= ((double) INFINITY)) {
tmp = x + (y * (fma(((0.24180012482592123 - (pow(z, 2.0) * 0.004801250986110448)) / (0.4917317610505968 - (z * 0.0692910599291889))), z, 0.279195317918525) / fma((z + 6.012459259764103), z, 3.350343815022304)));
} else {
tmp = x + (y * 0.0692910599291889);
}
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)) <= Inf) tmp = Float64(x + Float64(y * Float64(fma(Float64(Float64(0.24180012482592123 - Float64((z ^ 2.0) * 0.004801250986110448)) / Float64(0.4917317610505968 - Float64(z * 0.0692910599291889))), z, 0.279195317918525) / fma(Float64(z + 6.012459259764103), z, 3.350343815022304)))); else tmp = Float64(x + Float64(y * 0.0692910599291889)); 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], Infinity], N[(x + N[(y * N[(N[(N[(N[(0.24180012482592123 - N[(N[Power[z, 2.0], $MachinePrecision] * 0.004801250986110448), $MachinePrecision]), $MachinePrecision] / N[(0.4917317610505968 - N[(z * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z + 0.279195317918525), $MachinePrecision] / N[(N[(z + 6.012459259764103), $MachinePrecision] * z + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $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 \infty:\\
\;\;\;\;x + y \cdot \frac{\mathsf{fma}\left(\frac{0.24180012482592123 - {z}^{2} \cdot 0.004801250986110448}{0.4917317610505968 - z \cdot 0.0692910599291889}, z, 0.279195317918525\right)}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < +inf.0Initial program 93.1%
remove-double-neg93.1%
associate-/l*99.8%
distribute-rgt-neg-in99.8%
distribute-lft-neg-in99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
remove-double-neg99.8%
fma-define99.8%
fma-define99.8%
fma-define99.8%
Simplified99.8%
fma-define99.8%
+-commutative99.8%
flip-+99.8%
metadata-eval99.8%
swap-sqr99.7%
pow299.7%
metadata-eval99.8%
Applied egg-rr99.8%
if +inf.0 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) Initial program 0.0%
+-commutative0.0%
*-commutative0.0%
associate-/l*0.0%
fma-define0.0%
*-commutative0.0%
fma-define0.0%
fma-define0.0%
*-commutative0.0%
fma-define0.0%
Simplified0.0%
Taylor expanded in z around inf 99.5%
+-commutative99.5%
Simplified99.5%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
4e+305)
(+
x
(*
y
(/
(fma (fma z 0.0692910599291889 0.4917317610505968) z 0.279195317918525)
(fma (+ z 6.012459259764103) z 3.350343815022304))))
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z))))))
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+305) {
tmp = x + (y * (fma(fma(z, 0.0692910599291889, 0.4917317610505968), z, 0.279195317918525) / fma((z + 6.012459259764103), z, 3.350343815022304)));
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
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+305) tmp = Float64(x + Float64(y * Float64(fma(fma(z, 0.0692910599291889, 0.4917317610505968), z, 0.279195317918525) / fma(Float64(z + 6.012459259764103), z, 3.350343815022304)))); else tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); 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+305], N[(x + N[(y * N[(N[(N[(z * 0.0692910599291889 + 0.4917317610505968), $MachinePrecision] * z + 0.279195317918525), $MachinePrecision] / N[(N[(z + 6.012459259764103), $MachinePrecision] * z + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $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^{+305}:\\
\;\;\;\;x + y \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < 3.9999999999999998e305Initial program 98.2%
remove-double-neg98.2%
associate-/l*99.8%
distribute-rgt-neg-in99.8%
distribute-lft-neg-in99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
remove-double-neg99.8%
fma-define99.8%
fma-define99.8%
fma-define99.8%
Simplified99.8%
if 3.9999999999999998e305 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) Initial program 0.9%
remove-double-neg0.9%
associate-/l*16.1%
distribute-rgt-neg-in16.1%
distribute-lft-neg-in16.1%
distribute-lft-neg-in16.1%
distribute-rgt-neg-in16.1%
remove-double-neg16.1%
fma-define16.1%
fma-define16.1%
fma-define16.1%
Simplified16.1%
Taylor expanded in z around inf 99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* z (+ z 6.012459259764103)) 3.350343815022304))
(t_1 (* z (+ (* z 0.0692910599291889) 0.4917317610505968))))
(if (<= (/ (* y (+ t_1 0.279195317918525)) t_0) 4e+305)
(+ x (* y (+ (* 0.279195317918525 (/ 1.0 t_0)) (/ t_1 t_0))))
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z)))))))
double code(double x, double y, double z) {
double t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304;
double t_1 = z * ((z * 0.0692910599291889) + 0.4917317610505968);
double tmp;
if (((y * (t_1 + 0.279195317918525)) / t_0) <= 4e+305) {
tmp = x + (y * ((0.279195317918525 * (1.0 / t_0)) + (t_1 / t_0)));
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
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) :: t_1
real(8) :: tmp
t_0 = (z * (z + 6.012459259764103d0)) + 3.350343815022304d0
t_1 = z * ((z * 0.0692910599291889d0) + 0.4917317610505968d0)
if (((y * (t_1 + 0.279195317918525d0)) / t_0) <= 4d+305) then
tmp = x + (y * ((0.279195317918525d0 * (1.0d0 / t_0)) + (t_1 / t_0)))
else
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304;
double t_1 = z * ((z * 0.0692910599291889) + 0.4917317610505968);
double tmp;
if (((y * (t_1 + 0.279195317918525)) / t_0) <= 4e+305) {
tmp = x + (y * ((0.279195317918525 * (1.0 / t_0)) + (t_1 / t_0)));
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
return tmp;
}
def code(x, y, z): t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304 t_1 = z * ((z * 0.0692910599291889) + 0.4917317610505968) tmp = 0 if ((y * (t_1 + 0.279195317918525)) / t_0) <= 4e+305: tmp = x + (y * ((0.279195317918525 * (1.0 / t_0)) + (t_1 / t_0))) else: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) return tmp
function code(x, y, z) t_0 = Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304) t_1 = Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) tmp = 0.0 if (Float64(Float64(y * Float64(t_1 + 0.279195317918525)) / t_0) <= 4e+305) tmp = Float64(x + Float64(y * Float64(Float64(0.279195317918525 * Float64(1.0 / t_0)) + Float64(t_1 / t_0)))); else tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304; t_1 = z * ((z * 0.0692910599291889) + 0.4917317610505968); tmp = 0.0; if (((y * (t_1 + 0.279195317918525)) / t_0) <= 4e+305) tmp = x + (y * ((0.279195317918525 * (1.0 / t_0)) + (t_1 / t_0))); else tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(y * N[(t$95$1 + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], 4e+305], N[(x + N[(y * N[(N[(0.279195317918525 * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304\\
t_1 := z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right)\\
\mathbf{if}\;\frac{y \cdot \left(t\_1 + 0.279195317918525\right)}{t\_0} \leq 4 \cdot 10^{+305}:\\
\;\;\;\;x + y \cdot \left(0.279195317918525 \cdot \frac{1}{t\_0} + \frac{t\_1}{t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < 3.9999999999999998e305Initial program 98.2%
+-commutative98.2%
*-commutative98.2%
associate-/l*99.3%
fma-define99.2%
*-commutative99.2%
fma-define99.2%
fma-define99.2%
*-commutative99.2%
fma-define99.2%
Simplified99.2%
Taylor expanded in y around 0 99.3%
if 3.9999999999999998e305 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) Initial program 0.9%
remove-double-neg0.9%
associate-/l*16.1%
distribute-rgt-neg-in16.1%
distribute-lft-neg-in16.1%
distribute-lft-neg-in16.1%
distribute-rgt-neg-in16.1%
remove-double-neg16.1%
fma-define16.1%
fma-define16.1%
fma-define16.1%
Simplified16.1%
Taylor expanded in z around inf 99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* z (+ z 6.012459259764103)) 3.350343815022304)))
(if (<=
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
t_0)
4e+305)
(+
x
(/
(+
(* y 0.279195317918525)
(* z (+ (* 0.0692910599291889 (* y z)) (* y 0.4917317610505968))))
t_0))
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z)))))))
double code(double x, double y, double z) {
double t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304;
double tmp;
if (((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / t_0) <= 4e+305) {
tmp = x + (((y * 0.279195317918525) + (z * ((0.0692910599291889 * (y * z)) + (y * 0.4917317610505968)))) / t_0);
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
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 = (z * (z + 6.012459259764103d0)) + 3.350343815022304d0
if (((y * ((z * ((z * 0.0692910599291889d0) + 0.4917317610505968d0)) + 0.279195317918525d0)) / t_0) <= 4d+305) then
tmp = x + (((y * 0.279195317918525d0) + (z * ((0.0692910599291889d0 * (y * z)) + (y * 0.4917317610505968d0)))) / t_0)
else
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304;
double tmp;
if (((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / t_0) <= 4e+305) {
tmp = x + (((y * 0.279195317918525) + (z * ((0.0692910599291889 * (y * z)) + (y * 0.4917317610505968)))) / t_0);
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
return tmp;
}
def code(x, y, z): t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304 tmp = 0 if ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / t_0) <= 4e+305: tmp = x + (((y * 0.279195317918525) + (z * ((0.0692910599291889 * (y * z)) + (y * 0.4917317610505968)))) / t_0) else: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) return tmp
function code(x, y, z) t_0 = Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304) tmp = 0.0 if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / t_0) <= 4e+305) tmp = Float64(x + Float64(Float64(Float64(y * 0.279195317918525) + Float64(z * Float64(Float64(0.0692910599291889 * Float64(y * z)) + Float64(y * 0.4917317610505968)))) / t_0)); else tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304; tmp = 0.0; if (((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / t_0) <= 4e+305) tmp = x + (((y * 0.279195317918525) + (z * ((0.0692910599291889 * (y * z)) + (y * 0.4917317610505968)))) / t_0); else tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]}, If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], 4e+305], N[(x + N[(N[(N[(y * 0.279195317918525), $MachinePrecision] + N[(z * N[(N[(0.0692910599291889 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(y * 0.4917317610505968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304\\
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{t\_0} \leq 4 \cdot 10^{+305}:\\
\;\;\;\;x + \frac{y \cdot 0.279195317918525 + z \cdot \left(0.0692910599291889 \cdot \left(y \cdot z\right) + y \cdot 0.4917317610505968\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < 3.9999999999999998e305Initial program 98.2%
Taylor expanded in z around 0 98.2%
if 3.9999999999999998e305 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) Initial program 0.9%
remove-double-neg0.9%
associate-/l*16.1%
distribute-rgt-neg-in16.1%
distribute-lft-neg-in16.1%
distribute-lft-neg-in16.1%
distribute-rgt-neg-in16.1%
remove-double-neg16.1%
fma-define16.1%
fma-define16.1%
fma-define16.1%
Simplified16.1%
Taylor expanded in z around inf 99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))))
(if (<= t_0 4e+305)
(+ t_0 x)
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z)))))))
double code(double x, double y, double z) {
double t_0 = (y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304);
double tmp;
if (t_0 <= 4e+305) {
tmp = t_0 + x;
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
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 = (y * ((z * ((z * 0.0692910599291889d0) + 0.4917317610505968d0)) + 0.279195317918525d0)) / ((z * (z + 6.012459259764103d0)) + 3.350343815022304d0)
if (t_0 <= 4d+305) then
tmp = t_0 + x
else
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304);
double tmp;
if (t_0 <= 4e+305) {
tmp = t_0 + x;
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
return tmp;
}
def code(x, y, z): t_0 = (y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304) tmp = 0 if t_0 <= 4e+305: tmp = t_0 + x else: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) return tmp
function code(x, y, z) t_0 = Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) tmp = 0.0 if (t_0 <= 4e+305) tmp = Float64(t_0 + x); else tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304); tmp = 0.0; if (t_0 <= 4e+305) tmp = t_0 + x; else tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 4e+305], N[(t$95$0 + x), $MachinePrecision], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{+305}:\\
\;\;\;\;t\_0 + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < 3.9999999999999998e305Initial program 98.2%
if 3.9999999999999998e305 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) Initial program 0.9%
remove-double-neg0.9%
associate-/l*16.1%
distribute-rgt-neg-in16.1%
distribute-lft-neg-in16.1%
distribute-lft-neg-in16.1%
distribute-rgt-neg-in16.1%
remove-double-neg16.1%
fma-define16.1%
fma-define16.1%
fma-define16.1%
Simplified16.1%
Taylor expanded in z around inf 99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(if (<= y -3.4e+20)
(* y 0.08333333333333323)
(if (<= y 1.2e+58)
x
(if (<= y 1.5e+244) (* y 0.0692910599291889) (* y 0.08333333333333323)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.4e+20) {
tmp = y * 0.08333333333333323;
} else if (y <= 1.2e+58) {
tmp = x;
} else if (y <= 1.5e+244) {
tmp = y * 0.0692910599291889;
} else {
tmp = y * 0.08333333333333323;
}
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 <= (-3.4d+20)) then
tmp = y * 0.08333333333333323d0
else if (y <= 1.2d+58) then
tmp = x
else if (y <= 1.5d+244) then
tmp = y * 0.0692910599291889d0
else
tmp = y * 0.08333333333333323d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.4e+20) {
tmp = y * 0.08333333333333323;
} else if (y <= 1.2e+58) {
tmp = x;
} else if (y <= 1.5e+244) {
tmp = y * 0.0692910599291889;
} else {
tmp = y * 0.08333333333333323;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.4e+20: tmp = y * 0.08333333333333323 elif y <= 1.2e+58: tmp = x elif y <= 1.5e+244: tmp = y * 0.0692910599291889 else: tmp = y * 0.08333333333333323 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.4e+20) tmp = Float64(y * 0.08333333333333323); elseif (y <= 1.2e+58) tmp = x; elseif (y <= 1.5e+244) tmp = Float64(y * 0.0692910599291889); else tmp = Float64(y * 0.08333333333333323); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.4e+20) tmp = y * 0.08333333333333323; elseif (y <= 1.2e+58) tmp = x; elseif (y <= 1.5e+244) tmp = y * 0.0692910599291889; else tmp = y * 0.08333333333333323; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.4e+20], N[(y * 0.08333333333333323), $MachinePrecision], If[LessEqual[y, 1.2e+58], x, If[LessEqual[y, 1.5e+244], N[(y * 0.0692910599291889), $MachinePrecision], N[(y * 0.08333333333333323), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+20}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+58}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+244}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\end{array}
\end{array}
if y < -3.4e20 or 1.4999999999999999e244 < y Initial program 70.3%
+-commutative70.3%
*-commutative70.3%
associate-/l*77.9%
fma-define77.8%
*-commutative77.8%
fma-define77.8%
fma-define77.8%
*-commutative77.8%
fma-define77.8%
Simplified77.8%
Taylor expanded in z around 0 75.0%
+-commutative75.0%
Simplified75.0%
Taylor expanded in y around inf 55.1%
if -3.4e20 < y < 1.2e58Initial program 77.2%
+-commutative77.2%
*-commutative77.2%
associate-/l*77.3%
fma-define77.3%
*-commutative77.3%
fma-define77.3%
fma-define77.3%
*-commutative77.3%
fma-define77.3%
Simplified77.3%
Taylor expanded in y around 0 77.0%
if 1.2e58 < y < 1.4999999999999999e244Initial program 57.8%
+-commutative57.8%
*-commutative57.8%
associate-/l*75.7%
fma-define75.6%
*-commutative75.6%
fma-define75.6%
fma-define75.6%
*-commutative75.6%
fma-define75.6%
Simplified75.6%
Taylor expanded in z around inf 75.4%
+-commutative75.4%
Simplified75.4%
Taylor expanded in y around inf 57.1%
Final simplification68.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.7e+18) (not (<= z 9.5e-13))) (+ x (* y 0.0692910599291889)) (+ x (* y 0.08333333333333323))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.7e+18) || !(z <= 9.5e-13)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * 0.08333333333333323);
}
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 <= (-2.7d+18)) .or. (.not. (z <= 9.5d-13))) then
tmp = x + (y * 0.0692910599291889d0)
else
tmp = x + (y * 0.08333333333333323d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.7e+18) || !(z <= 9.5e-13)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * 0.08333333333333323);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.7e+18) or not (z <= 9.5e-13): tmp = x + (y * 0.0692910599291889) else: tmp = x + (y * 0.08333333333333323) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.7e+18) || !(z <= 9.5e-13)) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(x + Float64(y * 0.08333333333333323)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.7e+18) || ~((z <= 9.5e-13))) tmp = x + (y * 0.0692910599291889); else tmp = x + (y * 0.08333333333333323); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.7e+18], N[Not[LessEqual[z, 9.5e-13]], $MachinePrecision]], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.08333333333333323), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+18} \lor \neg \left(z \leq 9.5 \cdot 10^{-13}\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.08333333333333323\\
\end{array}
\end{array}
if z < -2.7e18 or 9.49999999999999991e-13 < z Initial program 45.1%
+-commutative45.1%
*-commutative45.1%
associate-/l*54.6%
fma-define54.6%
*-commutative54.6%
fma-define54.6%
fma-define54.6%
*-commutative54.6%
fma-define54.6%
Simplified54.6%
Taylor expanded in z around inf 99.3%
+-commutative99.3%
Simplified99.3%
if -2.7e18 < z < 9.49999999999999991e-13Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
associate-/l*99.7%
fma-define99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
*-commutative99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in z around 0 99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.4e+78) (not (<= y 7.5e+57))) (* y 0.0692910599291889) x))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.4e+78) || !(y <= 7.5e+57)) {
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 ((y <= (-4.4d+78)) .or. (.not. (y <= 7.5d+57))) 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 ((y <= -4.4e+78) || !(y <= 7.5e+57)) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.4e+78) or not (y <= 7.5e+57): tmp = y * 0.0692910599291889 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.4e+78) || !(y <= 7.5e+57)) tmp = Float64(y * 0.0692910599291889); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.4e+78) || ~((y <= 7.5e+57))) tmp = y * 0.0692910599291889; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.4e+78], N[Not[LessEqual[y, 7.5e+57]], $MachinePrecision]], N[(y * 0.0692910599291889), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+78} \lor \neg \left(y \leq 7.5 \cdot 10^{+57}\right):\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.40000000000000028e78 or 7.5000000000000006e57 < y Initial program 65.7%
+-commutative65.7%
*-commutative65.7%
associate-/l*79.2%
fma-define79.2%
*-commutative79.2%
fma-define79.2%
fma-define79.2%
*-commutative79.2%
fma-define79.2%
Simplified79.2%
Taylor expanded in z around inf 66.0%
+-commutative66.0%
Simplified66.0%
Taylor expanded in y around inf 50.4%
if -4.40000000000000028e78 < y < 7.5000000000000006e57Initial program 75.9%
+-commutative75.9%
*-commutative75.9%
associate-/l*76.1%
fma-define76.1%
*-commutative76.1%
fma-define76.1%
fma-define76.1%
*-commutative76.1%
fma-define76.1%
Simplified76.1%
Taylor expanded in y around 0 74.2%
Final simplification65.9%
(FPCore (x y z) :precision binary64 (if (<= y 2.95e+247) (+ x (* y 0.0692910599291889)) (* y 0.08333333333333323)))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.95e+247) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = y * 0.08333333333333323;
}
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 <= 2.95d+247) then
tmp = x + (y * 0.0692910599291889d0)
else
tmp = y * 0.08333333333333323d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 2.95e+247) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = y * 0.08333333333333323;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2.95e+247: tmp = x + (y * 0.0692910599291889) else: tmp = y * 0.08333333333333323 return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2.95e+247) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(y * 0.08333333333333323); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 2.95e+247) tmp = x + (y * 0.0692910599291889); else tmp = y * 0.08333333333333323; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2.95e+247], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(y * 0.08333333333333323), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.95 \cdot 10^{+247}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\end{array}
\end{array}
if y < 2.9500000000000001e247Initial program 71.9%
+-commutative71.9%
*-commutative71.9%
associate-/l*76.2%
fma-define76.2%
*-commutative76.2%
fma-define76.2%
fma-define76.1%
*-commutative76.1%
fma-define76.1%
Simplified76.1%
Taylor expanded in z around inf 81.9%
+-commutative81.9%
Simplified81.9%
if 2.9500000000000001e247 < y Initial program 83.0%
+-commutative83.0%
*-commutative83.0%
associate-/l*99.4%
fma-define99.3%
*-commutative99.3%
fma-define99.3%
fma-define99.3%
*-commutative99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in z around 0 85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in y around inf 76.5%
Final simplification81.7%
(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 72.4%
+-commutative72.4%
*-commutative72.4%
associate-/l*77.2%
fma-define77.1%
*-commutative77.1%
fma-define77.1%
fma-define77.1%
*-commutative77.1%
fma-define77.1%
Simplified77.1%
Taylor expanded in y around 0 54.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 2024116
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B"
:precision binary64
:alt
(! :herbie-platform default (if (< z -324806146098267/40000000) (- (* (+ (/ 7512208616047561/100000000000000000 z) 692910599291889/10000000000000000) y) (- (/ (* 323697630959937/800000000000000 y) (* z z)) x)) (if (< z 657611897278737700000) (+ x (* (* y (+ (* (+ (* z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (/ 1 (+ (* (+ z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000)))) (- (* (+ (/ 7512208616047561/100000000000000000 z) 692910599291889/10000000000000000) y) (- (/ (* 323697630959937/800000000000000 y) (* z z)) x)))))
(+ x (/ (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))