
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= z -4.1e+49)
(+ x (* y 0.0692910599291889))
(if (<= z 350000000.0)
(+
(/
(*
y
(+
0.279195317918525
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))))
(+ 3.350343815022304 (* z (+ z 6.012459259764103))))
x)
(+ x (* y (- 0.0692910599291889 (/ -0.07512208616047561 z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.1e+49) {
tmp = x + (y * 0.0692910599291889);
} else if (z <= 350000000.0) {
tmp = ((y * (0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968)))) / (3.350343815022304 + (z * (z + 6.012459259764103)))) + 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 <= (-4.1d+49)) then
tmp = x + (y * 0.0692910599291889d0)
else if (z <= 350000000.0d0) then
tmp = ((y * (0.279195317918525d0 + (z * ((z * 0.0692910599291889d0) + 0.4917317610505968d0)))) / (3.350343815022304d0 + (z * (z + 6.012459259764103d0)))) + 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 <= -4.1e+49) {
tmp = x + (y * 0.0692910599291889);
} else if (z <= 350000000.0) {
tmp = ((y * (0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968)))) / (3.350343815022304 + (z * (z + 6.012459259764103)))) + x;
} else {
tmp = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.1e+49: tmp = x + (y * 0.0692910599291889) elif z <= 350000000.0: tmp = ((y * (0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968)))) / (3.350343815022304 + (z * (z + 6.012459259764103)))) + x else: tmp = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.1e+49) tmp = Float64(x + Float64(y * 0.0692910599291889)); elseif (z <= 350000000.0) tmp = Float64(Float64(Float64(y * Float64(0.279195317918525 + Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)))) / Float64(3.350343815022304 + Float64(z * Float64(z + 6.012459259764103)))) + 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 <= -4.1e+49) tmp = x + (y * 0.0692910599291889); elseif (z <= 350000000.0) tmp = ((y * (0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968)))) / (3.350343815022304 + (z * (z + 6.012459259764103)))) + x; else tmp = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.1e+49], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 350000000.0], N[(N[(N[(y * N[(0.279195317918525 + N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.350343815022304 + N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision]), $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 -4.1 \cdot 10^{+49}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{elif}\;z \leq 350000000:\\
\;\;\;\;\frac{y \cdot \left(0.279195317918525 + z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right)\right)}{3.350343815022304 + z \cdot \left(z + 6.012459259764103\right)} + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 - \frac{-0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if z < -4.1e49Initial program 22.9%
Taylor expanded in z around inf
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Simplified99.5%
if -4.1e49 < z < 3.5e8Initial program 99.6%
if 3.5e8 < z Initial program 36.9%
Taylor expanded in z around inf
associate-+r+N/A
associate--l+N/A
distribute-rgt-out--N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
distribute-rgt-out--N/A
*-commutativeN/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
Simplified99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 3.350343815022304 (* z (+ z 6.012459259764103)))))
(if (<=
(/
(*
y
(+
0.279195317918525
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))))
t_0)
5e+298)
(+
(*
(+
0.279195317918525
(+ (* z 0.4917317610505968) (* 0.0692910599291889 (* z z))))
(/ y t_0))
x)
(+ x (* y 0.0692910599291889)))))
double code(double x, double y, double z) {
double t_0 = 3.350343815022304 + (z * (z + 6.012459259764103));
double tmp;
if (((y * (0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968)))) / t_0) <= 5e+298) {
tmp = ((0.279195317918525 + ((z * 0.4917317610505968) + (0.0692910599291889 * (z * z)))) * (y / t_0)) + x;
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 3.350343815022304d0 + (z * (z + 6.012459259764103d0))
if (((y * (0.279195317918525d0 + (z * ((z * 0.0692910599291889d0) + 0.4917317610505968d0)))) / t_0) <= 5d+298) then
tmp = ((0.279195317918525d0 + ((z * 0.4917317610505968d0) + (0.0692910599291889d0 * (z * z)))) * (y / t_0)) + x
else
tmp = x + (y * 0.0692910599291889d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 3.350343815022304 + (z * (z + 6.012459259764103));
double tmp;
if (((y * (0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968)))) / t_0) <= 5e+298) {
tmp = ((0.279195317918525 + ((z * 0.4917317610505968) + (0.0692910599291889 * (z * z)))) * (y / t_0)) + x;
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
def code(x, y, z): t_0 = 3.350343815022304 + (z * (z + 6.012459259764103)) tmp = 0 if ((y * (0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968)))) / t_0) <= 5e+298: tmp = ((0.279195317918525 + ((z * 0.4917317610505968) + (0.0692910599291889 * (z * z)))) * (y / t_0)) + x else: tmp = x + (y * 0.0692910599291889) return tmp
function code(x, y, z) t_0 = Float64(3.350343815022304 + Float64(z * Float64(z + 6.012459259764103))) tmp = 0.0 if (Float64(Float64(y * Float64(0.279195317918525 + Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)))) / t_0) <= 5e+298) tmp = Float64(Float64(Float64(0.279195317918525 + Float64(Float64(z * 0.4917317610505968) + Float64(0.0692910599291889 * Float64(z * z)))) * Float64(y / t_0)) + x); else tmp = Float64(x + Float64(y * 0.0692910599291889)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 3.350343815022304 + (z * (z + 6.012459259764103)); tmp = 0.0; if (((y * (0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968)))) / t_0) <= 5e+298) tmp = ((0.279195317918525 + ((z * 0.4917317610505968) + (0.0692910599291889 * (z * z)))) * (y / t_0)) + x; else tmp = x + (y * 0.0692910599291889); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(3.350343815022304 + N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(y * N[(0.279195317918525 + N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], 5e+298], N[(N[(N[(0.279195317918525 + N[(N[(z * 0.4917317610505968), $MachinePrecision] + N[(0.0692910599291889 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3.350343815022304 + z \cdot \left(z + 6.012459259764103\right)\\
\mathbf{if}\;\frac{y \cdot \left(0.279195317918525 + z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right)\right)}{t\_0} \leq 5 \cdot 10^{+298}:\\
\;\;\;\;\left(0.279195317918525 + \left(z \cdot 0.4917317610505968 + 0.0692910599291889 \cdot \left(z \cdot z\right)\right)\right) \cdot \frac{y}{t\_0} + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < 5.0000000000000003e298Initial program 97.1%
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6498.3%
Applied egg-rr98.3%
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6498.3%
Applied egg-rr98.3%
if 5.0000000000000003e298 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) Initial program 0.6%
Taylor expanded in z around inf
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Simplified99.5%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 3.350343815022304 (* z (+ z 6.012459259764103))))
(t_1
(+
0.279195317918525
(* z (+ (* z 0.0692910599291889) 0.4917317610505968)))))
(if (<= (/ (* y t_1) t_0) 5e+298)
(+ x (* (/ y t_0) t_1))
(+ x (* y 0.0692910599291889)))))
double code(double x, double y, double z) {
double t_0 = 3.350343815022304 + (z * (z + 6.012459259764103));
double t_1 = 0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968));
double tmp;
if (((y * t_1) / t_0) <= 5e+298) {
tmp = x + ((y / t_0) * t_1);
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 3.350343815022304d0 + (z * (z + 6.012459259764103d0))
t_1 = 0.279195317918525d0 + (z * ((z * 0.0692910599291889d0) + 0.4917317610505968d0))
if (((y * t_1) / t_0) <= 5d+298) then
tmp = x + ((y / t_0) * t_1)
else
tmp = x + (y * 0.0692910599291889d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 3.350343815022304 + (z * (z + 6.012459259764103));
double t_1 = 0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968));
double tmp;
if (((y * t_1) / t_0) <= 5e+298) {
tmp = x + ((y / t_0) * t_1);
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
def code(x, y, z): t_0 = 3.350343815022304 + (z * (z + 6.012459259764103)) t_1 = 0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968)) tmp = 0 if ((y * t_1) / t_0) <= 5e+298: tmp = x + ((y / t_0) * t_1) else: tmp = x + (y * 0.0692910599291889) return tmp
function code(x, y, z) t_0 = Float64(3.350343815022304 + Float64(z * Float64(z + 6.012459259764103))) t_1 = Float64(0.279195317918525 + Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968))) tmp = 0.0 if (Float64(Float64(y * t_1) / t_0) <= 5e+298) tmp = Float64(x + Float64(Float64(y / t_0) * t_1)); else tmp = Float64(x + Float64(y * 0.0692910599291889)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 3.350343815022304 + (z * (z + 6.012459259764103)); t_1 = 0.279195317918525 + (z * ((z * 0.0692910599291889) + 0.4917317610505968)); tmp = 0.0; if (((y * t_1) / t_0) <= 5e+298) tmp = x + ((y / t_0) * t_1); else tmp = x + (y * 0.0692910599291889); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(3.350343815022304 + N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.279195317918525 + N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(y * t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision], 5e+298], N[(x + N[(N[(y / t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3.350343815022304 + z \cdot \left(z + 6.012459259764103\right)\\
t_1 := 0.279195317918525 + z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right)\\
\mathbf{if}\;\frac{y \cdot t\_1}{t\_0} \leq 5 \cdot 10^{+298}:\\
\;\;\;\;x + \frac{y}{t\_0} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < 5.0000000000000003e298Initial program 97.1%
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6498.3%
Applied egg-rr98.3%
if 5.0000000000000003e298 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) Initial program 0.6%
Taylor expanded in z around inf
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Simplified99.5%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+
x
(+
(* y 0.0692910599291889)
(/ (- (/ (* y -0.4046220386999212) z) (* y -0.07512208616047561)) z)))
(if (<= z 4.4)
(+
(* y 0.08333333333333323)
(+
x
(* z (+ (* y -0.00277777777751721) (* z (* y 0.0007936505811533442))))))
(+ x (+ (* y 0.0692910599291889) (/ (* y 0.07512208616047561) z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + ((y * 0.0692910599291889) + ((((y * -0.4046220386999212) / z) - (y * -0.07512208616047561)) / z));
} else if (z <= 4.4) {
tmp = (y * 0.08333333333333323) + (x + (z * ((y * -0.00277777777751721) + (z * (y * 0.0007936505811533442)))));
} else {
tmp = x + ((y * 0.0692910599291889) + ((y * 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.4d0)) then
tmp = x + ((y * 0.0692910599291889d0) + ((((y * (-0.4046220386999212d0)) / z) - (y * (-0.07512208616047561d0))) / z))
else if (z <= 4.4d0) then
tmp = (y * 0.08333333333333323d0) + (x + (z * ((y * (-0.00277777777751721d0)) + (z * (y * 0.0007936505811533442d0)))))
else
tmp = x + ((y * 0.0692910599291889d0) + ((y * 0.07512208616047561d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + ((y * 0.0692910599291889) + ((((y * -0.4046220386999212) / z) - (y * -0.07512208616047561)) / z));
} else if (z <= 4.4) {
tmp = (y * 0.08333333333333323) + (x + (z * ((y * -0.00277777777751721) + (z * (y * 0.0007936505811533442)))));
} else {
tmp = x + ((y * 0.0692910599291889) + ((y * 0.07512208616047561) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4: tmp = x + ((y * 0.0692910599291889) + ((((y * -0.4046220386999212) / z) - (y * -0.07512208616047561)) / z)) elif z <= 4.4: tmp = (y * 0.08333333333333323) + (x + (z * ((y * -0.00277777777751721) + (z * (y * 0.0007936505811533442))))) else: tmp = x + ((y * 0.0692910599291889) + ((y * 0.07512208616047561) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4) tmp = Float64(x + Float64(Float64(y * 0.0692910599291889) + Float64(Float64(Float64(Float64(y * -0.4046220386999212) / z) - Float64(y * -0.07512208616047561)) / z))); elseif (z <= 4.4) tmp = Float64(Float64(y * 0.08333333333333323) + Float64(x + Float64(z * Float64(Float64(y * -0.00277777777751721) + Float64(z * Float64(y * 0.0007936505811533442)))))); else tmp = Float64(x + Float64(Float64(y * 0.0692910599291889) + Float64(Float64(y * 0.07512208616047561) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4) tmp = x + ((y * 0.0692910599291889) + ((((y * -0.4046220386999212) / z) - (y * -0.07512208616047561)) / z)); elseif (z <= 4.4) tmp = (y * 0.08333333333333323) + (x + (z * ((y * -0.00277777777751721) + (z * (y * 0.0007936505811533442))))); else tmp = x + ((y * 0.0692910599291889) + ((y * 0.07512208616047561) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4], N[(x + N[(N[(y * 0.0692910599291889), $MachinePrecision] + N[(N[(N[(N[(y * -0.4046220386999212), $MachinePrecision] / z), $MachinePrecision] - N[(y * -0.07512208616047561), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4], N[(N[(y * 0.08333333333333323), $MachinePrecision] + N[(x + N[(z * N[(N[(y * -0.00277777777751721), $MachinePrecision] + N[(z * N[(y * 0.0007936505811533442), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * 0.0692910599291889), $MachinePrecision] + N[(N[(y * 0.07512208616047561), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;x + \left(y \cdot 0.0692910599291889 + \frac{\frac{y \cdot -0.4046220386999212}{z} - y \cdot -0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 4.4:\\
\;\;\;\;y \cdot 0.08333333333333323 + \left(x + z \cdot \left(y \cdot -0.00277777777751721 + z \cdot \left(y \cdot 0.0007936505811533442\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot 0.0692910599291889 + \frac{y \cdot 0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if z < -5.4000000000000004Initial program 31.1%
Taylor expanded in z around -inf
Simplified98.3%
if -5.4000000000000004 < z < 4.4000000000000004Initial program 99.6%
Taylor expanded in z around 0
Simplified99.2%
if 4.4000000000000004 < z Initial program 39.9%
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6443.5%
Applied egg-rr43.5%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
div-subN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
distribute-rgt-out--N/A
*-lowering-*.f64N/A
metadata-eval99.6%
Simplified99.6%
Final simplification99.1%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+ x (* y (- 0.0692910599291889 (/ -0.07512208616047561 z))))
(if (<= z 4.4)
(+
(* y 0.08333333333333323)
(+
x
(* z (+ (* y -0.00277777777751721) (* z (* y 0.0007936505811533442))))))
(+ x (+ (* y 0.0692910599291889) (/ (* y 0.07512208616047561) z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z)));
} else if (z <= 4.4) {
tmp = (y * 0.08333333333333323) + (x + (z * ((y * -0.00277777777751721) + (z * (y * 0.0007936505811533442)))));
} else {
tmp = x + ((y * 0.0692910599291889) + ((y * 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.4d0)) then
tmp = x + (y * (0.0692910599291889d0 - ((-0.07512208616047561d0) / z)))
else if (z <= 4.4d0) then
tmp = (y * 0.08333333333333323d0) + (x + (z * ((y * (-0.00277777777751721d0)) + (z * (y * 0.0007936505811533442d0)))))
else
tmp = x + ((y * 0.0692910599291889d0) + ((y * 0.07512208616047561d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z)));
} else if (z <= 4.4) {
tmp = (y * 0.08333333333333323) + (x + (z * ((y * -0.00277777777751721) + (z * (y * 0.0007936505811533442)))));
} else {
tmp = x + ((y * 0.0692910599291889) + ((y * 0.07512208616047561) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4: tmp = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z))) elif z <= 4.4: tmp = (y * 0.08333333333333323) + (x + (z * ((y * -0.00277777777751721) + (z * (y * 0.0007936505811533442))))) else: tmp = x + ((y * 0.0692910599291889) + ((y * 0.07512208616047561) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 - Float64(-0.07512208616047561 / z)))); elseif (z <= 4.4) tmp = Float64(Float64(y * 0.08333333333333323) + Float64(x + Float64(z * Float64(Float64(y * -0.00277777777751721) + Float64(z * Float64(y * 0.0007936505811533442)))))); else tmp = Float64(x + Float64(Float64(y * 0.0692910599291889) + Float64(Float64(y * 0.07512208616047561) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4) tmp = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z))); elseif (z <= 4.4) tmp = (y * 0.08333333333333323) + (x + (z * ((y * -0.00277777777751721) + (z * (y * 0.0007936505811533442))))); else tmp = x + ((y * 0.0692910599291889) + ((y * 0.07512208616047561) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4], N[(x + N[(y * N[(0.0692910599291889 - N[(-0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4], N[(N[(y * 0.08333333333333323), $MachinePrecision] + N[(x + N[(z * N[(N[(y * -0.00277777777751721), $MachinePrecision] + N[(z * N[(y * 0.0007936505811533442), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * 0.0692910599291889), $MachinePrecision] + N[(N[(y * 0.07512208616047561), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 - \frac{-0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 4.4:\\
\;\;\;\;y \cdot 0.08333333333333323 + \left(x + z \cdot \left(y \cdot -0.00277777777751721 + z \cdot \left(y \cdot 0.0007936505811533442\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot 0.0692910599291889 + \frac{y \cdot 0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if z < -5.4000000000000004Initial program 31.1%
Taylor expanded in z around inf
associate-+r+N/A
associate--l+N/A
distribute-rgt-out--N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
distribute-rgt-out--N/A
*-commutativeN/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
Simplified98.2%
if -5.4000000000000004 < z < 4.4000000000000004Initial program 99.6%
Taylor expanded in z around 0
Simplified99.2%
if 4.4000000000000004 < z Initial program 39.9%
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6443.5%
Applied egg-rr43.5%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
div-subN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
distribute-rgt-out--N/A
*-lowering-*.f64N/A
metadata-eval99.6%
Simplified99.6%
Final simplification99.1%
(FPCore (x y z)
:precision binary64
(if (<= z -5.4)
(+ x (* y (- 0.0692910599291889 (/ -0.07512208616047561 z))))
(if (<= z 6.0)
(+ x (* y (+ 0.08333333333333323 (* z -0.00277777777751721))))
(+ x (+ (* y 0.0692910599291889) (/ (* y 0.07512208616047561) z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z)));
} else if (z <= 6.0) {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
} else {
tmp = x + ((y * 0.0692910599291889) + ((y * 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.4d0)) then
tmp = x + (y * (0.0692910599291889d0 - ((-0.07512208616047561d0) / z)))
else if (z <= 6.0d0) then
tmp = x + (y * (0.08333333333333323d0 + (z * (-0.00277777777751721d0))))
else
tmp = x + ((y * 0.0692910599291889d0) + ((y * 0.07512208616047561d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.4) {
tmp = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z)));
} else if (z <= 6.0) {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
} else {
tmp = x + ((y * 0.0692910599291889) + ((y * 0.07512208616047561) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4: tmp = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z))) elif z <= 6.0: tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))) else: tmp = x + ((y * 0.0692910599291889) + ((y * 0.07512208616047561) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4) tmp = Float64(x + Float64(y * Float64(0.0692910599291889 - Float64(-0.07512208616047561 / z)))); elseif (z <= 6.0) tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(z * -0.00277777777751721)))); else tmp = Float64(x + Float64(Float64(y * 0.0692910599291889) + Float64(Float64(y * 0.07512208616047561) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4) tmp = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z))); elseif (z <= 6.0) tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))); else tmp = x + ((y * 0.0692910599291889) + ((y * 0.07512208616047561) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4], N[(x + N[(y * N[(0.0692910599291889 - N[(-0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.0], N[(x + N[(y * N[(0.08333333333333323 + N[(z * -0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * 0.0692910599291889), $MachinePrecision] + N[(N[(y * 0.07512208616047561), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;x + y \cdot \left(0.0692910599291889 - \frac{-0.07512208616047561}{z}\right)\\
\mathbf{elif}\;z \leq 6:\\
\;\;\;\;x + y \cdot \left(0.08333333333333323 + z \cdot -0.00277777777751721\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot 0.0692910599291889 + \frac{y \cdot 0.07512208616047561}{z}\right)\\
\end{array}
\end{array}
if z < -5.4000000000000004Initial program 31.1%
Taylor expanded in z around inf
associate-+r+N/A
associate--l+N/A
distribute-rgt-out--N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
distribute-rgt-out--N/A
*-commutativeN/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
Simplified98.2%
if -5.4000000000000004 < z < 6Initial program 99.6%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-commutativeN/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval98.9%
Simplified98.9%
if 6 < z Initial program 39.9%
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6443.5%
Applied egg-rr43.5%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
div-subN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
distribute-rgt-out--N/A
*-lowering-*.f64N/A
metadata-eval99.6%
Simplified99.6%
Final simplification98.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* y (- 0.0692910599291889 (/ -0.07512208616047561 z))))))
(if (<= z -5.4)
t_0
(if (<= z 4.9)
(+ x (* y (+ 0.08333333333333323 (* z -0.00277777777751721))))
t_0))))
double code(double x, double y, double z) {
double t_0 = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z)));
double tmp;
if (z <= -5.4) {
tmp = t_0;
} else if (z <= 4.9) {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
} 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 = x + (y * (0.0692910599291889d0 - ((-0.07512208616047561d0) / z)))
if (z <= (-5.4d0)) then
tmp = t_0
else if (z <= 4.9d0) then
tmp = x + (y * (0.08333333333333323d0 + (z * (-0.00277777777751721d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z)));
double tmp;
if (z <= -5.4) {
tmp = t_0;
} else if (z <= 4.9) {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z))) tmp = 0 if z <= -5.4: tmp = t_0 elif z <= 4.9: tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y * Float64(0.0692910599291889 - Float64(-0.07512208616047561 / z)))) tmp = 0.0 if (z <= -5.4) tmp = t_0; elseif (z <= 4.9) tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(z * -0.00277777777751721)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y * (0.0692910599291889 - (-0.07512208616047561 / z))); tmp = 0.0; if (z <= -5.4) tmp = t_0; elseif (z <= 4.9) tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * N[(0.0692910599291889 - N[(-0.07512208616047561 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.4], t$95$0, If[LessEqual[z, 4.9], N[(x + N[(y * N[(0.08333333333333323 + N[(z * -0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + y \cdot \left(0.0692910599291889 - \frac{-0.07512208616047561}{z}\right)\\
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.9:\\
\;\;\;\;x + y \cdot \left(0.08333333333333323 + z \cdot -0.00277777777751721\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -5.4000000000000004 or 4.9000000000000004 < z Initial program 35.8%
Taylor expanded in z around inf
associate-+r+N/A
associate--l+N/A
distribute-rgt-out--N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
distribute-rgt-out--N/A
*-commutativeN/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
Simplified98.9%
if -5.4000000000000004 < z < 4.9000000000000004Initial program 99.6%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-commutativeN/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval98.9%
Simplified98.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* y 0.0692910599291889))))
(if (<= z -5.4)
t_0
(if (<= z 5.0)
(+ x (* y (+ 0.08333333333333323 (* z -0.00277777777751721))))
t_0))))
double code(double x, double y, double z) {
double t_0 = x + (y * 0.0692910599291889);
double tmp;
if (z <= -5.4) {
tmp = t_0;
} else if (z <= 5.0) {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
} 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 = x + (y * 0.0692910599291889d0)
if (z <= (-5.4d0)) then
tmp = t_0
else if (z <= 5.0d0) then
tmp = x + (y * (0.08333333333333323d0 + (z * (-0.00277777777751721d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y * 0.0692910599291889);
double tmp;
if (z <= -5.4) {
tmp = t_0;
} else if (z <= 5.0) {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (y * 0.0692910599291889) tmp = 0 if z <= -5.4: tmp = t_0 elif z <= 5.0: tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y * 0.0692910599291889)) tmp = 0.0 if (z <= -5.4) tmp = t_0; elseif (z <= 5.0) tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(z * -0.00277777777751721)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y * 0.0692910599291889); tmp = 0.0; if (z <= -5.4) tmp = t_0; elseif (z <= 5.0) tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.4], t$95$0, If[LessEqual[z, 5.0], N[(x + N[(y * N[(0.08333333333333323 + N[(z * -0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + y \cdot 0.0692910599291889\\
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5:\\
\;\;\;\;x + y \cdot \left(0.08333333333333323 + z \cdot -0.00277777777751721\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -5.4000000000000004 or 5 < z Initial program 35.8%
Taylor expanded in z around inf
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6498.4%
Simplified98.4%
if -5.4000000000000004 < z < 5Initial program 99.6%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-commutativeN/A
distribute-rgt-out--N/A
associate-*l*N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval98.9%
Simplified98.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (* y 0.0692910599291889)))) (if (<= z -5.4) t_0 (if (<= z 6.4) (+ x (* y 0.08333333333333323)) t_0))))
double code(double x, double y, double z) {
double t_0 = x + (y * 0.0692910599291889);
double tmp;
if (z <= -5.4) {
tmp = t_0;
} else if (z <= 6.4) {
tmp = x + (y * 0.08333333333333323);
} 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 = x + (y * 0.0692910599291889d0)
if (z <= (-5.4d0)) then
tmp = t_0
else if (z <= 6.4d0) then
tmp = x + (y * 0.08333333333333323d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y * 0.0692910599291889);
double tmp;
if (z <= -5.4) {
tmp = t_0;
} else if (z <= 6.4) {
tmp = x + (y * 0.08333333333333323);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (y * 0.0692910599291889) tmp = 0 if z <= -5.4: tmp = t_0 elif z <= 6.4: tmp = x + (y * 0.08333333333333323) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y * 0.0692910599291889)) tmp = 0.0 if (z <= -5.4) tmp = t_0; elseif (z <= 6.4) tmp = Float64(x + Float64(y * 0.08333333333333323)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y * 0.0692910599291889); tmp = 0.0; if (z <= -5.4) tmp = t_0; elseif (z <= 6.4) tmp = x + (y * 0.08333333333333323); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.4], t$95$0, If[LessEqual[z, 6.4], N[(x + N[(y * 0.08333333333333323), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + y \cdot 0.0692910599291889\\
\mathbf{if}\;z \leq -5.4:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.4:\\
\;\;\;\;x + y \cdot 0.08333333333333323\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -5.4000000000000004 or 6.4000000000000004 < z Initial program 35.8%
Taylor expanded in z around inf
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6498.4%
Simplified98.4%
if -5.4000000000000004 < z < 6.4000000000000004Initial program 99.6%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6498.5%
Simplified98.5%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (* y 0.0692910599291889)))) (if (<= x -9e-195) t_0 (if (<= x 4.9e-207) (* y 0.08333333333333323) t_0))))
double code(double x, double y, double z) {
double t_0 = x + (y * 0.0692910599291889);
double tmp;
if (x <= -9e-195) {
tmp = t_0;
} else if (x <= 4.9e-207) {
tmp = y * 0.08333333333333323;
} 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 = x + (y * 0.0692910599291889d0)
if (x <= (-9d-195)) then
tmp = t_0
else if (x <= 4.9d-207) then
tmp = y * 0.08333333333333323d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y * 0.0692910599291889);
double tmp;
if (x <= -9e-195) {
tmp = t_0;
} else if (x <= 4.9e-207) {
tmp = y * 0.08333333333333323;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (y * 0.0692910599291889) tmp = 0 if x <= -9e-195: tmp = t_0 elif x <= 4.9e-207: tmp = y * 0.08333333333333323 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y * 0.0692910599291889)) tmp = 0.0 if (x <= -9e-195) tmp = t_0; elseif (x <= 4.9e-207) tmp = Float64(y * 0.08333333333333323); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y * 0.0692910599291889); tmp = 0.0; if (x <= -9e-195) tmp = t_0; elseif (x <= 4.9e-207) tmp = y * 0.08333333333333323; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e-195], t$95$0, If[LessEqual[x, 4.9e-207], N[(y * 0.08333333333333323), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + y \cdot 0.0692910599291889\\
\mathbf{if}\;x \leq -9 \cdot 10^{-195}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-207}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -9e-195 or 4.9e-207 < x Initial program 66.8%
Taylor expanded in z around inf
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6483.4%
Simplified83.4%
if -9e-195 < x < 4.9e-207Initial program 87.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6476.8%
Simplified76.8%
Taylor expanded in x around 0
*-lowering-*.f6469.8%
Simplified69.8%
Final simplification81.3%
(FPCore (x y z) :precision binary64 (if (<= x -5.5e-146) x (if (<= x 3.9e-171) (* y 0.08333333333333323) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.5e-146) {
tmp = x;
} else if (x <= 3.9e-171) {
tmp = y * 0.08333333333333323;
} 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 <= (-5.5d-146)) then
tmp = x
else if (x <= 3.9d-171) then
tmp = y * 0.08333333333333323d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.5e-146) {
tmp = x;
} else if (x <= 3.9e-171) {
tmp = y * 0.08333333333333323;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.5e-146: tmp = x elif x <= 3.9e-171: tmp = y * 0.08333333333333323 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.5e-146) tmp = x; elseif (x <= 3.9e-171) tmp = Float64(y * 0.08333333333333323); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.5e-146) tmp = x; elseif (x <= 3.9e-171) tmp = y * 0.08333333333333323; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.5e-146], x, If[LessEqual[x, 3.9e-171], N[(y * 0.08333333333333323), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{-146}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-171}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.49999999999999998e-146 or 3.8999999999999998e-171 < x Initial program 68.9%
Taylor expanded in x around inf
Simplified64.9%
if -5.49999999999999998e-146 < x < 3.8999999999999998e-171Initial program 73.4%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6468.1%
Simplified68.1%
Taylor expanded in x around 0
*-lowering-*.f6458.9%
Simplified58.9%
Final simplification63.4%
(FPCore (x y z) :precision binary64 (if (<= x -9e-145) x (if (<= x 2.15e-166) (* y 0.0692910599291889) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -9e-145) {
tmp = x;
} else if (x <= 2.15e-166) {
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 <= (-9d-145)) then
tmp = x
else if (x <= 2.15d-166) 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 <= -9e-145) {
tmp = x;
} else if (x <= 2.15e-166) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9e-145: tmp = x elif x <= 2.15e-166: tmp = y * 0.0692910599291889 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9e-145) tmp = x; elseif (x <= 2.15e-166) tmp = Float64(y * 0.0692910599291889); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9e-145) tmp = x; elseif (x <= 2.15e-166) tmp = y * 0.0692910599291889; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9e-145], x, If[LessEqual[x, 2.15e-166], N[(y * 0.0692910599291889), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{-145}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-166}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.0000000000000001e-145 or 2.15e-166 < x Initial program 68.9%
Taylor expanded in x around inf
Simplified65.3%
if -9.0000000000000001e-145 < x < 2.15e-166Initial program 73.0%
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6470.7%
Applied egg-rr70.7%
Taylor expanded in z around inf
*-commutativeN/A
*-lowering-*.f6460.2%
Simplified60.2%
Taylor expanded in y around inf
*-lowering-*.f6450.0%
Simplified50.0%
Final simplification61.5%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 69.9%
Taylor expanded in x around inf
Simplified52.5%
(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 2024192
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B"
:precision binary64
:alt
(! :herbie-platform default (if (< z -324806146098267/40000000) (- (* (+ (/ 7512208616047561/100000000000000000 z) 692910599291889/10000000000000000) y) (- (/ (* 323697630959937/800000000000000 y) (* z z)) x)) (if (< z 657611897278737700000) (+ x (* (* y (+ (* (+ (* z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (/ 1 (+ (* (+ z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000)))) (- (* (+ (/ 7512208616047561/100000000000000000 z) 692910599291889/10000000000000000) y) (- (/ (* 323697630959937/800000000000000 y) (* z z)) x)))))
(+ x (/ (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))