
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= z -9.2e+56)
(+ x (* y 0.0692910599291889))
(if (<= z 13.0)
(+
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
x)
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -9.2e+56) {
tmp = x + (y * 0.0692910599291889);
} else if (z <= 13.0) {
tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + 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) :: tmp
if (z <= (-9.2d+56)) then
tmp = x + (y * 0.0692910599291889d0)
else if (z <= 13.0d0) then
tmp = ((y * ((z * ((z * 0.0692910599291889d0) + 0.4917317610505968d0)) + 0.279195317918525d0)) / ((z * (z + 6.012459259764103d0)) + 3.350343815022304d0)) + 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 tmp;
if (z <= -9.2e+56) {
tmp = x + (y * 0.0692910599291889);
} else if (z <= 13.0) {
tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x;
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -9.2e+56: tmp = x + (y * 0.0692910599291889) elif z <= 13.0: tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x else: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -9.2e+56) tmp = Float64(x + Float64(y * 0.0692910599291889)); elseif (z <= 13.0) tmp = Float64(Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) + x); else tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -9.2e+56) tmp = x + (y * 0.0692910599291889); elseif (z <= 13.0) tmp = ((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x; else tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -9.2e+56], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 13.0], N[(N[(N[(y * N[(N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+56}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{elif}\;z \leq 13:\\
\;\;\;\;\frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if z < -9.20000000000000058e56Initial program 27.8%
associate-*l/36.5%
*-commutative36.5%
fma-def36.5%
*-commutative36.5%
fma-def36.5%
fma-def36.5%
Simplified36.5%
Taylor expanded in z around inf 99.6%
*-commutative99.6%
Simplified99.6%
if -9.20000000000000058e56 < z < 13Initial program 99.7%
if 13 < z Initial program 33.0%
associate-*l/44.5%
*-commutative44.5%
fma-def44.5%
*-commutative44.5%
fma-def44.5%
fma-def44.5%
Simplified44.5%
Taylor expanded in z around -inf 99.6%
+-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (cbrt (fma z (+ z 6.012459259764103) 3.350343815022304))))
(if (<=
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
5e+302)
(+
x
(*
(/
(fma z (fma z 0.0692910599291889 0.4917317610505968) 0.279195317918525)
(pow t_0 2.0))
(/ y t_0)))
(fma y 0.0692910599291889 x))))
double code(double x, double y, double z) {
double t_0 = cbrt(fma(z, (z + 6.012459259764103), 3.350343815022304));
double tmp;
if (((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) <= 5e+302) {
tmp = x + ((fma(z, fma(z, 0.0692910599291889, 0.4917317610505968), 0.279195317918525) / pow(t_0, 2.0)) * (y / t_0));
} else {
tmp = fma(y, 0.0692910599291889, x);
}
return tmp;
}
function code(x, y, z) t_0 = cbrt(fma(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)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) <= 5e+302) tmp = Float64(x + Float64(Float64(fma(z, fma(z, 0.0692910599291889, 0.4917317610505968), 0.279195317918525) / (t_0 ^ 2.0)) * Float64(y / t_0))); else tmp = fma(y, 0.0692910599291889, x); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Power[N[(z * N[(z + 6.012459259764103), $MachinePrecision] + 3.350343815022304), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision], 5e+302], N[(x + N[(N[(N[(z * N[(z * 0.0692910599291889 + 0.4917317610505968), $MachinePrecision] + 0.279195317918525), $MachinePrecision] / N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 0.0692910599291889 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}\\
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} \leq 5 \cdot 10^{+302}:\\
\;\;\;\;x + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{{t_0}^{2}} \cdot \frac{y}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 0.0692910599291889, x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (+.f64 (*.f64 (+.f64 z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000)) < 5e302Initial program 94.9%
*-commutative94.9%
add-cube-cbrt94.4%
times-frac99.3%
*-commutative99.3%
fma-udef99.3%
fma-def99.3%
pow299.3%
*-commutative99.3%
fma-udef99.3%
*-commutative99.3%
fma-udef99.3%
Applied egg-rr99.3%
if 5e302 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (+.f64 (*.f64 (+.f64 z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000)) Initial program 0.7%
associate-*l/9.0%
*-commutative9.0%
fma-def9.0%
*-commutative9.0%
fma-def9.0%
fma-def9.0%
Simplified9.0%
Taylor expanded in z around inf 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
*-commutative99.6%
fma-def99.6%
Simplified99.6%
Final simplification99.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* z (+ z 6.012459259764103)) 3.350343815022304))
(t_1 (+ (* z 0.0692910599291889) 0.4917317610505968)))
(if (<= (/ (* y (+ (* z t_1) 0.279195317918525)) t_0) INFINITY)
(+ x (* (/ y t_0) (fma z t_1 0.279195317918525)))
(fma y 0.0692910599291889 x))))
double code(double x, double y, double z) {
double t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304;
double t_1 = (z * 0.0692910599291889) + 0.4917317610505968;
double tmp;
if (((y * ((z * t_1) + 0.279195317918525)) / t_0) <= ((double) INFINITY)) {
tmp = x + ((y / t_0) * fma(z, t_1, 0.279195317918525));
} else {
tmp = fma(y, 0.0692910599291889, x);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304) t_1 = Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) tmp = 0.0 if (Float64(Float64(y * Float64(Float64(z * t_1) + 0.279195317918525)) / t_0) <= Inf) tmp = Float64(x + Float64(Float64(y / t_0) * fma(z, t_1, 0.279195317918525))); else tmp = fma(y, 0.0692910599291889, x); end return 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[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]}, If[LessEqual[N[(N[(y * N[(N[(z * t$95$1), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], Infinity], N[(x + N[(N[(y / t$95$0), $MachinePrecision] * N[(z * t$95$1 + 0.279195317918525), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 0.0692910599291889 + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304\\
t_1 := z \cdot 0.0692910599291889 + 0.4917317610505968\\
\mathbf{if}\;\frac{y \cdot \left(z \cdot t_1 + 0.279195317918525\right)}{t_0} \leq \infty:\\
\;\;\;\;x + \frac{y}{t_0} \cdot \mathsf{fma}\left(z, t_1, 0.279195317918525\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 0.0692910599291889, x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (+.f64 (*.f64 (+.f64 z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000)) < +inf.0Initial program 92.1%
associate-*l/98.3%
*-commutative98.3%
fma-def98.3%
*-commutative98.3%
fma-def98.3%
fma-def98.3%
Simplified98.3%
fma-def98.3%
Applied egg-rr98.3%
Taylor expanded in y around 0 98.3%
if +inf.0 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (+.f64 (*.f64 (+.f64 z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000)) Initial program 0.0%
associate-*l/1.4%
*-commutative1.4%
fma-def1.4%
*-commutative1.4%
fma-def1.4%
fma-def1.4%
Simplified1.4%
Taylor expanded in z around inf 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.6%
Simplified99.6%
Final simplification98.7%
(FPCore (x y z)
:precision binary64
(if (<= z -5.5)
(+ x (- (* y 0.0692910599291889) (/ (* y -0.07512208616047561) z)))
(if (<= z 4.4)
(+
x
(+
(* y 0.08333333333333323)
(*
z
(+
(* z (- (* y -0.004191293246138338) (* y -0.004984943827291682)))
(* y -0.00277777777751721)))))
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.5) {
tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z));
} else if (z <= 4.4) {
tmp = x + ((y * 0.08333333333333323) + (z * ((z * ((y * -0.004191293246138338) - (y * -0.004984943827291682))) + (y * -0.00277777777751721))));
} 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 <= (-5.5d0)) then
tmp = x + ((y * 0.0692910599291889d0) - ((y * (-0.07512208616047561d0)) / z))
else if (z <= 4.4d0) then
tmp = x + ((y * 0.08333333333333323d0) + (z * ((z * ((y * (-0.004191293246138338d0)) - (y * (-0.004984943827291682d0)))) + (y * (-0.00277777777751721d0)))))
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 <= -5.5) {
tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z));
} else if (z <= 4.4) {
tmp = x + ((y * 0.08333333333333323) + (z * ((z * ((y * -0.004191293246138338) - (y * -0.004984943827291682))) + (y * -0.00277777777751721))));
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.5: tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z)) elif z <= 4.4: tmp = x + ((y * 0.08333333333333323) + (z * ((z * ((y * -0.004191293246138338) - (y * -0.004984943827291682))) + (y * -0.00277777777751721)))) else: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.5) tmp = Float64(x + Float64(Float64(y * 0.0692910599291889) - Float64(Float64(y * -0.07512208616047561) / z))); elseif (z <= 4.4) tmp = Float64(x + Float64(Float64(y * 0.08333333333333323) + Float64(z * Float64(Float64(z * Float64(Float64(y * -0.004191293246138338) - Float64(y * -0.004984943827291682))) + Float64(y * -0.00277777777751721))))); 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 <= -5.5) tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z)); elseif (z <= 4.4) tmp = x + ((y * 0.08333333333333323) + (z * ((z * ((y * -0.004191293246138338) - (y * -0.004984943827291682))) + (y * -0.00277777777751721)))); else tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.5], N[(x + N[(N[(y * 0.0692910599291889), $MachinePrecision] - N[(N[(y * -0.07512208616047561), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4], N[(x + N[(N[(y * 0.08333333333333323), $MachinePrecision] + N[(z * N[(N[(z * N[(N[(y * -0.004191293246138338), $MachinePrecision] - N[(y * -0.004984943827291682), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * -0.00277777777751721), $MachinePrecision]), $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}\;z \leq -5.5:\\
\;\;\;\;x + \left(y \cdot 0.0692910599291889 - \frac{y \cdot -0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 4.4:\\
\;\;\;\;x + \left(y \cdot 0.08333333333333323 + z \cdot \left(z \cdot \left(y \cdot -0.004191293246138338 - y \cdot -0.004984943827291682\right) + y \cdot -0.00277777777751721\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if z < -5.5Initial program 38.2%
associate-*l/45.7%
*-commutative45.7%
fma-def45.7%
*-commutative45.7%
fma-def45.7%
fma-def45.7%
Simplified45.7%
Taylor expanded in z around -inf 98.3%
+-commutative98.3%
mul-1-neg98.3%
unsub-neg98.3%
*-commutative98.3%
distribute-rgt-out--98.3%
metadata-eval98.3%
Simplified98.3%
if -5.5 < z < 4.4000000000000004Initial program 99.7%
associate-*l/99.6%
*-commutative99.6%
fma-def99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in z around 0 99.5%
*-un-lft-identity99.5%
fma-def99.5%
distribute-rgt-out--99.5%
metadata-eval99.5%
unpow299.5%
*-commutative99.5%
fma-def99.5%
distribute-rgt-out--99.5%
metadata-eval99.5%
Applied egg-rr99.5%
*-lft-identity99.5%
fma-udef99.5%
+-commutative99.5%
associate-*l*99.5%
distribute-lft-out99.5%
Simplified99.5%
if 4.4000000000000004 < z Initial program 33.0%
associate-*l/44.5%
*-commutative44.5%
fma-def44.5%
*-commutative44.5%
fma-def44.5%
fma-def44.5%
Simplified44.5%
Taylor expanded in z around -inf 99.6%
+-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.5) (not (<= z 5.0))) (+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z)))) (+ x (+ (* y 0.08333333333333323) (* -0.00277777777751721 (* y z))))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5) || !(z <= 5.0)) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else {
tmp = x + ((y * 0.08333333333333323) + (-0.00277777777751721 * (y * 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 <= (-5.5d0)) .or. (.not. (z <= 5.0d0))) then
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
else
tmp = x + ((y * 0.08333333333333323d0) + ((-0.00277777777751721d0) * (y * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5) || !(z <= 5.0)) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else {
tmp = x + ((y * 0.08333333333333323) + (-0.00277777777751721 * (y * z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.5) or not (z <= 5.0): tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) else: tmp = x + ((y * 0.08333333333333323) + (-0.00277777777751721 * (y * z))) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.5) || !(z <= 5.0)) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); else tmp = Float64(x + Float64(Float64(y * 0.08333333333333323) + Float64(-0.00277777777751721 * Float64(y * z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.5) || ~((z <= 5.0))) tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); else tmp = x + ((y * 0.08333333333333323) + (-0.00277777777751721 * (y * z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.5], N[Not[LessEqual[z, 5.0]], $MachinePrecision]], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * 0.08333333333333323), $MachinePrecision] + N[(-0.00277777777751721 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \lor \neg \left(z \leq 5\right):\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot 0.08333333333333323 + -0.00277777777751721 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -5.5 or 5 < z Initial program 35.7%
associate-*l/45.1%
*-commutative45.1%
fma-def45.1%
*-commutative45.1%
fma-def45.1%
fma-def45.1%
Simplified45.1%
Taylor expanded in z around -inf 98.9%
+-commutative98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
distribute-rgt-out--98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in y around 0 98.9%
associate-*r/98.9%
metadata-eval98.9%
Simplified98.9%
if -5.5 < z < 5Initial program 99.7%
associate-*l/99.6%
*-commutative99.6%
fma-def99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around 0 99.3%
distribute-rgt-out--99.3%
metadata-eval99.3%
associate-*r*99.3%
*-commutative99.3%
Simplified99.3%
Final simplification99.1%
(FPCore (x y z)
:precision binary64
(if (<= z -5.5)
(+ x (- (* y 0.0692910599291889) (/ (* y -0.07512208616047561) z)))
(if (<= z 5.0)
(+ x (+ (* y 0.08333333333333323) (* -0.00277777777751721 (* y z))))
(+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.5) {
tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z));
} else if (z <= 5.0) {
tmp = x + ((y * 0.08333333333333323) + (-0.00277777777751721 * (y * z)));
} 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 <= (-5.5d0)) then
tmp = x + ((y * 0.0692910599291889d0) - ((y * (-0.07512208616047561d0)) / z))
else if (z <= 5.0d0) then
tmp = x + ((y * 0.08333333333333323d0) + ((-0.00277777777751721d0) * (y * z)))
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 <= -5.5) {
tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z));
} else if (z <= 5.0) {
tmp = x + ((y * 0.08333333333333323) + (-0.00277777777751721 * (y * z)));
} else {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.5: tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z)) elif z <= 5.0: tmp = x + ((y * 0.08333333333333323) + (-0.00277777777751721 * (y * z))) else: tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.5) tmp = Float64(x + Float64(Float64(y * 0.0692910599291889) - Float64(Float64(y * -0.07512208616047561) / z))); elseif (z <= 5.0) tmp = Float64(x + Float64(Float64(y * 0.08333333333333323) + Float64(-0.00277777777751721 * Float64(y * z)))); 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 <= -5.5) tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z)); elseif (z <= 5.0) tmp = x + ((y * 0.08333333333333323) + (-0.00277777777751721 * (y * z))); else tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.5], N[(x + N[(N[(y * 0.0692910599291889), $MachinePrecision] - N[(N[(y * -0.07512208616047561), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.0], N[(x + N[(N[(y * 0.08333333333333323), $MachinePrecision] + N[(-0.00277777777751721 * N[(y * z), $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}\;z \leq -5.5:\\
\;\;\;\;x + \left(y \cdot 0.0692910599291889 - \frac{y \cdot -0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 5:\\
\;\;\;\;x + \left(y \cdot 0.08333333333333323 + -0.00277777777751721 \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if z < -5.5Initial program 38.2%
associate-*l/45.7%
*-commutative45.7%
fma-def45.7%
*-commutative45.7%
fma-def45.7%
fma-def45.7%
Simplified45.7%
Taylor expanded in z around -inf 98.3%
+-commutative98.3%
mul-1-neg98.3%
unsub-neg98.3%
*-commutative98.3%
distribute-rgt-out--98.3%
metadata-eval98.3%
Simplified98.3%
if -5.5 < z < 5Initial program 99.7%
associate-*l/99.6%
*-commutative99.6%
fma-def99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around 0 99.3%
distribute-rgt-out--99.3%
metadata-eval99.3%
associate-*r*99.3%
*-commutative99.3%
Simplified99.3%
if 5 < z Initial program 33.0%
associate-*l/44.5%
*-commutative44.5%
fma-def44.5%
*-commutative44.5%
fma-def44.5%
fma-def44.5%
Simplified44.5%
Taylor expanded in z around -inf 99.6%
+-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.5) (not (<= z 5.4))) (+ x (* y (+ 0.0692910599291889 (/ 0.07512208616047561 z)))) (+ x (* y 0.08333333333333323))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5) || !(z <= 5.4)) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} 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.5d0)) .or. (.not. (z <= 5.4d0))) then
tmp = x + (y * (0.0692910599291889d0 + (0.07512208616047561d0 / z)))
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.5) || !(z <= 5.4)) {
tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z)));
} else {
tmp = x + (y * 0.08333333333333323);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.5) or not (z <= 5.4): tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))) else: tmp = x + (y * 0.08333333333333323) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.5) || !(z <= 5.4)) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 + Float64(0.07512208616047561 / z)))); 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.5) || ~((z <= 5.4))) tmp = x + (y * (0.0692910599291889 + (0.07512208616047561 / z))); else tmp = x + (y * 0.08333333333333323); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.5], N[Not[LessEqual[z, 5.4]], $MachinePrecision]], N[(x + N[(y * N[(0.0692910599291889 + N[(0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.08333333333333323), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \lor \neg \left(z \leq 5.4\right):\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 + \frac{0.07512208616047561}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.08333333333333323\\
\end{array}
\end{array}
if z < -5.5 or 5.4000000000000004 < z Initial program 35.7%
associate-*l/45.1%
*-commutative45.1%
fma-def45.1%
*-commutative45.1%
fma-def45.1%
fma-def45.1%
Simplified45.1%
Taylor expanded in z around -inf 98.9%
+-commutative98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
distribute-rgt-out--98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in y around 0 98.9%
associate-*r/98.9%
metadata-eval98.9%
Simplified98.9%
if -5.5 < z < 5.4000000000000004Initial program 99.7%
associate-*l/99.6%
*-commutative99.6%
fma-def99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in z around 0 98.1%
*-commutative98.1%
Simplified98.1%
Final simplification98.5%
(FPCore (x y z)
:precision binary64
(if (<= x -3.4e-28)
x
(if (<= x -2.7e-265)
(* y 0.08333333333333323)
(if (<= x 1.75e-121) (* y 0.0692910599291889) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-28) {
tmp = x;
} else if (x <= -2.7e-265) {
tmp = y * 0.08333333333333323;
} else if (x <= 1.75e-121) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.4d-28)) then
tmp = x
else if (x <= (-2.7d-265)) then
tmp = y * 0.08333333333333323d0
else if (x <= 1.75d-121) then
tmp = y * 0.0692910599291889d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-28) {
tmp = x;
} else if (x <= -2.7e-265) {
tmp = y * 0.08333333333333323;
} else if (x <= 1.75e-121) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.4e-28: tmp = x elif x <= -2.7e-265: tmp = y * 0.08333333333333323 elif x <= 1.75e-121: tmp = y * 0.0692910599291889 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.4e-28) tmp = x; elseif (x <= -2.7e-265) tmp = Float64(y * 0.08333333333333323); elseif (x <= 1.75e-121) tmp = Float64(y * 0.0692910599291889); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.4e-28) tmp = x; elseif (x <= -2.7e-265) tmp = y * 0.08333333333333323; elseif (x <= 1.75e-121) tmp = y * 0.0692910599291889; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.4e-28], x, If[LessEqual[x, -2.7e-265], N[(y * 0.08333333333333323), $MachinePrecision], If[LessEqual[x, 1.75e-121], N[(y * 0.0692910599291889), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-28}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-265}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-121}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.4000000000000001e-28 or 1.74999999999999996e-121 < x Initial program 66.0%
associate-*l/72.9%
*-commutative72.9%
fma-def72.9%
*-commutative72.9%
fma-def72.9%
fma-def72.9%
Simplified72.9%
Taylor expanded in z around inf 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in x around inf 65.2%
if -3.4000000000000001e-28 < x < -2.7000000000000002e-265Initial program 67.5%
associate-*l/73.3%
*-commutative73.3%
fma-def73.3%
*-commutative73.3%
fma-def73.3%
fma-def73.3%
Simplified73.3%
Taylor expanded in z around 0 74.4%
*-commutative74.4%
Simplified74.4%
flip-+47.6%
Applied egg-rr47.6%
swap-sqr47.4%
metadata-eval47.4%
Simplified47.4%
Taylor expanded in x around 0 52.9%
*-commutative52.9%
Simplified52.9%
if -2.7000000000000002e-265 < x < 1.74999999999999996e-121Initial program 65.8%
associate-*l/63.8%
*-commutative63.8%
fma-def63.8%
*-commutative63.8%
fma-def63.8%
fma-def63.8%
Simplified63.8%
Taylor expanded in z around inf 74.1%
*-commutative74.1%
Simplified74.1%
Taylor expanded in x around 0 74.1%
+-commutative74.1%
*-commutative74.1%
fma-def74.1%
Simplified74.1%
Taylor expanded in y around inf 58.4%
Final simplification61.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.5) (not (<= z 5.5))) (+ x (* y 0.0692910599291889)) (+ x (* y 0.08333333333333323))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5) || !(z <= 5.5)) {
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.5d0)) .or. (.not. (z <= 5.5d0))) 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.5) || !(z <= 5.5)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * 0.08333333333333323);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.5) or not (z <= 5.5): tmp = x + (y * 0.0692910599291889) else: tmp = x + (y * 0.08333333333333323) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.5) || !(z <= 5.5)) 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.5) || ~((z <= 5.5))) 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.5], N[Not[LessEqual[z, 5.5]], $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.5 \lor \neg \left(z \leq 5.5\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.08333333333333323\\
\end{array}
\end{array}
if z < -5.5 or 5.5 < z Initial program 35.7%
associate-*l/45.1%
*-commutative45.1%
fma-def45.1%
*-commutative45.1%
fma-def45.1%
fma-def45.1%
Simplified45.1%
Taylor expanded in z around inf 98.2%
*-commutative98.2%
Simplified98.2%
if -5.5 < z < 5.5Initial program 99.7%
associate-*l/99.6%
*-commutative99.6%
fma-def99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in z around 0 98.1%
*-commutative98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z) :precision binary64 (if (<= x -9.5e-29) x (if (<= x 2e-121) (* y 0.0692910599291889) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -9.5e-29) {
tmp = x;
} else if (x <= 2e-121) {
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 <= (-9.5d-29)) then
tmp = x
else if (x <= 2d-121) 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 <= -9.5e-29) {
tmp = x;
} else if (x <= 2e-121) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9.5e-29: tmp = x elif x <= 2e-121: tmp = y * 0.0692910599291889 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9.5e-29) tmp = x; elseif (x <= 2e-121) tmp = Float64(y * 0.0692910599291889); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9.5e-29) tmp = x; elseif (x <= 2e-121) tmp = y * 0.0692910599291889; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9.5e-29], x, If[LessEqual[x, 2e-121], N[(y * 0.0692910599291889), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-29}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-121}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.50000000000000023e-29 or 2e-121 < x Initial program 66.0%
associate-*l/72.9%
*-commutative72.9%
fma-def72.9%
*-commutative72.9%
fma-def72.9%
fma-def72.9%
Simplified72.9%
Taylor expanded in z around inf 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in x around inf 65.2%
if -9.50000000000000023e-29 < x < 2e-121Initial program 66.5%
associate-*l/67.9%
*-commutative67.9%
fma-def67.9%
*-commutative67.9%
fma-def67.9%
fma-def67.9%
Simplified67.9%
Taylor expanded in z around inf 69.0%
*-commutative69.0%
Simplified69.0%
Taylor expanded in x around 0 69.0%
+-commutative69.0%
*-commutative69.0%
fma-def69.0%
Simplified69.0%
Taylor expanded in y around inf 51.5%
Final simplification60.2%
(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 66.2%
associate-*l/71.1%
*-commutative71.1%
fma-def71.1%
*-commutative71.1%
fma-def71.1%
fma-def71.1%
Simplified71.1%
Taylor expanded in z around inf 79.6%
*-commutative79.6%
Simplified79.6%
Final simplification79.6%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 66.2%
associate-*l/71.1%
*-commutative71.1%
fma-def71.1%
*-commutative71.1%
fma-def71.1%
fma-def71.1%
Simplified71.1%
Taylor expanded in z around inf 79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in x around inf 48.9%
Final simplification48.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 2023275
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(if (< z -8120153.652456675) (- (* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y) (- (/ (* 0.40462203869992125 y) (* z z)) x)) (if (< z 6.576118972787377e+20) (+ x (* (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (/ 1.0 (+ (* (+ z 6.012459259764103) z) 3.350343815022304)))) (- (* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y) (- (/ (* 0.40462203869992125 y) (* z z)) x))))
(+ x (/ (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))