
(FPCore (x y z t a b)
:precision binary64
(+
x
(/
(*
y
(+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b))
(+
(* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z)
0.607771387771))))
double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x + ((y * ((((((((z * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407d0) * z) + 31.4690115749d0) * z) + 11.9400905721d0) * z) + 0.607771387771d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
def code(x, y, z, t, a, b): return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))
function code(x, y, z, t, a, b) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) end
function tmp = code(x, y, z, t, a, b) tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771)); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b)
:precision binary64
(+
x
(/
(*
y
(+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b))
(+
(* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z)
0.607771387771))))
double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x + ((y * ((((((((z * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407d0) * z) + 31.4690115749d0) * z) + 11.9400905721d0) * z) + 0.607771387771d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
def code(x, y, z, t, a, b): return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))
function code(x, y, z, t, a, b) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) end
function tmp = code(x, y, z, t, a, b) tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771)); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(if (<=
(/
(*
y
(+
(* z (+ (* z (+ (* z (+ (* z 3.13060547623) 11.1667541262)) t)) a))
b))
(+
(*
z
(+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
0.607771387771))
INFINITY)
(fma
(fma z (fma z (fma z (fma z 3.13060547623 11.1667541262) t) a) b)
(/
y
(fma
z
(fma z (fma z (+ z 15.234687407) 31.4690115749) 11.9400905721)
0.607771387771))
x)
(+
(fma y 3.13060547623 x)
(-
(fma y (/ 11.1667541262 z) (* t (/ y (* z z))))
(fma
y
(/ 47.69379582500642 z)
(fma
y
(/ 98.5170599679272 (* z z))
(/ (* y -556.47806218377) (* z z))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * ((z * ((z * ((z * ((z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= ((double) INFINITY)) {
tmp = fma(fma(z, fma(z, fma(z, fma(z, 3.13060547623, 11.1667541262), t), a), b), (y / fma(z, fma(z, fma(z, (z + 15.234687407), 31.4690115749), 11.9400905721), 0.607771387771)), x);
} else {
tmp = fma(y, 3.13060547623, x) + (fma(y, (11.1667541262 / z), (t * (y / (z * z)))) - fma(y, (47.69379582500642 / z), fma(y, (98.5170599679272 / (z * z)), ((y * -556.47806218377) / (z * z)))));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= Inf) tmp = fma(fma(z, fma(z, fma(z, fma(z, 3.13060547623, 11.1667541262), t), a), b), Float64(y / fma(z, fma(z, fma(z, Float64(z + 15.234687407), 31.4690115749), 11.9400905721), 0.607771387771)), x); else tmp = Float64(fma(y, 3.13060547623, x) + Float64(fma(y, Float64(11.1667541262 / z), Float64(t * Float64(y / Float64(z * z)))) - fma(y, Float64(47.69379582500642 / z), fma(y, Float64(98.5170599679272 / Float64(z * z)), Float64(Float64(y * -556.47806218377) / Float64(z * z)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * N[(N[(z * N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(N[(z * N[(N[(z * N[(z + 15.234687407), $MachinePrecision]), $MachinePrecision] + 31.4690115749), $MachinePrecision]), $MachinePrecision] + 11.9400905721), $MachinePrecision]), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * N[(z * N[(z * N[(z * 3.13060547623 + 11.1667541262), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + b), $MachinePrecision] * N[(y / N[(z * N[(z * N[(z * N[(z + 15.234687407), $MachinePrecision] + 31.4690115749), $MachinePrecision] + 11.9400905721), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(y * 3.13060547623 + x), $MachinePrecision] + N[(N[(y * N[(11.1667541262 / z), $MachinePrecision] + N[(t * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(47.69379582500642 / z), $MachinePrecision] + N[(y * N[(98.5170599679272 / N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(N[(y * -556.47806218377), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right), b\right), \frac{y}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z + 15.234687407, 31.4690115749\right), 11.9400905721\right), 0.607771387771\right)}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right) + \left(\mathsf{fma}\left(y, \frac{11.1667541262}{z}, t \cdot \frac{y}{z \cdot z}\right) - \mathsf{fma}\left(y, \frac{47.69379582500642}{z}, \mathsf{fma}\left(y, \frac{98.5170599679272}{z \cdot z}, \frac{y \cdot -556.47806218377}{z \cdot z}\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) < +inf.0Initial program 96.4%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr98.3%
if +inf.0 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) Initial program 0.0%
Taylor expanded in z around inf
Simplified98.6%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* y 1.6453555072203998)))
(t_2
(/
(*
y
(+
(* z (+ (* z (+ (* z (+ (* z 3.13060547623) 11.1667541262)) t)) a))
b))
(+
(*
z
(+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
0.607771387771))))
(if (<= t_2 -2e+149)
t_1
(if (<= t_2 1e+151)
x
(if (<= t_2 INFINITY) t_1 (fma y 3.13060547623 x))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (y * 1.6453555072203998);
double t_2 = (y * ((z * ((z * ((z * ((z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771);
double tmp;
if (t_2 <= -2e+149) {
tmp = t_1;
} else if (t_2 <= 1e+151) {
tmp = x;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(y, 3.13060547623, x);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(y * 1.6453555072203998)) t_2 = Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) tmp = 0.0 if (t_2 <= -2e+149) tmp = t_1; elseif (t_2 <= 1e+151) tmp = x; elseif (t_2 <= Inf) tmp = t_1; else tmp = fma(y, 3.13060547623, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y * 1.6453555072203998), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(N[(z * N[(N[(z * N[(N[(z * N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(N[(z * N[(N[(z * N[(z + 15.234687407), $MachinePrecision]), $MachinePrecision] + 31.4690115749), $MachinePrecision]), $MachinePrecision] + 11.9400905721), $MachinePrecision]), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+149], t$95$1, If[LessEqual[t$95$2, 1e+151], x, If[LessEqual[t$95$2, Infinity], t$95$1, N[(y * 3.13060547623 + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(y \cdot 1.6453555072203998\right)\\
t_2 := \frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+151}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) < -2.0000000000000001e149 or 1.00000000000000002e151 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) < +inf.0Initial program 90.7%
Taylor expanded in x around inf
Simplified73.3%
Taylor expanded in z around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6468.1
Simplified68.1%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6461.8
Simplified61.8%
if -2.0000000000000001e149 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) < 1.00000000000000002e151Initial program 99.7%
Taylor expanded in x around inf
Simplified65.3%
if +inf.0 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) Initial program 0.0%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6496.2
Simplified96.2%
Final simplification77.8%
(FPCore (x y z t a b)
:precision binary64
(if (<=
(/
(*
y
(+
(* z (+ (* z (+ (* z (+ (* z 3.13060547623) 11.1667541262)) t)) a))
b))
(+
(*
z
(+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
0.607771387771))
INFINITY)
(fma
(fma z (fma z (fma z (fma z 3.13060547623 11.1667541262) t) a) b)
(/
y
(fma
z
(fma z (fma z (+ z 15.234687407) 31.4690115749) 11.9400905721)
0.607771387771))
x)
(+ (fma y 3.13060547623 x) (* t (/ y (* z z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * ((z * ((z * ((z * ((z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= ((double) INFINITY)) {
tmp = fma(fma(z, fma(z, fma(z, fma(z, 3.13060547623, 11.1667541262), t), a), b), (y / fma(z, fma(z, fma(z, (z + 15.234687407), 31.4690115749), 11.9400905721), 0.607771387771)), x);
} else {
tmp = fma(y, 3.13060547623, x) + (t * (y / (z * z)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= Inf) tmp = fma(fma(z, fma(z, fma(z, fma(z, 3.13060547623, 11.1667541262), t), a), b), Float64(y / fma(z, fma(z, fma(z, Float64(z + 15.234687407), 31.4690115749), 11.9400905721), 0.607771387771)), x); else tmp = Float64(fma(y, 3.13060547623, x) + Float64(t * Float64(y / Float64(z * z)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * N[(N[(z * N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(N[(z * N[(N[(z * N[(z + 15.234687407), $MachinePrecision]), $MachinePrecision] + 31.4690115749), $MachinePrecision]), $MachinePrecision] + 11.9400905721), $MachinePrecision]), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * N[(z * N[(z * N[(z * 3.13060547623 + 11.1667541262), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + b), $MachinePrecision] * N[(y / N[(z * N[(z * N[(z * N[(z + 15.234687407), $MachinePrecision] + 31.4690115749), $MachinePrecision] + 11.9400905721), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(y * 3.13060547623 + x), $MachinePrecision] + N[(t * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right), b\right), \frac{y}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z + 15.234687407, 31.4690115749\right), 11.9400905721\right), 0.607771387771\right)}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right) + t \cdot \frac{y}{z \cdot z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) < +inf.0Initial program 96.4%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr98.3%
if +inf.0 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) Initial program 0.0%
Taylor expanded in z around -inf
Simplified90.8%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6498.6
Simplified98.6%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(if (<=
(/
(*
y
(+
(* z (+ (* z (+ (* z (+ (* z 3.13060547623) 11.1667541262)) t)) a))
b))
(+
(*
z
(+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
0.607771387771))
2e-62)
x
(fma y 3.13060547623 x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * ((z * ((z * ((z * ((z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= 2e-62) {
tmp = x;
} else {
tmp = fma(y, 3.13060547623, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= 2e-62) tmp = x; else tmp = fma(y, 3.13060547623, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * N[(N[(z * N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(N[(z * N[(N[(z * N[(z + 15.234687407), $MachinePrecision]), $MachinePrecision] + 31.4690115749), $MachinePrecision]), $MachinePrecision] + 11.9400905721), $MachinePrecision]), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision], 2e-62], x, N[(y * 3.13060547623 + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq 2 \cdot 10^{-62}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) < 2.0000000000000001e-62Initial program 97.7%
Taylor expanded in x around inf
Simplified55.6%
if 2.0000000000000001e-62 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) Initial program 32.2%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6474.2
Simplified74.2%
Final simplification67.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (fma y 3.13060547623 x) (* t (/ y (* z z))))))
(if (<= z -1.35e+32)
t_1
(if (<= z 4.2e+34)
(+
x
(/
(* y (fma z (fma z t a) b))
(+
(*
z
(+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
0.607771387771)))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(y, 3.13060547623, x) + (t * (y / (z * z)));
double tmp;
if (z <= -1.35e+32) {
tmp = t_1;
} else if (z <= 4.2e+34) {
tmp = x + ((y * fma(z, fma(z, t, a), b)) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(y, 3.13060547623, x) + Float64(t * Float64(y / Float64(z * z)))) tmp = 0.0 if (z <= -1.35e+32) tmp = t_1; elseif (z <= 4.2e+34) tmp = Float64(x + Float64(Float64(y * fma(z, fma(z, t, a), b)) / Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 3.13060547623 + x), $MachinePrecision] + N[(t * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+32], t$95$1, If[LessEqual[z, 4.2e+34], N[(x + N[(N[(y * N[(z * N[(z * t + a), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(N[(z * N[(N[(z * N[(z + 15.234687407), $MachinePrecision]), $MachinePrecision] + 31.4690115749), $MachinePrecision]), $MachinePrecision] + 11.9400905721), $MachinePrecision]), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 3.13060547623, x\right) + t \cdot \frac{y}{z \cdot z}\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+34}:\\
\;\;\;\;x + \frac{y \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, t, a\right), b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.35000000000000006e32 or 4.20000000000000035e34 < z Initial program 8.2%
Taylor expanded in z around -inf
Simplified91.2%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6498.1
Simplified98.1%
if -1.35000000000000006e32 < z < 4.20000000000000035e34Initial program 99.7%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6498.3
Simplified98.3%
Final simplification98.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (fma y 3.13060547623 x) (* t (/ y (* z z))))))
(if (<= z -2000000000.0)
t_1
(if (<= z 2.45e+32)
(fma
(* y 1.6453555072203998)
(fma z (fma z (fma z (fma 3.13060547623 z 11.1667541262) t) a) b)
x)
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(y, 3.13060547623, x) + (t * (y / (z * z)));
double tmp;
if (z <= -2000000000.0) {
tmp = t_1;
} else if (z <= 2.45e+32) {
tmp = fma((y * 1.6453555072203998), fma(z, fma(z, fma(z, fma(3.13060547623, z, 11.1667541262), t), a), b), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(y, 3.13060547623, x) + Float64(t * Float64(y / Float64(z * z)))) tmp = 0.0 if (z <= -2000000000.0) tmp = t_1; elseif (z <= 2.45e+32) tmp = fma(Float64(y * 1.6453555072203998), fma(z, fma(z, fma(z, fma(3.13060547623, z, 11.1667541262), t), a), b), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 3.13060547623 + x), $MachinePrecision] + N[(t * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2000000000.0], t$95$1, If[LessEqual[z, 2.45e+32], N[(N[(y * 1.6453555072203998), $MachinePrecision] * N[(z * N[(z * N[(z * N[(3.13060547623 * z + 11.1667541262), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + b), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 3.13060547623, x\right) + t \cdot \frac{y}{z \cdot z}\\
\mathbf{if}\;z \leq -2000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot 1.6453555072203998, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(3.13060547623, z, 11.1667541262\right), t\right), a\right), b\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2e9 or 2.4500000000000001e32 < z Initial program 11.0%
Taylor expanded in z around -inf
Simplified89.8%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6496.5
Simplified96.5%
if -2e9 < z < 2.4500000000000001e32Initial program 99.7%
Taylor expanded in x around inf
Simplified88.0%
Taylor expanded in z around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f6485.8
Simplified85.8%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6497.5
Simplified97.5%
Final simplification97.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (fma y 3.13060547623 x) (* t (/ y (* z z))))))
(if (<= z -0.0028)
t_1
(if (<= z 2.45e+32)
(fma
z
(* y (* a 1.6453555072203998))
(fma y (* b 1.6453555072203998) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(y, 3.13060547623, x) + (t * (y / (z * z)));
double tmp;
if (z <= -0.0028) {
tmp = t_1;
} else if (z <= 2.45e+32) {
tmp = fma(z, (y * (a * 1.6453555072203998)), fma(y, (b * 1.6453555072203998), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(y, 3.13060547623, x) + Float64(t * Float64(y / Float64(z * z)))) tmp = 0.0 if (z <= -0.0028) tmp = t_1; elseif (z <= 2.45e+32) tmp = fma(z, Float64(y * Float64(a * 1.6453555072203998)), fma(y, Float64(b * 1.6453555072203998), x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 3.13060547623 + x), $MachinePrecision] + N[(t * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0028], t$95$1, If[LessEqual[z, 2.45e+32], N[(z * N[(y * N[(a * 1.6453555072203998), $MachinePrecision]), $MachinePrecision] + N[(y * N[(b * 1.6453555072203998), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 3.13060547623, x\right) + t \cdot \frac{y}{z \cdot z}\\
\mathbf{if}\;z \leq -0.0028:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(z, y \cdot \left(a \cdot 1.6453555072203998\right), \mathsf{fma}\left(y, b \cdot 1.6453555072203998, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.00279999999999999997 or 2.4500000000000001e32 < z Initial program 14.3%
Taylor expanded in z around -inf
Simplified88.7%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6495.2
Simplified95.2%
if -0.00279999999999999997 < z < 2.4500000000000001e32Initial program 99.7%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-out--N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6482.0
Simplified82.0%
Taylor expanded in a around inf
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6486.1
Simplified86.1%
Final simplification90.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.5e+28)
(fma y 3.13060547623 x)
(if (<= z 1.9e+34)
(fma z (* y (* a 1.6453555072203998)) (fma y (* b 1.6453555072203998) x))
(fma y 3.13060547623 x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.5e+28) {
tmp = fma(y, 3.13060547623, x);
} else if (z <= 1.9e+34) {
tmp = fma(z, (y * (a * 1.6453555072203998)), fma(y, (b * 1.6453555072203998), x));
} else {
tmp = fma(y, 3.13060547623, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.5e+28) tmp = fma(y, 3.13060547623, x); elseif (z <= 1.9e+34) tmp = fma(z, Float64(y * Float64(a * 1.6453555072203998)), fma(y, Float64(b * 1.6453555072203998), x)); else tmp = fma(y, 3.13060547623, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.5e+28], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, 1.9e+34], N[(z * N[(y * N[(a * 1.6453555072203998), $MachinePrecision]), $MachinePrecision] + N[(y * N[(b * 1.6453555072203998), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(z, y \cdot \left(a \cdot 1.6453555072203998\right), \mathsf{fma}\left(y, b \cdot 1.6453555072203998, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
\end{array}
\end{array}
if z < -1.5e28 or 1.9000000000000001e34 < z Initial program 8.9%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6495.2
Simplified95.2%
if -1.5e28 < z < 1.9000000000000001e34Initial program 99.6%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-out--N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6478.7
Simplified78.7%
Taylor expanded in a around inf
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6482.6
Simplified82.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.7e+28)
(fma y 3.13060547623 x)
(if (<= z 1.3e-16)
(+ x (* 1.6453555072203998 (* y b)))
(fma y 3.13060547623 x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.7e+28) {
tmp = fma(y, 3.13060547623, x);
} else if (z <= 1.3e-16) {
tmp = x + (1.6453555072203998 * (y * b));
} else {
tmp = fma(y, 3.13060547623, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.7e+28) tmp = fma(y, 3.13060547623, x); elseif (z <= 1.3e-16) tmp = Float64(x + Float64(1.6453555072203998 * Float64(y * b))); else tmp = fma(y, 3.13060547623, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.7e+28], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, 1.3e-16], N[(x + N[(1.6453555072203998 * N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-16}:\\
\;\;\;\;x + 1.6453555072203998 \cdot \left(y \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
\end{array}
\end{array}
if z < -2.7000000000000002e28 or 1.2999999999999999e-16 < z Initial program 12.4%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6493.9
Simplified93.9%
if -2.7000000000000002e28 < z < 1.2999999999999999e-16Initial program 99.6%
Taylor expanded in z around 0
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6478.2
Simplified78.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.55e+28)
(fma y 3.13060547623 x)
(if (<= z 1.3e-16)
(fma y (* b 1.6453555072203998) x)
(fma y 3.13060547623 x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.55e+28) {
tmp = fma(y, 3.13060547623, x);
} else if (z <= 1.3e-16) {
tmp = fma(y, (b * 1.6453555072203998), x);
} else {
tmp = fma(y, 3.13060547623, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.55e+28) tmp = fma(y, 3.13060547623, x); elseif (z <= 1.3e-16) tmp = fma(y, Float64(b * 1.6453555072203998), x); else tmp = fma(y, 3.13060547623, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.55e+28], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, 1.3e-16], N[(y * N[(b * 1.6453555072203998), $MachinePrecision] + x), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-16}:\\
\;\;\;\;\mathsf{fma}\left(y, b \cdot 1.6453555072203998, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
\end{array}
\end{array}
if z < -1.55e28 or 1.2999999999999999e-16 < z Initial program 12.4%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6493.9
Simplified93.9%
if -1.55e28 < z < 1.2999999999999999e-16Initial program 99.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6478.2
Simplified78.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.05e+224) (* y 3.13060547623) (if (<= y 2.2e+60) x (* y 3.13060547623))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.05e+224) {
tmp = y * 3.13060547623;
} else if (y <= 2.2e+60) {
tmp = x;
} else {
tmp = y * 3.13060547623;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-3.05d+224)) then
tmp = y * 3.13060547623d0
else if (y <= 2.2d+60) then
tmp = x
else
tmp = y * 3.13060547623d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.05e+224) {
tmp = y * 3.13060547623;
} else if (y <= 2.2e+60) {
tmp = x;
} else {
tmp = y * 3.13060547623;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.05e+224: tmp = y * 3.13060547623 elif y <= 2.2e+60: tmp = x else: tmp = y * 3.13060547623 return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.05e+224) tmp = Float64(y * 3.13060547623); elseif (y <= 2.2e+60) tmp = x; else tmp = Float64(y * 3.13060547623); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.05e+224) tmp = y * 3.13060547623; elseif (y <= 2.2e+60) tmp = x; else tmp = y * 3.13060547623; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.05e+224], N[(y * 3.13060547623), $MachinePrecision], If[LessEqual[y, 2.2e+60], x, N[(y * 3.13060547623), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.05 \cdot 10^{+224}:\\
\;\;\;\;y \cdot 3.13060547623\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+60}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot 3.13060547623\\
\end{array}
\end{array}
if y < -3.05e224 or 2.19999999999999996e60 < y Initial program 52.6%
Taylor expanded in z around inf
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6456.3
Simplified56.3%
Taylor expanded in y around inf
*-lowering-*.f6444.6
Simplified44.6%
if -3.05e224 < y < 2.19999999999999996e60Initial program 55.7%
Taylor expanded in x around inf
Simplified61.1%
Final simplification57.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 55.0%
Taylor expanded in x around inf
Simplified50.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+
x
(*
(+ (- 3.13060547623 (/ 36.527041698806414 z)) (/ t (* z z)))
(/ y 1.0)))))
(if (< z -6.499344996252632e+53)
t_1
(if (< z 7.066965436914287e+59)
(+
x
(/
y
(/
(+
(*
(+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721)
z)
0.607771387771)
(+
(* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z)
b))))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (((3.13060547623 - (36.527041698806414 / z)) + (t / (z * z))) * (y / 1.0));
double tmp;
if (z < -6.499344996252632e+53) {
tmp = t_1;
} else if (z < 7.066965436914287e+59) {
tmp = x + (y / ((((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771) / ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((3.13060547623d0 - (36.527041698806414d0 / z)) + (t / (z * z))) * (y / 1.0d0))
if (z < (-6.499344996252632d+53)) then
tmp = t_1
else if (z < 7.066965436914287d+59) then
tmp = x + (y / ((((((((z + 15.234687407d0) * z) + 31.4690115749d0) * z) + 11.9400905721d0) * z) + 0.607771387771d0) / ((((((((z * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (((3.13060547623 - (36.527041698806414 / z)) + (t / (z * z))) * (y / 1.0));
double tmp;
if (z < -6.499344996252632e+53) {
tmp = t_1;
} else if (z < 7.066965436914287e+59) {
tmp = x + (y / ((((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771) / ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (((3.13060547623 - (36.527041698806414 / z)) + (t / (z * z))) * (y / 1.0)) tmp = 0 if z < -6.499344996252632e+53: tmp = t_1 elif z < 7.066965436914287e+59: tmp = x + (y / ((((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771) / ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(Float64(3.13060547623 - Float64(36.527041698806414 / z)) + Float64(t / Float64(z * z))) * Float64(y / 1.0))) tmp = 0.0 if (z < -6.499344996252632e+53) tmp = t_1; elseif (z < 7.066965436914287e+59) tmp = Float64(x + Float64(y / Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (((3.13060547623 - (36.527041698806414 / z)) + (t / (z * z))) * (y / 1.0)); tmp = 0.0; if (z < -6.499344996252632e+53) tmp = t_1; elseif (z < 7.066965436914287e+59) tmp = x + (y / ((((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771) / ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(N[(3.13060547623 - N[(36.527041698806414 / z), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -6.499344996252632e+53], t$95$1, If[Less[z, 7.066965436914287e+59], N[(x + N[(y / N[(N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(\left(3.13060547623 - \frac{36.527041698806414}{z}\right) + \frac{t}{z \cdot z}\right) \cdot \frac{y}{1}\\
\mathbf{if}\;z < -6.499344996252632 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 7.066965436914287 \cdot 10^{+59}:\\
\;\;\;\;x + \frac{y}{\frac{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024196
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, D"
:precision binary64
:alt
(! :herbie-platform default (if (< z -649934499625263200000000000000000000000000000000000000) (+ x (* (+ (- 313060547623/100000000000 (/ 18263520849403207/500000000000000 z)) (/ t (* z z))) (/ y 1))) (if (< z 706696543691428700000000000000000000000000000000000000000000) (+ x (/ y (/ (+ (* (+ (* (+ (* (+ z 15234687407/1000000000) z) 314690115749/10000000000) z) 119400905721/10000000000) z) 607771387771/1000000000000) (+ (* (+ (* (+ (* (+ (* z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a) z) b)))) (+ x (* (+ (- 313060547623/100000000000 (/ 18263520849403207/500000000000000 z)) (/ t (* z z))) (/ y 1))))))
(+ x (/ (* y (+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b)) (+ (* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z) 0.607771387771))))