
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
y
(+
0.279195317918525
(* z (+ 0.4917317610505968 (* z 0.0692910599291889)))))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
1e+305)
(+
x
(*
y
(/
(fma (fma z 0.0692910599291889 0.4917317610505968) 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 * (0.279195317918525 + (z * (0.4917317610505968 + (z * 0.0692910599291889))))) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) <= 1e+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);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(y * Float64(0.279195317918525 + Float64(z * Float64(0.4917317610505968 + Float64(z * 0.0692910599291889))))) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) <= 1e+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 * 0.0692910599291889)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(y * N[(0.279195317918525 + N[(z * N[(0.4917317610505968 + N[(z * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision], 1e+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 * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(0.279195317918525 + z \cdot \left(0.4917317610505968 + z \cdot 0.0692910599291889\right)\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} \leq 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 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))) < 9.9999999999999994e304Initial program 95.7%
remove-double-neg95.7%
distribute-lft-neg-out95.7%
distribute-neg-frac95.7%
associate-/l*99.8%
distribute-lft-neg-in99.8%
remove-double-neg99.8%
fma-define99.8%
fma-define99.8%
fma-define99.8%
Simplified99.8%
if 9.9999999999999994e304 < (/.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.3%
+-commutative0.3%
*-commutative0.3%
associate-/l*4.7%
fma-define4.7%
*-commutative4.7%
fma-define4.7%
fma-define4.7%
*-commutative4.7%
fma-define4.7%
Simplified4.7%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.4917317610505968 (* z 0.0692910599291889))))
(if (<= z -4500000000000.0)
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z))))
(if (<= z 810.0)
(+
x
(/
(/
(* y (- (* (pow z 2.0) (pow t_0 2.0)) 0.07795002554762624))
(- (* z t_0) 0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304)))
(+ x (* y 0.0692910599291889))))))
double code(double x, double y, double z) {
double t_0 = 0.4917317610505968 + (z * 0.0692910599291889);
double tmp;
if (z <= -4500000000000.0) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 810.0) {
tmp = x + (((y * ((pow(z, 2.0) * pow(t_0, 2.0)) - 0.07795002554762624)) / ((z * t_0) - 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304));
} else {
tmp = x + (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) :: t_0
real(8) :: tmp
t_0 = 0.4917317610505968d0 + (z * 0.0692910599291889d0)
if (z <= (-4500000000000.0d0)) then
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
else if (z <= 810.0d0) then
tmp = x + (((y * (((z ** 2.0d0) * (t_0 ** 2.0d0)) - 0.07795002554762624d0)) / ((z * t_0) - 0.279195317918525d0)) / ((z * (z + 6.012459259764103d0)) + 3.350343815022304d0))
else
tmp = x + (y * 0.0692910599291889d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.4917317610505968 + (z * 0.0692910599291889);
double tmp;
if (z <= -4500000000000.0) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 810.0) {
tmp = x + (((y * ((Math.pow(z, 2.0) * Math.pow(t_0, 2.0)) - 0.07795002554762624)) / ((z * t_0) - 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304));
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
def code(x, y, z): t_0 = 0.4917317610505968 + (z * 0.0692910599291889) tmp = 0 if z <= -4500000000000.0: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) elif z <= 810.0: tmp = x + (((y * ((math.pow(z, 2.0) * math.pow(t_0, 2.0)) - 0.07795002554762624)) / ((z * t_0) - 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) else: tmp = x + (y * 0.0692910599291889) return tmp
function code(x, y, z) t_0 = Float64(0.4917317610505968 + Float64(z * 0.0692910599291889)) tmp = 0.0 if (z <= -4500000000000.0) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); elseif (z <= 810.0) tmp = Float64(x + Float64(Float64(Float64(y * Float64(Float64((z ^ 2.0) * (t_0 ^ 2.0)) - 0.07795002554762624)) / Float64(Float64(z * t_0) - 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304))); else tmp = Float64(x + Float64(y * 0.0692910599291889)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.4917317610505968 + (z * 0.0692910599291889); tmp = 0.0; if (z <= -4500000000000.0) tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); elseif (z <= 810.0) tmp = x + (((y * (((z ^ 2.0) * (t_0 ^ 2.0)) - 0.07795002554762624)) / ((z * t_0) - 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)); else tmp = x + (y * 0.0692910599291889); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.4917317610505968 + N[(z * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4500000000000.0], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 810.0], N[(x + N[(N[(N[(y * N[(N[(N[Power[z, 2.0], $MachinePrecision] * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] - 0.07795002554762624), $MachinePrecision]), $MachinePrecision] / N[(N[(z * t$95$0), $MachinePrecision] - 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.4917317610505968 + z \cdot 0.0692910599291889\\
\mathbf{if}\;z \leq -4500000000000:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 810:\\
\;\;\;\;x + \frac{\frac{y \cdot \left({z}^{2} \cdot {t\_0}^{2} - 0.07795002554762624\right)}{z \cdot t\_0 - 0.279195317918525}}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if z < -4.5e12Initial program 36.4%
remove-double-neg36.4%
distribute-lft-neg-out36.4%
distribute-neg-frac36.4%
associate-/l*44.1%
distribute-lft-neg-in44.1%
remove-double-neg44.1%
fma-define44.1%
fma-define44.1%
fma-define44.1%
Simplified44.1%
Taylor expanded in z around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
if -4.5e12 < z < 810Initial program 99.7%
distribute-lft-in99.7%
flip-+75.1%
*-commutative75.1%
fma-define75.1%
*-commutative75.1%
fma-define75.1%
*-commutative75.1%
fma-define75.1%
Applied egg-rr75.1%
swap-sqr74.0%
unpow274.0%
swap-sqr73.8%
metadata-eval74.0%
distribute-lft-out--74.0%
Simplified74.0%
Taylor expanded in y around 0 99.8%
if 810 < z Initial program 41.5%
+-commutative41.5%
*-commutative41.5%
associate-/l*50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
Simplified50.0%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (or (<= z -2.7e+81) (not (<= z 810.0)))
(+ x (* y 0.0692910599291889))
(+
(/
(*
y
(+
0.279195317918525
(* z (+ 0.4917317610505968 (* z 0.0692910599291889)))))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.7e+81) || !(z <= 810.0)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = ((y * (0.279195317918525 + (z * (0.4917317610505968 + (z * 0.0692910599291889))))) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-2.7d+81)) .or. (.not. (z <= 810.0d0))) then
tmp = x + (y * 0.0692910599291889d0)
else
tmp = ((y * (0.279195317918525d0 + (z * (0.4917317610505968d0 + (z * 0.0692910599291889d0))))) / ((z * (z + 6.012459259764103d0)) + 3.350343815022304d0)) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.7e+81) || !(z <= 810.0)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = ((y * (0.279195317918525 + (z * (0.4917317610505968 + (z * 0.0692910599291889))))) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.7e+81) or not (z <= 810.0): tmp = x + (y * 0.0692910599291889) else: tmp = ((y * (0.279195317918525 + (z * (0.4917317610505968 + (z * 0.0692910599291889))))) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.7e+81) || !(z <= 810.0)) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(Float64(Float64(y * Float64(0.279195317918525 + Float64(z * Float64(0.4917317610505968 + Float64(z * 0.0692910599291889))))) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.7e+81) || ~((z <= 810.0))) tmp = x + (y * 0.0692910599291889); else tmp = ((y * (0.279195317918525 + (z * (0.4917317610505968 + (z * 0.0692910599291889))))) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.7e+81], N[Not[LessEqual[z, 810.0]], $MachinePrecision]], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(0.279195317918525 + N[(z * N[(0.4917317610505968 + N[(z * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+81} \lor \neg \left(z \leq 810\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(0.279195317918525 + z \cdot \left(0.4917317610505968 + z \cdot 0.0692910599291889\right)\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} + x\\
\end{array}
\end{array}
if z < -2.6999999999999999e81 or 810 < z Initial program 31.9%
+-commutative31.9%
*-commutative31.9%
associate-/l*40.3%
fma-define40.3%
*-commutative40.3%
fma-define40.3%
fma-define40.3%
*-commutative40.3%
fma-define40.3%
Simplified40.3%
Taylor expanded in z around inf 99.6%
+-commutative99.6%
*-commutative99.6%
Simplified99.6%
if -2.6999999999999999e81 < z < 810Initial program 99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+
x
(*
y
(-
0.0692910599291889
(/ (+ (/ 0.4046220386999212 z) -0.07512208616047561) z))))
(if (<= z 2.7)
(+
x
(*
y
(+
0.08333333333333323
(*
z
(-
(* z (+ 0.0007936505811533442 (* z -0.0005951669793454025)))
0.00277777777751721)))))
(+ x (* y 0.0692910599291889)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y * (0.0692910599291889 - (((0.4046220386999212 / z) + -0.07512208616047561) / z)));
} else if (z <= 2.7) {
tmp = x + (y * (0.08333333333333323 + (z * ((z * (0.0007936505811533442 + (z * -0.0005951669793454025))) - 0.00277777777751721))));
} else {
tmp = x + (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 (z <= (-5.4d0)) then
tmp = x + (y * (0.0692910599291889d0 - (((0.4046220386999212d0 / z) + (-0.07512208616047561d0)) / z)))
else if (z <= 2.7d0) then
tmp = x + (y * (0.08333333333333323d0 + (z * ((z * (0.0007936505811533442d0 + (z * (-0.0005951669793454025d0)))) - 0.00277777777751721d0))))
else
tmp = x + (y * 0.0692910599291889d0)
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 * (0.0692910599291889 - (((0.4046220386999212 / z) + -0.07512208616047561) / z)));
} else if (z <= 2.7) {
tmp = x + (y * (0.08333333333333323 + (z * ((z * (0.0007936505811533442 + (z * -0.0005951669793454025))) - 0.00277777777751721))));
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4: tmp = x + (y * (0.0692910599291889 - (((0.4046220386999212 / z) + -0.07512208616047561) / z))) elif z <= 2.7: tmp = x + (y * (0.08333333333333323 + (z * ((z * (0.0007936505811533442 + (z * -0.0005951669793454025))) - 0.00277777777751721)))) else: tmp = x + (y * 0.0692910599291889) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 - Float64(Float64(Float64(0.4046220386999212 / z) + -0.07512208616047561) / z)))); elseif (z <= 2.7) tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(z * Float64(Float64(z * Float64(0.0007936505811533442 + Float64(z * -0.0005951669793454025))) - 0.00277777777751721))))); else tmp = Float64(x + Float64(y * 0.0692910599291889)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4) tmp = x + (y * (0.0692910599291889 - (((0.4046220386999212 / z) + -0.07512208616047561) / z))); elseif (z <= 2.7) tmp = x + (y * (0.08333333333333323 + (z * ((z * (0.0007936505811533442 + (z * -0.0005951669793454025))) - 0.00277777777751721)))); else tmp = x + (y * 0.0692910599291889); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4], N[(x + N[(y * N[(0.0692910599291889 - N[(N[(N[(0.4046220386999212 / z), $MachinePrecision] + -0.07512208616047561), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7], N[(x + N[(y * N[(0.08333333333333323 + N[(z * N[(N[(z * N[(0.0007936505811533442 + N[(z * -0.0005951669793454025), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 - \frac{\frac{0.4046220386999212}{z} + -0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 2.7:\\
\;\;\;\;x + y \cdot \left(0.08333333333333323 + z \cdot \left(z \cdot \left(0.0007936505811533442 + z \cdot -0.0005951669793454025\right) - 0.00277777777751721\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if z < -5.4000000000000004Initial program 39.4%
remove-double-neg39.4%
distribute-lft-neg-out39.4%
distribute-neg-frac39.4%
associate-/l*46.7%
distribute-lft-neg-in46.7%
remove-double-neg46.7%
fma-define46.7%
fma-define46.7%
fma-define46.7%
Simplified46.7%
Taylor expanded in z around -inf 98.0%
mul-1-neg98.0%
unsub-neg98.0%
sub-neg98.0%
associate-*r/98.0%
metadata-eval98.0%
metadata-eval98.0%
Simplified98.0%
if -5.4000000000000004 < z < 2.7000000000000002Initial program 99.7%
remove-double-neg99.7%
distribute-lft-neg-out99.7%
distribute-neg-frac99.7%
associate-/l*99.9%
distribute-lft-neg-in99.9%
remove-double-neg99.9%
fma-define99.9%
fma-define99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around 0 99.6%
if 2.7000000000000002 < z Initial program 41.5%
+-commutative41.5%
*-commutative41.5%
associate-/l*50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
Simplified50.0%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+
x
(*
y
(-
0.0692910599291889
(/ (+ (/ 0.4046220386999212 z) -0.07512208616047561) z))))
(if (<= z 4.4)
(+
x
(*
y
(+
0.08333333333333323
(* z (- (* z 0.0007936505811533442) 0.00277777777751721)))))
(+ x (* y 0.0692910599291889)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y * (0.0692910599291889 - (((0.4046220386999212 / z) + -0.07512208616047561) / z)));
} else if (z <= 4.4) {
tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721))));
} else {
tmp = x + (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 (z <= (-5.4d0)) then
tmp = x + (y * (0.0692910599291889d0 - (((0.4046220386999212d0 / z) + (-0.07512208616047561d0)) / z)))
else if (z <= 4.4d0) then
tmp = x + (y * (0.08333333333333323d0 + (z * ((z * 0.0007936505811533442d0) - 0.00277777777751721d0))))
else
tmp = x + (y * 0.0692910599291889d0)
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 * (0.0692910599291889 - (((0.4046220386999212 / z) + -0.07512208616047561) / z)));
} else if (z <= 4.4) {
tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721))));
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4: tmp = x + (y * (0.0692910599291889 - (((0.4046220386999212 / z) + -0.07512208616047561) / z))) elif z <= 4.4: tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721)))) else: tmp = x + (y * 0.0692910599291889) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 - Float64(Float64(Float64(0.4046220386999212 / z) + -0.07512208616047561) / z)))); elseif (z <= 4.4) tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(z * Float64(Float64(z * 0.0007936505811533442) - 0.00277777777751721))))); else tmp = Float64(x + Float64(y * 0.0692910599291889)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4) tmp = x + (y * (0.0692910599291889 - (((0.4046220386999212 / z) + -0.07512208616047561) / z))); elseif (z <= 4.4) tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721)))); else tmp = x + (y * 0.0692910599291889); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4], N[(x + N[(y * N[(0.0692910599291889 - N[(N[(N[(0.4046220386999212 / z), $MachinePrecision] + -0.07512208616047561), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4], N[(x + N[(y * N[(0.08333333333333323 + N[(z * N[(N[(z * 0.0007936505811533442), $MachinePrecision] - 0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 - \frac{\frac{0.4046220386999212}{z} + -0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 4.4:\\
\;\;\;\;x + y \cdot \left(0.08333333333333323 + z \cdot \left(z \cdot 0.0007936505811533442 - 0.00277777777751721\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if z < -5.4000000000000004Initial program 39.4%
remove-double-neg39.4%
distribute-lft-neg-out39.4%
distribute-neg-frac39.4%
associate-/l*46.7%
distribute-lft-neg-in46.7%
remove-double-neg46.7%
fma-define46.7%
fma-define46.7%
fma-define46.7%
Simplified46.7%
Taylor expanded in z around -inf 98.0%
mul-1-neg98.0%
unsub-neg98.0%
sub-neg98.0%
associate-*r/98.0%
metadata-eval98.0%
metadata-eval98.0%
Simplified98.0%
if -5.4000000000000004 < z < 4.4000000000000004Initial program 99.7%
remove-double-neg99.7%
distribute-lft-neg-out99.7%
distribute-neg-frac99.7%
associate-/l*99.9%
distribute-lft-neg-in99.9%
remove-double-neg99.9%
fma-define99.9%
fma-define99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around 0 99.4%
if 4.4000000000000004 < z Initial program 41.5%
+-commutative41.5%
*-commutative41.5%
associate-/l*50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
Simplified50.0%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.1%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z))))
(if (<= z 4.4)
(+
x
(*
y
(+
0.08333333333333323
(* z (- (* z 0.0007936505811533442) 0.00277777777751721)))))
(+ x (* y 0.0692910599291889)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 4.4) {
tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721))));
} else {
tmp = x + (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 (z <= (-5.4d0)) then
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
else if (z <= 4.4d0) then
tmp = x + (y * (0.08333333333333323d0 + (z * ((z * 0.0007936505811533442d0) - 0.00277777777751721d0))))
else
tmp = x + (y * 0.0692910599291889d0)
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 * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 4.4) {
tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721))));
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) elif z <= 4.4: tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721)))) else: tmp = x + (y * 0.0692910599291889) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); elseif (z <= 4.4) tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(z * Float64(Float64(z * 0.0007936505811533442) - 0.00277777777751721))))); else tmp = Float64(x + Float64(y * 0.0692910599291889)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4) tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); elseif (z <= 4.4) tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721)))); else tmp = x + (y * 0.0692910599291889); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4], N[(x + N[(y * N[(0.08333333333333323 + N[(z * N[(N[(z * 0.0007936505811533442), $MachinePrecision] - 0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 4.4:\\
\;\;\;\;x + y \cdot \left(0.08333333333333323 + z \cdot \left(z \cdot 0.0007936505811533442 - 0.00277777777751721\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if z < -5.4000000000000004Initial program 39.4%
remove-double-neg39.4%
distribute-lft-neg-out39.4%
distribute-neg-frac39.4%
associate-/l*46.7%
distribute-lft-neg-in46.7%
remove-double-neg46.7%
fma-define46.7%
fma-define46.7%
fma-define46.7%
Simplified46.7%
Taylor expanded in z around inf 97.7%
associate-*r/97.7%
metadata-eval97.7%
Simplified97.7%
if -5.4000000000000004 < z < 4.4000000000000004Initial program 99.7%
remove-double-neg99.7%
distribute-lft-neg-out99.7%
distribute-neg-frac99.7%
associate-/l*99.9%
distribute-lft-neg-in99.9%
remove-double-neg99.9%
fma-define99.9%
fma-define99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around 0 99.4%
if 4.4000000000000004 < z Initial program 41.5%
+-commutative41.5%
*-commutative41.5%
associate-/l*50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
Simplified50.0%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.1%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z))))
(if (<= z 5.0)
(+ x (+ (* y 0.08333333333333323) (* z (* y -0.00277777777751721))))
(+ x (* y 0.0692910599291889)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 5.0) {
tmp = x + ((y * 0.08333333333333323) + (z * (y * -0.00277777777751721)));
} else {
tmp = x + (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 (z <= (-5.4d0)) then
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
else if (z <= 5.0d0) then
tmp = x + ((y * 0.08333333333333323d0) + (z * (y * (-0.00277777777751721d0))))
else
tmp = x + (y * 0.0692910599291889d0)
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 * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 5.0) {
tmp = x + ((y * 0.08333333333333323) + (z * (y * -0.00277777777751721)));
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) elif z <= 5.0: tmp = x + ((y * 0.08333333333333323) + (z * (y * -0.00277777777751721))) else: tmp = x + (y * 0.0692910599291889) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); elseif (z <= 5.0) tmp = Float64(x + Float64(Float64(y * 0.08333333333333323) + Float64(z * Float64(y * -0.00277777777751721)))); else tmp = Float64(x + Float64(y * 0.0692910599291889)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4) tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); elseif (z <= 5.0) tmp = x + ((y * 0.08333333333333323) + (z * (y * -0.00277777777751721))); else tmp = x + (y * 0.0692910599291889); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.0], N[(x + N[(N[(y * 0.08333333333333323), $MachinePrecision] + N[(z * N[(y * -0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 5:\\
\;\;\;\;x + \left(y \cdot 0.08333333333333323 + z \cdot \left(y \cdot -0.00277777777751721\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if z < -5.4000000000000004Initial program 39.4%
remove-double-neg39.4%
distribute-lft-neg-out39.4%
distribute-neg-frac39.4%
associate-/l*46.7%
distribute-lft-neg-in46.7%
remove-double-neg46.7%
fma-define46.7%
fma-define46.7%
fma-define46.7%
Simplified46.7%
Taylor expanded in z around inf 97.7%
associate-*r/97.7%
metadata-eval97.7%
Simplified97.7%
if -5.4000000000000004 < z < 5Initial program 99.7%
remove-double-neg99.7%
distribute-lft-neg-out99.7%
distribute-neg-frac99.7%
associate-/l*99.9%
distribute-lft-neg-in99.9%
remove-double-neg99.9%
fma-define99.9%
fma-define99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around 0 99.2%
Taylor expanded in y around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 5 < z Initial program 41.5%
+-commutative41.5%
*-commutative41.5%
associate-/l*50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
Simplified50.0%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.0%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z))))
(if (<= z 5.0)
(+ x (* y (+ 0.08333333333333323 (* z -0.00277777777751721))))
(+ x (* y 0.0692910599291889)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 5.0) {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
} else {
tmp = x + (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 (z <= (-5.4d0)) then
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
else if (z <= 5.0d0) then
tmp = x + (y * (0.08333333333333323d0 + (z * (-0.00277777777751721d0))))
else
tmp = x + (y * 0.0692910599291889d0)
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 * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 5.0) {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) elif z <= 5.0: tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))) else: tmp = x + (y * 0.0692910599291889) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); elseif (z <= 5.0) tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(z * -0.00277777777751721)))); else tmp = Float64(x + Float64(y * 0.0692910599291889)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4) tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); elseif (z <= 5.0) tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))); else tmp = x + (y * 0.0692910599291889); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.0], N[(x + N[(y * N[(0.08333333333333323 + N[(z * -0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 5:\\
\;\;\;\;x + y \cdot \left(0.08333333333333323 + z \cdot -0.00277777777751721\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if z < -5.4000000000000004Initial program 39.4%
remove-double-neg39.4%
distribute-lft-neg-out39.4%
distribute-neg-frac39.4%
associate-/l*46.7%
distribute-lft-neg-in46.7%
remove-double-neg46.7%
fma-define46.7%
fma-define46.7%
fma-define46.7%
Simplified46.7%
Taylor expanded in z around inf 97.7%
associate-*r/97.7%
metadata-eval97.7%
Simplified97.7%
if -5.4000000000000004 < z < 5Initial program 99.7%
remove-double-neg99.7%
distribute-lft-neg-out99.7%
distribute-neg-frac99.7%
associate-/l*99.9%
distribute-lft-neg-in99.9%
remove-double-neg99.9%
fma-define99.9%
fma-define99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 5 < z Initial program 41.5%
+-commutative41.5%
*-commutative41.5%
associate-/l*50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
Simplified50.0%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
Final simplification98.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.4) (not (<= z 6.2))) (+ x (* y 0.0692910599291889)) (+ x (* y 0.08333333333333323))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.4) || !(z <= 6.2)) {
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 <= (-5.4d0)) .or. (.not. (z <= 6.2d0))) 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 <= -5.4) || !(z <= 6.2)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * 0.08333333333333323);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.4) or not (z <= 6.2): tmp = x + (y * 0.0692910599291889) else: tmp = x + (y * 0.08333333333333323) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.4) || !(z <= 6.2)) 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 <= -5.4) || ~((z <= 6.2))) tmp = x + (y * 0.0692910599291889); else tmp = x + (y * 0.08333333333333323); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.4], N[Not[LessEqual[z, 6.2]], $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 -5.4 \lor \neg \left(z \leq 6.2\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.08333333333333323\\
\end{array}
\end{array}
if z < -5.4000000000000004 or 6.20000000000000018 < z Initial program 40.4%
+-commutative40.4%
*-commutative40.4%
associate-/l*47.7%
fma-define47.7%
*-commutative47.7%
fma-define47.7%
fma-define47.7%
*-commutative47.7%
fma-define47.7%
Simplified47.7%
Taylor expanded in z around inf 98.3%
+-commutative98.3%
*-commutative98.3%
Simplified98.3%
if -5.4000000000000004 < z < 6.20000000000000018Initial 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 98.8%
+-commutative98.8%
*-commutative98.8%
Simplified98.8%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z))))
(if (<= z 5.8)
(+ x (* y 0.08333333333333323))
(+ x (* y 0.0692910599291889)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 5.8) {
tmp = x + (y * 0.08333333333333323);
} else {
tmp = x + (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 (z <= (-5.4d0)) then
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
else if (z <= 5.8d0) then
tmp = x + (y * 0.08333333333333323d0)
else
tmp = x + (y * 0.0692910599291889d0)
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 * (0.0692910599291889 + (0.07512208616047561 / z)));
} else if (z <= 5.8) {
tmp = x + (y * 0.08333333333333323);
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) elif z <= 5.8: tmp = x + (y * 0.08333333333333323) else: tmp = x + (y * 0.0692910599291889) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); elseif (z <= 5.8) tmp = Float64(x + Float64(y * 0.08333333333333323)); else tmp = Float64(x + Float64(y * 0.0692910599291889)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4) tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); elseif (z <= 5.8) tmp = x + (y * 0.08333333333333323); else tmp = x + (y * 0.0692910599291889); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8], N[(x + N[(y * 0.08333333333333323), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 5.8:\\
\;\;\;\;x + y \cdot 0.08333333333333323\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if z < -5.4000000000000004Initial program 39.4%
remove-double-neg39.4%
distribute-lft-neg-out39.4%
distribute-neg-frac39.4%
associate-/l*46.7%
distribute-lft-neg-in46.7%
remove-double-neg46.7%
fma-define46.7%
fma-define46.7%
fma-define46.7%
Simplified46.7%
Taylor expanded in z around inf 97.7%
associate-*r/97.7%
metadata-eval97.7%
Simplified97.7%
if -5.4000000000000004 < z < 5.79999999999999982Initial 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 98.8%
+-commutative98.8%
*-commutative98.8%
Simplified98.8%
if 5.79999999999999982 < z Initial program 41.5%
+-commutative41.5%
*-commutative41.5%
associate-/l*50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
fma-define50.0%
*-commutative50.0%
fma-define50.0%
Simplified50.0%
Taylor expanded in z around inf 99.7%
+-commutative99.7%
*-commutative99.7%
Simplified99.7%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (if (<= x -1.06e-38) x (if (<= x 1.15e-18) (* y 0.0692910599291889) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.06e-38) {
tmp = x;
} else if (x <= 1.15e-18) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.06d-38)) then
tmp = x
else if (x <= 1.15d-18) then
tmp = y * 0.0692910599291889d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.06e-38) {
tmp = x;
} else if (x <= 1.15e-18) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.06e-38: tmp = x elif x <= 1.15e-18: tmp = y * 0.0692910599291889 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.06e-38) tmp = x; elseif (x <= 1.15e-18) tmp = Float64(y * 0.0692910599291889); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.06e-38) tmp = x; elseif (x <= 1.15e-18) tmp = y * 0.0692910599291889; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.06e-38], x, If[LessEqual[x, 1.15e-18], N[(y * 0.0692910599291889), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.06 \cdot 10^{-38}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-18}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.06000000000000001e-38 or 1.15e-18 < x Initial program 69.2%
+-commutative69.2%
*-commutative69.2%
associate-/l*73.7%
fma-define73.7%
*-commutative73.7%
fma-define73.7%
fma-define73.7%
*-commutative73.7%
fma-define73.7%
Simplified73.7%
Taylor expanded in y around 0 78.6%
if -1.06000000000000001e-38 < x < 1.15e-18Initial program 75.4%
+-commutative75.4%
*-commutative75.4%
associate-/l*77.4%
fma-define77.4%
*-commutative77.4%
fma-define77.4%
fma-define77.4%
*-commutative77.4%
fma-define77.4%
Simplified77.4%
Taylor expanded in z around inf 62.6%
+-commutative62.6%
*-commutative62.6%
Simplified62.6%
Taylor expanded in y around inf 62.6%
+-commutative62.6%
Simplified62.6%
Taylor expanded in x around 0 46.5%
(FPCore (x y z) :precision binary64 (+ x (* y 0.0692910599291889)))
double code(double x, double y, double z) {
return x + (y * 0.0692910599291889);
}
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 * 0.0692910599291889d0)
end function
public static double code(double x, double y, double z) {
return x + (y * 0.0692910599291889);
}
def code(x, y, z): return x + (y * 0.0692910599291889)
function code(x, y, z) return Float64(x + Float64(y * 0.0692910599291889)) end
function tmp = code(x, y, z) tmp = x + (y * 0.0692910599291889); end
code[x_, y_, z_] := N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot 0.0692910599291889
\end{array}
Initial program 71.9%
+-commutative71.9%
*-commutative71.9%
associate-/l*75.3%
fma-define75.3%
*-commutative75.3%
fma-define75.3%
fma-define75.3%
*-commutative75.3%
fma-define75.3%
Simplified75.3%
Taylor expanded in z around inf 78.5%
+-commutative78.5%
*-commutative78.5%
Simplified78.5%
Final simplification78.5%
(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 71.9%
+-commutative71.9%
*-commutative71.9%
associate-/l*75.3%
fma-define75.3%
*-commutative75.3%
fma-define75.3%
fma-define75.3%
*-commutative75.3%
fma-define75.3%
Simplified75.3%
Taylor expanded in y around 0 52.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 2024158
(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))))