
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
x
(/
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z): return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))) end
function tmp = code(x, y, z) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304)); end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
5e+302)
(+
x
(*
y
(/
(fma (fma z 0.0692910599291889 0.4917317610505968) z 0.279195317918525)
(fma (+ z 6.012459259764103) z 3.350343815022304))))
(fma 0.0692910599291889 y x)))
double code(double x, double y, double z) {
double tmp;
if (((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) <= 5e+302) {
tmp = x + (y * (fma(fma(z, 0.0692910599291889, 0.4917317610505968), z, 0.279195317918525) / fma((z + 6.012459259764103), z, 3.350343815022304)));
} else {
tmp = fma(0.0692910599291889, y, x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) <= 5e+302) tmp = Float64(x + Float64(y * Float64(fma(fma(z, 0.0692910599291889, 0.4917317610505968), z, 0.279195317918525) / fma(Float64(z + 6.012459259764103), z, 3.350343815022304)))); else tmp = fma(0.0692910599291889, y, x); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision], 5e+302], N[(x + N[(y * N[(N[(N[(z * 0.0692910599291889 + 0.4917317610505968), $MachinePrecision] * z + 0.279195317918525), $MachinePrecision] / N[(N[(z + 6.012459259764103), $MachinePrecision] * z + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0692910599291889 * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} \leq 5 \cdot 10^{+302}:\\
\;\;\;\;x + y \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < 5e302Initial program 92.2%
remove-double-neg92.2%
distribute-lft-neg-out92.2%
distribute-neg-frac92.2%
associate-/l*99.7%
distribute-rgt-neg-in99.7%
distribute-lft-neg-in99.7%
distribute-rgt-neg-in99.7%
remove-double-neg99.7%
Simplified99.7%
if 5e302 < (/.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 2.2%
+-commutative2.2%
associate-/l*13.3%
fma-define13.3%
remove-double-neg13.3%
remove-double-neg13.3%
*-commutative13.3%
fma-define13.3%
fma-define13.3%
*-commutative13.3%
fma-define13.3%
Simplified13.3%
Taylor expanded in z around inf 98.2%
+-commutative98.2%
fma-define98.2%
Simplified98.2%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* z (+ z 6.012459259764103)) 3.350343815022304))
(t_1 (+ (* z 0.0692910599291889) 0.4917317610505968)))
(if (<= (/ (* y (+ (* z t_1) 0.279195317918525)) t_0) 2e+272)
(fma (fma z t_1 0.279195317918525) (/ y t_0) x)
(fma 0.0692910599291889 y x))))
double code(double x, double y, double z) {
double t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304;
double t_1 = (z * 0.0692910599291889) + 0.4917317610505968;
double tmp;
if (((y * ((z * t_1) + 0.279195317918525)) / t_0) <= 2e+272) {
tmp = fma(fma(z, t_1, 0.279195317918525), (y / t_0), x);
} else {
tmp = fma(0.0692910599291889, y, x);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304) t_1 = Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) tmp = 0.0 if (Float64(Float64(y * Float64(Float64(z * t_1) + 0.279195317918525)) / t_0) <= 2e+272) tmp = fma(fma(z, t_1, 0.279195317918525), Float64(y / t_0), x); else tmp = fma(0.0692910599291889, y, x); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]}, Block[{t$95$1 = N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]}, If[LessEqual[N[(N[(y * N[(N[(z * t$95$1), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], 2e+272], N[(N[(z * t$95$1 + 0.279195317918525), $MachinePrecision] * N[(y / t$95$0), $MachinePrecision] + x), $MachinePrecision], N[(0.0692910599291889 * y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304\\
t_1 := z \cdot 0.0692910599291889 + 0.4917317610505968\\
\mathbf{if}\;\frac{y \cdot \left(z \cdot t\_1 + 0.279195317918525\right)}{t\_0} \leq 2 \cdot 10^{+272}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, t\_1, 0.279195317918525\right), \frac{y}{t\_0}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < 2.0000000000000001e272Initial program 92.2%
+-commutative92.2%
*-commutative92.2%
associate-/l*98.1%
fma-define98.1%
*-commutative98.1%
fma-define98.1%
fma-define98.1%
*-commutative98.1%
fma-define98.1%
Simplified98.1%
fma-define98.1%
Applied egg-rr98.1%
Taylor expanded in y around 0 98.1%
if 2.0000000000000001e272 < (/.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 5.0%
+-commutative5.0%
associate-/l*15.9%
fma-define15.9%
remove-double-neg15.9%
remove-double-neg15.9%
*-commutative15.9%
fma-define15.9%
fma-define15.9%
*-commutative15.9%
fma-define15.9%
Simplified15.9%
Taylor expanded in z around inf 96.0%
+-commutative96.0%
fma-define96.0%
Simplified96.0%
Final simplification97.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* z (+ z 6.012459259764103)) 3.350343815022304))
(t_1
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
t_0)))
(if (<= t_1 (- INFINITY))
(+ x (* y 0.0692910599291889))
(if (<= t_1 5e+302)
(+
x
(/
(+
(* y (* z (fma 0.0692910599291889 z 0.4917317610505968)))
(* y 0.279195317918525))
t_0))
(fma 0.0692910599291889 y x)))))
double code(double x, double y, double z) {
double t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304;
double t_1 = (y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / t_0;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + (y * 0.0692910599291889);
} else if (t_1 <= 5e+302) {
tmp = x + (((y * (z * fma(0.0692910599291889, z, 0.4917317610505968))) + (y * 0.279195317918525)) / t_0);
} else {
tmp = fma(0.0692910599291889, y, x);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304) t_1 = Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / t_0) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(y * 0.0692910599291889)); elseif (t_1 <= 5e+302) tmp = Float64(x + Float64(Float64(Float64(y * Float64(z * fma(0.0692910599291889, z, 0.4917317610505968))) + Float64(y * 0.279195317918525)) / t_0)); else tmp = fma(0.0692910599291889, y, x); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * N[(N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+302], N[(x + N[(N[(N[(y * N[(z * N[(0.0692910599291889 * z + 0.4917317610505968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 0.279195317918525), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(0.0692910599291889 * y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304\\
t_1 := \frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{t\_0}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;x + \frac{y \cdot \left(z \cdot \mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right)\right) + y \cdot 0.279195317918525}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < -inf.0Initial program 6.8%
+-commutative6.8%
associate-/l*99.1%
fma-define99.1%
remove-double-neg99.1%
remove-double-neg99.1%
*-commutative99.1%
fma-define99.1%
fma-define99.1%
*-commutative99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in z around inf 99.4%
+-commutative99.4%
Simplified99.4%
if -inf.0 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < 5e302Initial program 99.6%
expm1-log1p-u83.5%
expm1-undefine83.5%
Applied egg-rr83.5%
expm1-define83.5%
Simplified83.5%
distribute-rgt-in83.5%
*-commutative83.5%
expm1-log1p-u99.6%
*-commutative99.6%
fma-define99.6%
Applied egg-rr99.6%
if 5e302 < (/.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 2.2%
+-commutative2.2%
associate-/l*13.3%
fma-define13.3%
remove-double-neg13.3%
remove-double-neg13.3%
*-commutative13.3%
fma-define13.3%
fma-define13.3%
*-commutative13.3%
fma-define13.3%
Simplified13.3%
Taylor expanded in z around inf 98.2%
+-commutative98.2%
fma-define98.2%
Simplified98.2%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))))
(if (<= t_0 (- INFINITY))
(+ x (* y 0.0692910599291889))
(if (<= t_0 5e+302) (+ t_0 x) (fma 0.0692910599291889 y x)))))
double code(double x, double y, double z) {
double t_0 = (y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = x + (y * 0.0692910599291889);
} else if (t_0 <= 5e+302) {
tmp = t_0 + x;
} else {
tmp = fma(0.0692910599291889, y, x);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(x + Float64(y * 0.0692910599291889)); elseif (t_0 <= 5e+302) tmp = Float64(t_0 + x); else tmp = fma(0.0692910599291889, y, x); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y * N[(N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+302], N[(t$95$0 + x), $MachinePrecision], N[(0.0692910599291889 * y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t\_0 + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < -inf.0Initial program 6.8%
+-commutative6.8%
associate-/l*99.1%
fma-define99.1%
remove-double-neg99.1%
remove-double-neg99.1%
*-commutative99.1%
fma-define99.1%
fma-define99.1%
*-commutative99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in z around inf 99.4%
+-commutative99.4%
Simplified99.4%
if -inf.0 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < 5e302Initial program 99.6%
if 5e302 < (/.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 2.2%
+-commutative2.2%
associate-/l*13.3%
fma-define13.3%
remove-double-neg13.3%
remove-double-neg13.3%
*-commutative13.3%
fma-define13.3%
fma-define13.3%
*-commutative13.3%
fma-define13.3%
Simplified13.3%
Taylor expanded in z around inf 98.2%
+-commutative98.2%
fma-define98.2%
Simplified98.2%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(/
(*
y
(+
(* z (+ (* z 0.0692910599291889) 0.4917317610505968))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 5e+302)))
(+ x (* y 0.0692910599291889))
(+ t_0 x))))
double code(double x, double y, double z) {
double t_0 = (y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 5e+302)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = t_0 + x;
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = (y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304);
double tmp;
if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 5e+302)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = t_0 + x;
}
return tmp;
}
def code(x, y, z): t_0 = (y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304) tmp = 0 if (t_0 <= -math.inf) or not (t_0 <= 5e+302): tmp = x + (y * 0.0692910599291889) else: tmp = t_0 + x return tmp
function code(x, y, z) t_0 = Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 5e+302)) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(t_0 + x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304); tmp = 0.0; if ((t_0 <= -Inf) || ~((t_0 <= 5e+302))) tmp = x + (y * 0.0692910599291889); else tmp = t_0 + x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y * N[(N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 5e+302]], $MachinePrecision]], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304}\\
\mathbf{if}\;t\_0 \leq -\infty \lor \neg \left(t\_0 \leq 5 \cdot 10^{+302}\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;t\_0 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < -inf.0 or 5e302 < (/.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 3.0%
+-commutative3.0%
associate-/l*29.0%
fma-define29.0%
remove-double-neg29.0%
remove-double-neg29.0%
*-commutative29.0%
fma-define29.0%
fma-define29.0%
*-commutative29.0%
fma-define29.0%
Simplified29.0%
Taylor expanded in z around inf 98.4%
+-commutative98.4%
Simplified98.4%
if -inf.0 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 692910599291889/10000000000000000 binary64)) #s(literal 307332350656623/625000000000000 binary64)) z) #s(literal 11167812716741/40000000000000 binary64))) (+.f64 (*.f64 (+.f64 z #s(literal 6012459259764103/1000000000000000 binary64)) z) #s(literal 104698244219447/31250000000000 binary64))) < 5e302Initial program 99.6%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(if (<= x -1.95e-45)
x
(if (<= x -6.4e-118)
(* y 0.08333333333333323)
(if (<= x -2.5e-118)
x
(if (<= x -1.9e-201)
(* y 0.08333333333333323)
(if (<= x 4e-158) (* y 0.0692910599291889) x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.95e-45) {
tmp = x;
} else if (x <= -6.4e-118) {
tmp = y * 0.08333333333333323;
} else if (x <= -2.5e-118) {
tmp = x;
} else if (x <= -1.9e-201) {
tmp = y * 0.08333333333333323;
} else if (x <= 4e-158) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.95d-45)) then
tmp = x
else if (x <= (-6.4d-118)) then
tmp = y * 0.08333333333333323d0
else if (x <= (-2.5d-118)) then
tmp = x
else if (x <= (-1.9d-201)) then
tmp = y * 0.08333333333333323d0
else if (x <= 4d-158) then
tmp = y * 0.0692910599291889d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.95e-45) {
tmp = x;
} else if (x <= -6.4e-118) {
tmp = y * 0.08333333333333323;
} else if (x <= -2.5e-118) {
tmp = x;
} else if (x <= -1.9e-201) {
tmp = y * 0.08333333333333323;
} else if (x <= 4e-158) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.95e-45: tmp = x elif x <= -6.4e-118: tmp = y * 0.08333333333333323 elif x <= -2.5e-118: tmp = x elif x <= -1.9e-201: tmp = y * 0.08333333333333323 elif x <= 4e-158: tmp = y * 0.0692910599291889 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.95e-45) tmp = x; elseif (x <= -6.4e-118) tmp = Float64(y * 0.08333333333333323); elseif (x <= -2.5e-118) tmp = x; elseif (x <= -1.9e-201) tmp = Float64(y * 0.08333333333333323); elseif (x <= 4e-158) tmp = Float64(y * 0.0692910599291889); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.95e-45) tmp = x; elseif (x <= -6.4e-118) tmp = y * 0.08333333333333323; elseif (x <= -2.5e-118) tmp = x; elseif (x <= -1.9e-201) tmp = y * 0.08333333333333323; elseif (x <= 4e-158) tmp = y * 0.0692910599291889; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.95e-45], x, If[LessEqual[x, -6.4e-118], N[(y * 0.08333333333333323), $MachinePrecision], If[LessEqual[x, -2.5e-118], x, If[LessEqual[x, -1.9e-201], N[(y * 0.08333333333333323), $MachinePrecision], If[LessEqual[x, 4e-158], N[(y * 0.0692910599291889), $MachinePrecision], x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{-45}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -6.4 \cdot 10^{-118}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-118}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-201}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-158}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.95e-45 or -6.40000000000000008e-118 < x < -2.50000000000000007e-118 or 4.00000000000000026e-158 < x Initial program 73.8%
+-commutative73.8%
associate-/l*80.7%
fma-define80.7%
remove-double-neg80.7%
remove-double-neg80.7%
*-commutative80.7%
fma-define80.7%
fma-define80.7%
*-commutative80.7%
fma-define80.7%
Simplified80.7%
Taylor expanded in y around 0 64.6%
if -1.95e-45 < x < -6.40000000000000008e-118 or -2.50000000000000007e-118 < x < -1.9e-201Initial program 74.3%
+-commutative74.3%
associate-/l*74.7%
fma-define74.7%
remove-double-neg74.7%
remove-double-neg74.7%
*-commutative74.7%
fma-define74.8%
fma-define74.8%
*-commutative74.8%
fma-define74.8%
Simplified74.8%
Taylor expanded in x around inf 67.8%
Taylor expanded in x around 0 57.4%
Taylor expanded in z around 0 48.3%
*-commutative48.3%
Simplified48.3%
Taylor expanded in z around 0 54.7%
*-commutative54.7%
Simplified54.7%
if -1.9e-201 < x < 4.00000000000000026e-158Initial program 49.7%
+-commutative49.7%
*-commutative49.7%
associate-/l*63.3%
fma-define63.3%
*-commutative63.3%
fma-define63.2%
fma-define63.2%
*-commutative63.2%
fma-define63.2%
Simplified63.2%
clear-num63.3%
inv-pow63.3%
Applied egg-rr63.3%
unpow-163.3%
Simplified63.3%
Taylor expanded in z around inf 73.7%
+-commutative73.7%
*-commutative73.7%
fma-define73.7%
Simplified73.7%
Taylor expanded in y around inf 63.4%
Final simplification63.3%
(FPCore (x y z)
:precision binary64
(if (or (<= z -5.5e+21) (not (<= z 8.8e-38)))
(+ x (* y 0.0692910599291889))
(+
x
(*
y
(+
0.08333333333333323
(*
z
(-
(* z (+ 0.0007936505811533442 (* z -0.0005951669793454025)))
0.00277777777751721)))))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5e+21) || !(z <= 8.8e-38)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * (0.08333333333333323 + (z * ((z * (0.0007936505811533442 + (z * -0.0005951669793454025))) - 0.00277777777751721))));
}
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.5d+21)) .or. (.not. (z <= 8.8d-38))) then
tmp = x + (y * 0.0692910599291889d0)
else
tmp = x + (y * (0.08333333333333323d0 + (z * ((z * (0.0007936505811533442d0 + (z * (-0.0005951669793454025d0)))) - 0.00277777777751721d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5e+21) || !(z <= 8.8e-38)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * (0.08333333333333323 + (z * ((z * (0.0007936505811533442 + (z * -0.0005951669793454025))) - 0.00277777777751721))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.5e+21) or not (z <= 8.8e-38): tmp = x + (y * 0.0692910599291889) else: tmp = x + (y * (0.08333333333333323 + (z * ((z * (0.0007936505811533442 + (z * -0.0005951669793454025))) - 0.00277777777751721)))) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.5e+21) || !(z <= 8.8e-38)) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(z * Float64(Float64(z * Float64(0.0007936505811533442 + Float64(z * -0.0005951669793454025))) - 0.00277777777751721))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.5e+21) || ~((z <= 8.8e-38))) tmp = x + (y * 0.0692910599291889); else tmp = x + (y * (0.08333333333333323 + (z * ((z * (0.0007936505811533442 + (z * -0.0005951669793454025))) - 0.00277777777751721)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.5e+21], N[Not[LessEqual[z, 8.8e-38]], $MachinePrecision]], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(0.08333333333333323 + N[(z * N[(N[(z * N[(0.0007936505811533442 + N[(z * -0.0005951669793454025), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+21} \lor \neg \left(z \leq 8.8 \cdot 10^{-38}\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.08333333333333323 + z \cdot \left(z \cdot \left(0.0007936505811533442 + z \cdot -0.0005951669793454025\right) - 0.00277777777751721\right)\right)\\
\end{array}
\end{array}
if z < -5.5e21 or 8.80000000000000029e-38 < z Initial program 36.3%
+-commutative36.3%
associate-/l*53.3%
fma-define53.3%
remove-double-neg53.3%
remove-double-neg53.3%
*-commutative53.3%
fma-define53.3%
fma-define53.3%
*-commutative53.3%
fma-define53.3%
Simplified53.3%
Taylor expanded in z around inf 98.3%
+-commutative98.3%
Simplified98.3%
if -5.5e21 < z < 8.80000000000000029e-38Initial program 99.6%
remove-double-neg99.6%
distribute-lft-neg-out99.6%
distribute-neg-frac99.6%
associate-/l*99.8%
distribute-rgt-neg-in99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in z around 0 96.7%
Final simplification97.5%
(FPCore (x y z)
:precision binary64
(if (<= x -2.9e-59)
x
(if (or (<= x -1.4e-157) (and (not (<= x -1.75e-178)) (<= x 3.1e-152)))
(* y 0.0692910599291889)
x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.9e-59) {
tmp = x;
} else if ((x <= -1.4e-157) || (!(x <= -1.75e-178) && (x <= 3.1e-152))) {
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 <= (-2.9d-59)) then
tmp = x
else if ((x <= (-1.4d-157)) .or. (.not. (x <= (-1.75d-178))) .and. (x <= 3.1d-152)) 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 <= -2.9e-59) {
tmp = x;
} else if ((x <= -1.4e-157) || (!(x <= -1.75e-178) && (x <= 3.1e-152))) {
tmp = y * 0.0692910599291889;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.9e-59: tmp = x elif (x <= -1.4e-157) or (not (x <= -1.75e-178) and (x <= 3.1e-152)): tmp = y * 0.0692910599291889 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.9e-59) tmp = x; elseif ((x <= -1.4e-157) || (!(x <= -1.75e-178) && (x <= 3.1e-152))) tmp = Float64(y * 0.0692910599291889); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.9e-59) tmp = x; elseif ((x <= -1.4e-157) || (~((x <= -1.75e-178)) && (x <= 3.1e-152))) tmp = y * 0.0692910599291889; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.9e-59], x, If[Or[LessEqual[x, -1.4e-157], And[N[Not[LessEqual[x, -1.75e-178]], $MachinePrecision], LessEqual[x, 3.1e-152]]], N[(y * 0.0692910599291889), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{-59}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-157} \lor \neg \left(x \leq -1.75 \cdot 10^{-178}\right) \land x \leq 3.1 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.90000000000000016e-59 or -1.40000000000000005e-157 < x < -1.74999999999999992e-178 or 3.0999999999999998e-152 < x Initial program 75.2%
+-commutative75.2%
associate-/l*81.9%
fma-define81.9%
remove-double-neg81.9%
remove-double-neg81.9%
*-commutative81.9%
fma-define81.9%
fma-define81.9%
*-commutative81.9%
fma-define81.9%
Simplified81.9%
Taylor expanded in y around 0 64.8%
if -2.90000000000000016e-59 < x < -1.40000000000000005e-157 or -1.74999999999999992e-178 < x < 3.0999999999999998e-152Initial program 53.5%
+-commutative53.5%
*-commutative53.5%
associate-/l*63.2%
fma-define63.2%
*-commutative63.2%
fma-define63.2%
fma-define63.2%
*-commutative63.2%
fma-define63.2%
Simplified63.2%
clear-num63.3%
inv-pow63.3%
Applied egg-rr63.3%
unpow-163.3%
Simplified63.3%
Taylor expanded in z around inf 69.1%
+-commutative69.1%
*-commutative69.1%
fma-define69.1%
Simplified69.1%
Taylor expanded in y around inf 58.7%
Final simplification63.0%
(FPCore (x y z)
:precision binary64
(if (or (<= z -5.5e+21) (not (<= z 8.8e-38)))
(+ x (* y 0.0692910599291889))
(+
x
(*
y
(+
0.08333333333333323
(* z (- (* z 0.0007936505811533442) 0.00277777777751721)))))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5e+21) || !(z <= 8.8e-38)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721))));
}
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.5d+21)) .or. (.not. (z <= 8.8d-38))) then
tmp = x + (y * 0.0692910599291889d0)
else
tmp = x + (y * (0.08333333333333323d0 + (z * ((z * 0.0007936505811533442d0) - 0.00277777777751721d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5e+21) || !(z <= 8.8e-38)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.5e+21) or not (z <= 8.8e-38): tmp = x + (y * 0.0692910599291889) else: tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721)))) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.5e+21) || !(z <= 8.8e-38)) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(z * Float64(Float64(z * 0.0007936505811533442) - 0.00277777777751721))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.5e+21) || ~((z <= 8.8e-38))) tmp = x + (y * 0.0692910599291889); else tmp = x + (y * (0.08333333333333323 + (z * ((z * 0.0007936505811533442) - 0.00277777777751721)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.5e+21], N[Not[LessEqual[z, 8.8e-38]], $MachinePrecision]], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(0.08333333333333323 + N[(z * N[(N[(z * 0.0007936505811533442), $MachinePrecision] - 0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+21} \lor \neg \left(z \leq 8.8 \cdot 10^{-38}\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.08333333333333323 + z \cdot \left(z \cdot 0.0007936505811533442 - 0.00277777777751721\right)\right)\\
\end{array}
\end{array}
if z < -5.5e21 or 8.80000000000000029e-38 < z Initial program 36.3%
+-commutative36.3%
associate-/l*53.3%
fma-define53.3%
remove-double-neg53.3%
remove-double-neg53.3%
*-commutative53.3%
fma-define53.3%
fma-define53.3%
*-commutative53.3%
fma-define53.3%
Simplified53.3%
Taylor expanded in z around inf 98.3%
+-commutative98.3%
Simplified98.3%
if -5.5e21 < z < 8.80000000000000029e-38Initial program 99.6%
remove-double-neg99.6%
distribute-lft-neg-out99.6%
distribute-neg-frac99.6%
associate-/l*99.8%
distribute-rgt-neg-in99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in z around 0 96.6%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.5e+21) (not (<= z 9.8e-26))) (+ x (* y 0.0692910599291889)) (+ x (+ (* -0.00277777777751721 (* y z)) (* y 0.08333333333333323)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5e+21) || !(z <= 9.8e-26)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-5.5d+21)) .or. (.not. (z <= 9.8d-26))) then
tmp = x + (y * 0.0692910599291889d0)
else
tmp = x + (((-0.00277777777751721d0) * (y * z)) + (y * 0.08333333333333323d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5e+21) || !(z <= 9.8e-26)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.5e+21) or not (z <= 9.8e-26): tmp = x + (y * 0.0692910599291889) else: tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.5e+21) || !(z <= 9.8e-26)) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(x + Float64(Float64(-0.00277777777751721 * Float64(y * z)) + Float64(y * 0.08333333333333323))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.5e+21) || ~((z <= 9.8e-26))) tmp = x + (y * 0.0692910599291889); else tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.5e+21], N[Not[LessEqual[z, 9.8e-26]], $MachinePrecision]], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.00277777777751721 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(y * 0.08333333333333323), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+21} \lor \neg \left(z \leq 9.8 \cdot 10^{-26}\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x + \left(-0.00277777777751721 \cdot \left(y \cdot z\right) + y \cdot 0.08333333333333323\right)\\
\end{array}
\end{array}
if z < -5.5e21 or 9.7999999999999998e-26 < z Initial program 35.3%
+-commutative35.3%
associate-/l*52.6%
fma-define52.6%
remove-double-neg52.6%
remove-double-neg52.6%
*-commutative52.6%
fma-define52.6%
fma-define52.6%
*-commutative52.6%
fma-define52.6%
Simplified52.6%
Taylor expanded in z around inf 98.9%
+-commutative98.9%
Simplified98.9%
if -5.5e21 < z < 9.7999999999999998e-26Initial program 99.6%
remove-double-neg99.6%
distribute-lft-neg-out99.6%
distribute-neg-frac99.6%
associate-/l*99.8%
distribute-rgt-neg-in99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in z around 0 96.7%
Taylor expanded in z around 0 96.6%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.5e+21) (not (<= z 9.8e-26))) (+ x (* y 0.0692910599291889)) (+ x (* y (+ 0.08333333333333323 (* z -0.00277777777751721))))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5e+21) || !(z <= 9.8e-26)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
}
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.5d+21)) .or. (.not. (z <= 9.8d-26))) then
tmp = x + (y * 0.0692910599291889d0)
else
tmp = x + (y * (0.08333333333333323d0 + (z * (-0.00277777777751721d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5e+21) || !(z <= 9.8e-26)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.5e+21) or not (z <= 9.8e-26): tmp = x + (y * 0.0692910599291889) else: tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.5e+21) || !(z <= 9.8e-26)) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(x + Float64(y * Float64(0.08333333333333323 + Float64(z * -0.00277777777751721)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.5e+21) || ~((z <= 9.8e-26))) tmp = x + (y * 0.0692910599291889); else tmp = x + (y * (0.08333333333333323 + (z * -0.00277777777751721))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.5e+21], N[Not[LessEqual[z, 9.8e-26]], $MachinePrecision]], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(0.08333333333333323 + N[(z * -0.00277777777751721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+21} \lor \neg \left(z \leq 9.8 \cdot 10^{-26}\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(0.08333333333333323 + z \cdot -0.00277777777751721\right)\\
\end{array}
\end{array}
if z < -5.5e21 or 9.7999999999999998e-26 < z Initial program 35.3%
+-commutative35.3%
associate-/l*52.6%
fma-define52.6%
remove-double-neg52.6%
remove-double-neg52.6%
*-commutative52.6%
fma-define52.6%
fma-define52.6%
*-commutative52.6%
fma-define52.6%
Simplified52.6%
Taylor expanded in z around inf 98.9%
+-commutative98.9%
Simplified98.9%
if -5.5e21 < z < 9.7999999999999998e-26Initial program 99.6%
remove-double-neg99.6%
distribute-lft-neg-out99.6%
distribute-neg-frac99.6%
associate-/l*99.8%
distribute-rgt-neg-in99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in z around 0 96.6%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -3.7e+15) (not (<= z 8.8e-38))) (+ x (* y 0.0692910599291889)) (+ x (* y 0.08333333333333323))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.7e+15) || !(z <= 8.8e-38)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * 0.08333333333333323);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-3.7d+15)) .or. (.not. (z <= 8.8d-38))) then
tmp = x + (y * 0.0692910599291889d0)
else
tmp = x + (y * 0.08333333333333323d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3.7e+15) || !(z <= 8.8e-38)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * 0.08333333333333323);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.7e+15) or not (z <= 8.8e-38): tmp = x + (y * 0.0692910599291889) else: tmp = x + (y * 0.08333333333333323) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.7e+15) || !(z <= 8.8e-38)) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(x + Float64(y * 0.08333333333333323)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.7e+15) || ~((z <= 8.8e-38))) tmp = x + (y * 0.0692910599291889); else tmp = x + (y * 0.08333333333333323); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.7e+15], N[Not[LessEqual[z, 8.8e-38]], $MachinePrecision]], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.08333333333333323), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+15} \lor \neg \left(z \leq 8.8 \cdot 10^{-38}\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.08333333333333323\\
\end{array}
\end{array}
if z < -3.7e15 or 8.80000000000000029e-38 < z Initial program 36.8%
+-commutative36.8%
associate-/l*53.7%
fma-define53.7%
remove-double-neg53.7%
remove-double-neg53.7%
*-commutative53.7%
fma-define53.7%
fma-define53.7%
*-commutative53.7%
fma-define53.7%
Simplified53.7%
Taylor expanded in z around inf 98.3%
+-commutative98.3%
Simplified98.3%
if -3.7e15 < z < 8.80000000000000029e-38Initial program 99.5%
+-commutative99.5%
associate-/l*99.8%
fma-define99.8%
remove-double-neg99.8%
remove-double-neg99.8%
*-commutative99.8%
fma-define99.8%
fma-define99.8%
*-commutative99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in z around 0 96.9%
+-commutative96.9%
Simplified96.9%
Final simplification97.6%
(FPCore (x y z) :precision binary64 (+ x (* y 0.0692910599291889)))
double code(double x, double y, double z) {
return x + (y * 0.0692910599291889);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (y * 0.0692910599291889d0)
end function
public static double code(double x, double y, double z) {
return x + (y * 0.0692910599291889);
}
def code(x, y, z): return x + (y * 0.0692910599291889)
function code(x, y, z) return Float64(x + Float64(y * 0.0692910599291889)) end
function tmp = code(x, y, z) tmp = x + (y * 0.0692910599291889); end
code[x_, y_, z_] := N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot 0.0692910599291889
\end{array}
Initial program 68.7%
+-commutative68.7%
associate-/l*77.1%
fma-define77.1%
remove-double-neg77.1%
remove-double-neg77.1%
*-commutative77.1%
fma-define77.1%
fma-define77.1%
*-commutative77.1%
fma-define77.1%
Simplified77.1%
Taylor expanded in z around inf 79.8%
+-commutative79.8%
Simplified79.8%
Final simplification79.8%
(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 68.7%
+-commutative68.7%
associate-/l*77.1%
fma-define77.1%
remove-double-neg77.1%
remove-double-neg77.1%
*-commutative77.1%
fma-define77.1%
fma-define77.1%
*-commutative77.1%
fma-define77.1%
Simplified77.1%
Taylor expanded in y around 0 49.1%
(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 2024107
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B"
:precision binary64
:alt
(if (< z -8120153.652456675) (- (* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y) (- (/ (* 0.40462203869992125 y) (* z z)) x)) (if (< z 6.576118972787377e+20) (+ x (* (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (/ 1.0 (+ (* (+ z 6.012459259764103) z) 3.350343815022304)))) (- (* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y) (- (/ (* 0.40462203869992125 y) (* z z)) x))))
(+ x (/ (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))