
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= (+ (+ t_1 (* a t)) (* b (* z a))) INFINITY)
(+ t_1 (+ (* a t) (* a (* z b))))
(* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (((t_1 + (a * t)) + (b * (z * a))) <= ((double) INFINITY)) {
tmp = t_1 + ((a * t) + (a * (z * b)));
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (((t_1 + (a * t)) + (b * (z * a))) <= Double.POSITIVE_INFINITY) {
tmp = t_1 + ((a * t) + (a * (z * b)));
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if ((t_1 + (a * t)) + (b * (z * a))) <= math.inf: tmp = t_1 + ((a * t) + (a * (z * b))) else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (Float64(Float64(t_1 + Float64(a * t)) + Float64(b * Float64(z * a))) <= Inf) tmp = Float64(t_1 + Float64(Float64(a * t) + Float64(a * Float64(z * b)))); else tmp = Float64(a * Float64(t + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (((t_1 + (a * t)) + (b * (z * a))) <= Inf) tmp = t_1 + ((a * t) + (a * (z * b))); else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;\left(t\_1 + a \cdot t\right) + b \cdot \left(z \cdot a\right) \leq \infty:\\
\;\;\;\;t\_1 + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 98.6%
associate-+l+98.6%
associate-*l*99.5%
Simplified99.5%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*33.3%
Simplified33.3%
*-commutative33.3%
distribute-rgt-in75.0%
add-cube-cbrt75.0%
associate-*l*75.0%
pow275.0%
+-commutative75.0%
fma-def75.0%
Applied egg-rr75.0%
Taylor expanded in a around inf 84.2%
Final simplification98.8%
(FPCore (x y z t a b) :precision binary64 (+ (fma y z x) (* a (+ t (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(y, z, x) + (a * (t + (z * b)));
}
function code(x, y, z, t, a, b) return Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)
\end{array}
Initial program 94.0%
associate-+l+94.0%
+-commutative94.0%
fma-def94.0%
associate-*l*96.4%
*-commutative96.4%
*-commutative96.4%
distribute-rgt-out98.4%
*-commutative98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -7.2e+42)
(* y z)
(if (<= y -4.4e-184)
x
(if (<= y 5e-274)
(* a t)
(if (<= y 5.4e-104)
x
(if (<= y 3e-71)
(* a t)
(if (<= y 4.1e-22) x (if (<= y 1.4e+76) (* a t) (* y z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.2e+42) {
tmp = y * z;
} else if (y <= -4.4e-184) {
tmp = x;
} else if (y <= 5e-274) {
tmp = a * t;
} else if (y <= 5.4e-104) {
tmp = x;
} else if (y <= 3e-71) {
tmp = a * t;
} else if (y <= 4.1e-22) {
tmp = x;
} else if (y <= 1.4e+76) {
tmp = a * t;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-7.2d+42)) then
tmp = y * z
else if (y <= (-4.4d-184)) then
tmp = x
else if (y <= 5d-274) then
tmp = a * t
else if (y <= 5.4d-104) then
tmp = x
else if (y <= 3d-71) then
tmp = a * t
else if (y <= 4.1d-22) then
tmp = x
else if (y <= 1.4d+76) then
tmp = a * t
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.2e+42) {
tmp = y * z;
} else if (y <= -4.4e-184) {
tmp = x;
} else if (y <= 5e-274) {
tmp = a * t;
} else if (y <= 5.4e-104) {
tmp = x;
} else if (y <= 3e-71) {
tmp = a * t;
} else if (y <= 4.1e-22) {
tmp = x;
} else if (y <= 1.4e+76) {
tmp = a * t;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7.2e+42: tmp = y * z elif y <= -4.4e-184: tmp = x elif y <= 5e-274: tmp = a * t elif y <= 5.4e-104: tmp = x elif y <= 3e-71: tmp = a * t elif y <= 4.1e-22: tmp = x elif y <= 1.4e+76: tmp = a * t else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.2e+42) tmp = Float64(y * z); elseif (y <= -4.4e-184) tmp = x; elseif (y <= 5e-274) tmp = Float64(a * t); elseif (y <= 5.4e-104) tmp = x; elseif (y <= 3e-71) tmp = Float64(a * t); elseif (y <= 4.1e-22) tmp = x; elseif (y <= 1.4e+76) tmp = Float64(a * t); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7.2e+42) tmp = y * z; elseif (y <= -4.4e-184) tmp = x; elseif (y <= 5e-274) tmp = a * t; elseif (y <= 5.4e-104) tmp = x; elseif (y <= 3e-71) tmp = a * t; elseif (y <= 4.1e-22) tmp = x; elseif (y <= 1.4e+76) tmp = a * t; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.2e+42], N[(y * z), $MachinePrecision], If[LessEqual[y, -4.4e-184], x, If[LessEqual[y, 5e-274], N[(a * t), $MachinePrecision], If[LessEqual[y, 5.4e-104], x, If[LessEqual[y, 3e-71], N[(a * t), $MachinePrecision], If[LessEqual[y, 4.1e-22], x, If[LessEqual[y, 1.4e+76], N[(a * t), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+42}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-184}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-274}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-104}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-71}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-22}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+76}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -7.2000000000000002e42 or 1.3999999999999999e76 < y Initial program 92.7%
associate-+l+92.7%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in y around inf 64.2%
*-commutative64.2%
Simplified64.2%
if -7.2000000000000002e42 < y < -4.39999999999999984e-184 or 5e-274 < y < 5.3999999999999997e-104 or 3.0000000000000001e-71 < y < 4.0999999999999999e-22Initial program 95.6%
associate-+l+95.6%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in x around inf 42.5%
if -4.39999999999999984e-184 < y < 5e-274 or 5.3999999999999997e-104 < y < 3.0000000000000001e-71 or 4.0999999999999999e-22 < y < 1.3999999999999999e76Initial program 93.5%
associate-+l+93.5%
associate-*l*96.9%
Simplified96.9%
*-commutative96.9%
distribute-rgt-in98.4%
add-cube-cbrt97.8%
associate-*l*97.8%
pow297.8%
+-commutative97.8%
fma-def97.8%
Applied egg-rr97.8%
Taylor expanded in t around inf 44.6%
Final simplification51.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= y -1.02e-10)
(* y z)
(if (<= y -3.7e-289)
t_1
(if (<= y 3.2e-106)
x
(if (<= y 1.25e-79)
t_1
(if (<= y 2.35e-23) x (if (<= y 2.2e+81) (* a t) (* y z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (y <= -1.02e-10) {
tmp = y * z;
} else if (y <= -3.7e-289) {
tmp = t_1;
} else if (y <= 3.2e-106) {
tmp = x;
} else if (y <= 1.25e-79) {
tmp = t_1;
} else if (y <= 2.35e-23) {
tmp = x;
} else if (y <= 2.2e+81) {
tmp = a * t;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (y <= (-1.02d-10)) then
tmp = y * z
else if (y <= (-3.7d-289)) then
tmp = t_1
else if (y <= 3.2d-106) then
tmp = x
else if (y <= 1.25d-79) then
tmp = t_1
else if (y <= 2.35d-23) then
tmp = x
else if (y <= 2.2d+81) then
tmp = a * t
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (y <= -1.02e-10) {
tmp = y * z;
} else if (y <= -3.7e-289) {
tmp = t_1;
} else if (y <= 3.2e-106) {
tmp = x;
} else if (y <= 1.25e-79) {
tmp = t_1;
} else if (y <= 2.35e-23) {
tmp = x;
} else if (y <= 2.2e+81) {
tmp = a * t;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if y <= -1.02e-10: tmp = y * z elif y <= -3.7e-289: tmp = t_1 elif y <= 3.2e-106: tmp = x elif y <= 1.25e-79: tmp = t_1 elif y <= 2.35e-23: tmp = x elif y <= 2.2e+81: tmp = a * t else: tmp = y * z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (y <= -1.02e-10) tmp = Float64(y * z); elseif (y <= -3.7e-289) tmp = t_1; elseif (y <= 3.2e-106) tmp = x; elseif (y <= 1.25e-79) tmp = t_1; elseif (y <= 2.35e-23) tmp = x; elseif (y <= 2.2e+81) tmp = Float64(a * t); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (y <= -1.02e-10) tmp = y * z; elseif (y <= -3.7e-289) tmp = t_1; elseif (y <= 3.2e-106) tmp = x; elseif (y <= 1.25e-79) tmp = t_1; elseif (y <= 2.35e-23) tmp = x; elseif (y <= 2.2e+81) tmp = a * t; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e-10], N[(y * z), $MachinePrecision], If[LessEqual[y, -3.7e-289], t$95$1, If[LessEqual[y, 3.2e-106], x, If[LessEqual[y, 1.25e-79], t$95$1, If[LessEqual[y, 2.35e-23], x, If[LessEqual[y, 2.2e+81], N[(a * t), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{-10}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{-289}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-106}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+81}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -1.01999999999999997e-10 or 2.19999999999999987e81 < y Initial program 93.4%
associate-+l+93.4%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in y around inf 60.1%
*-commutative60.1%
Simplified60.1%
if -1.01999999999999997e-10 < y < -3.69999999999999989e-289 or 3.2e-106 < y < 1.25e-79Initial program 94.2%
associate-+l+94.2%
associate-*l*94.2%
Simplified94.2%
*-commutative94.2%
distribute-rgt-in98.4%
add-cube-cbrt97.7%
associate-*l*97.7%
pow297.7%
+-commutative97.7%
fma-def97.7%
Applied egg-rr97.7%
Taylor expanded in b around inf 46.5%
if -3.69999999999999989e-289 < y < 3.2e-106 or 1.25e-79 < y < 2.35e-23Initial program 92.3%
associate-+l+92.3%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in x around inf 48.0%
if 2.35e-23 < y < 2.19999999999999987e81Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
*-commutative100.0%
distribute-rgt-in100.0%
add-cube-cbrt99.4%
associate-*l*99.3%
pow299.3%
+-commutative99.3%
fma-def99.3%
Applied egg-rr99.3%
Taylor expanded in t around inf 45.5%
Final simplification52.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -8e-11)
(* y z)
(if (<= y -7e-301)
(* b (* z a))
(if (<= y 2.1e-104)
x
(if (<= y 2.9e-79)
(* a (* z b))
(if (<= y 8e-23) x (if (<= y 6e+70) (* a t) (* y z))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8e-11) {
tmp = y * z;
} else if (y <= -7e-301) {
tmp = b * (z * a);
} else if (y <= 2.1e-104) {
tmp = x;
} else if (y <= 2.9e-79) {
tmp = a * (z * b);
} else if (y <= 8e-23) {
tmp = x;
} else if (y <= 6e+70) {
tmp = a * t;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-8d-11)) then
tmp = y * z
else if (y <= (-7d-301)) then
tmp = b * (z * a)
else if (y <= 2.1d-104) then
tmp = x
else if (y <= 2.9d-79) then
tmp = a * (z * b)
else if (y <= 8d-23) then
tmp = x
else if (y <= 6d+70) then
tmp = a * t
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8e-11) {
tmp = y * z;
} else if (y <= -7e-301) {
tmp = b * (z * a);
} else if (y <= 2.1e-104) {
tmp = x;
} else if (y <= 2.9e-79) {
tmp = a * (z * b);
} else if (y <= 8e-23) {
tmp = x;
} else if (y <= 6e+70) {
tmp = a * t;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -8e-11: tmp = y * z elif y <= -7e-301: tmp = b * (z * a) elif y <= 2.1e-104: tmp = x elif y <= 2.9e-79: tmp = a * (z * b) elif y <= 8e-23: tmp = x elif y <= 6e+70: tmp = a * t else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -8e-11) tmp = Float64(y * z); elseif (y <= -7e-301) tmp = Float64(b * Float64(z * a)); elseif (y <= 2.1e-104) tmp = x; elseif (y <= 2.9e-79) tmp = Float64(a * Float64(z * b)); elseif (y <= 8e-23) tmp = x; elseif (y <= 6e+70) tmp = Float64(a * t); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -8e-11) tmp = y * z; elseif (y <= -7e-301) tmp = b * (z * a); elseif (y <= 2.1e-104) tmp = x; elseif (y <= 2.9e-79) tmp = a * (z * b); elseif (y <= 8e-23) tmp = x; elseif (y <= 6e+70) tmp = a * t; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8e-11], N[(y * z), $MachinePrecision], If[LessEqual[y, -7e-301], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-104], x, If[LessEqual[y, 2.9e-79], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-23], x, If[LessEqual[y, 6e+70], N[(a * t), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{-11}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-301}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-104}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-79}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+70}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -7.99999999999999952e-11 or 5.99999999999999952e70 < y Initial program 93.4%
associate-+l+93.4%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in y around inf 60.1%
*-commutative60.1%
Simplified60.1%
if -7.99999999999999952e-11 < y < -6.99999999999999984e-301Initial program 95.0%
associate-+l+95.0%
associate-*l*93.4%
Simplified93.4%
*-commutative93.4%
distribute-rgt-in98.2%
add-cube-cbrt97.4%
associate-*l*97.4%
pow297.4%
+-commutative97.4%
fma-def97.4%
Applied egg-rr97.4%
Taylor expanded in b around inf 45.0%
associate-*r*45.1%
*-commutative45.1%
Simplified45.1%
Taylor expanded in z around 0 45.0%
*-commutative45.0%
associate-*l*46.6%
Simplified46.6%
if -6.99999999999999984e-301 < y < 2.09999999999999999e-104 or 2.9000000000000001e-79 < y < 7.99999999999999968e-23Initial program 92.3%
associate-+l+92.3%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in x around inf 48.0%
if 2.09999999999999999e-104 < y < 2.9000000000000001e-79Initial program 88.7%
associate-+l+88.7%
associate-*l*99.8%
Simplified99.8%
*-commutative99.8%
distribute-rgt-in99.8%
add-cube-cbrt99.1%
associate-*l*99.2%
pow299.2%
+-commutative99.2%
fma-def99.2%
Applied egg-rr99.2%
Taylor expanded in b around inf 56.4%
if 7.99999999999999968e-23 < y < 5.99999999999999952e70Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
*-commutative100.0%
distribute-rgt-in100.0%
add-cube-cbrt99.4%
associate-*l*99.3%
pow299.3%
+-commutative99.3%
fma-def99.3%
Applied egg-rr99.3%
Taylor expanded in t around inf 45.5%
Final simplification52.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* a t) (* y z))) (t_2 (+ x (* y z))))
(if (<= y -1.02e+86)
t_1
(if (<= y 1.8e+85)
(+ x (* a (+ t (* z b))))
(if (<= y 2.6e+143)
t_2
(if (<= y 2.2e+149) (+ x (* a t)) (if (<= y 7.5e+248) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * t) + (y * z);
double t_2 = x + (y * z);
double tmp;
if (y <= -1.02e+86) {
tmp = t_1;
} else if (y <= 1.8e+85) {
tmp = x + (a * (t + (z * b)));
} else if (y <= 2.6e+143) {
tmp = t_2;
} else if (y <= 2.2e+149) {
tmp = x + (a * t);
} else if (y <= 7.5e+248) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * t) + (y * z)
t_2 = x + (y * z)
if (y <= (-1.02d+86)) then
tmp = t_1
else if (y <= 1.8d+85) then
tmp = x + (a * (t + (z * b)))
else if (y <= 2.6d+143) then
tmp = t_2
else if (y <= 2.2d+149) then
tmp = x + (a * t)
else if (y <= 7.5d+248) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * t) + (y * z);
double t_2 = x + (y * z);
double tmp;
if (y <= -1.02e+86) {
tmp = t_1;
} else if (y <= 1.8e+85) {
tmp = x + (a * (t + (z * b)));
} else if (y <= 2.6e+143) {
tmp = t_2;
} else if (y <= 2.2e+149) {
tmp = x + (a * t);
} else if (y <= 7.5e+248) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a * t) + (y * z) t_2 = x + (y * z) tmp = 0 if y <= -1.02e+86: tmp = t_1 elif y <= 1.8e+85: tmp = x + (a * (t + (z * b))) elif y <= 2.6e+143: tmp = t_2 elif y <= 2.2e+149: tmp = x + (a * t) elif y <= 7.5e+248: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a * t) + Float64(y * z)) t_2 = Float64(x + Float64(y * z)) tmp = 0.0 if (y <= -1.02e+86) tmp = t_1; elseif (y <= 1.8e+85) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (y <= 2.6e+143) tmp = t_2; elseif (y <= 2.2e+149) tmp = Float64(x + Float64(a * t)); elseif (y <= 7.5e+248) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a * t) + (y * z); t_2 = x + (y * z); tmp = 0.0; if (y <= -1.02e+86) tmp = t_1; elseif (y <= 1.8e+85) tmp = x + (a * (t + (z * b))); elseif (y <= 2.6e+143) tmp = t_2; elseif (y <= 2.2e+149) tmp = x + (a * t); elseif (y <= 7.5e+248) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a * t), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e+86], t$95$1, If[LessEqual[y, 1.8e+85], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+143], t$95$2, If[LessEqual[y, 2.2e+149], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+248], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot t + y \cdot z\\
t_2 := x + y \cdot z\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+85}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+143}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+149}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.01999999999999996e86 or 2.2e149 < y < 7.5000000000000004e248Initial program 90.3%
associate-+l+90.3%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in t around inf 93.6%
Taylor expanded in x around 0 84.3%
if -1.01999999999999996e86 < y < 1.7999999999999999e85Initial program 94.3%
associate-+l+94.3%
+-commutative94.3%
fma-def94.3%
associate-*l*96.9%
*-commutative96.9%
*-commutative96.9%
distribute-rgt-out99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in y around 0 89.2%
if 1.7999999999999999e85 < y < 2.5999999999999999e143 or 7.5000000000000004e248 < y Initial program 100.0%
associate-+l+100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around 0 89.3%
if 2.5999999999999999e143 < y < 2.2e149Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
Simplified100.0%
Final simplification88.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -8e+168)
t_1
(if (<= a -3.4e+69)
(+ x (* a t))
(if (or (<= a -3.6e+24) (not (<= a 52000000000.0)))
t_1
(+ x (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -8e+168) {
tmp = t_1;
} else if (a <= -3.4e+69) {
tmp = x + (a * t);
} else if ((a <= -3.6e+24) || !(a <= 52000000000.0)) {
tmp = t_1;
} else {
tmp = x + (y * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if (a <= (-8d+168)) then
tmp = t_1
else if (a <= (-3.4d+69)) then
tmp = x + (a * t)
else if ((a <= (-3.6d+24)) .or. (.not. (a <= 52000000000.0d0))) then
tmp = t_1
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -8e+168) {
tmp = t_1;
} else if (a <= -3.4e+69) {
tmp = x + (a * t);
} else if ((a <= -3.6e+24) || !(a <= 52000000000.0)) {
tmp = t_1;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -8e+168: tmp = t_1 elif a <= -3.4e+69: tmp = x + (a * t) elif (a <= -3.6e+24) or not (a <= 52000000000.0): tmp = t_1 else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -8e+168) tmp = t_1; elseif (a <= -3.4e+69) tmp = Float64(x + Float64(a * t)); elseif ((a <= -3.6e+24) || !(a <= 52000000000.0)) tmp = t_1; else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -8e+168) tmp = t_1; elseif (a <= -3.4e+69) tmp = x + (a * t); elseif ((a <= -3.6e+24) || ~((a <= 52000000000.0))) tmp = t_1; else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8e+168], t$95$1, If[LessEqual[a, -3.4e+69], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -3.6e+24], N[Not[LessEqual[a, 52000000000.0]], $MachinePrecision]], t$95$1, N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -8 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.4 \cdot 10^{+69}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;a \leq -3.6 \cdot 10^{+24} \lor \neg \left(a \leq 52000000000\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -7.9999999999999995e168 or -3.39999999999999986e69 < a < -3.59999999999999983e24 or 5.2e10 < a Initial program 87.5%
associate-+l+87.5%
associate-*l*93.7%
Simplified93.7%
*-commutative93.7%
distribute-rgt-in97.9%
add-cube-cbrt97.3%
associate-*l*97.3%
pow297.3%
+-commutative97.3%
fma-def97.3%
Applied egg-rr97.3%
Taylor expanded in a around inf 79.2%
if -7.9999999999999995e168 < a < -3.39999999999999986e69Initial program 82.4%
associate-+l+82.4%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in z around 0 74.1%
+-commutative74.1%
Simplified74.1%
if -3.59999999999999983e24 < a < 5.2e10Initial program 99.7%
associate-+l+99.7%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in a around 0 74.2%
Final simplification76.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -7.2e+132)
t_1
(if (<= a -50000000000.0)
(+ x (* b (* z a)))
(if (<= a -4.1e-101)
(+ (* a t) (* y z))
(if (<= a 70000000.0) (+ x (* y z)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -7.2e+132) {
tmp = t_1;
} else if (a <= -50000000000.0) {
tmp = x + (b * (z * a));
} else if (a <= -4.1e-101) {
tmp = (a * t) + (y * z);
} else if (a <= 70000000.0) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if (a <= (-7.2d+132)) then
tmp = t_1
else if (a <= (-50000000000.0d0)) then
tmp = x + (b * (z * a))
else if (a <= (-4.1d-101)) then
tmp = (a * t) + (y * z)
else if (a <= 70000000.0d0) then
tmp = x + (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -7.2e+132) {
tmp = t_1;
} else if (a <= -50000000000.0) {
tmp = x + (b * (z * a));
} else if (a <= -4.1e-101) {
tmp = (a * t) + (y * z);
} else if (a <= 70000000.0) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -7.2e+132: tmp = t_1 elif a <= -50000000000.0: tmp = x + (b * (z * a)) elif a <= -4.1e-101: tmp = (a * t) + (y * z) elif a <= 70000000.0: tmp = x + (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -7.2e+132) tmp = t_1; elseif (a <= -50000000000.0) tmp = Float64(x + Float64(b * Float64(z * a))); elseif (a <= -4.1e-101) tmp = Float64(Float64(a * t) + Float64(y * z)); elseif (a <= 70000000.0) tmp = Float64(x + Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -7.2e+132) tmp = t_1; elseif (a <= -50000000000.0) tmp = x + (b * (z * a)); elseif (a <= -4.1e-101) tmp = (a * t) + (y * z); elseif (a <= 70000000.0) tmp = x + (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.2e+132], t$95$1, If[LessEqual[a, -50000000000.0], N[(x + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -4.1e-101], N[(N[(a * t), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 70000000.0], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -7.2 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -50000000000:\\
\;\;\;\;x + b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;a \leq -4.1 \cdot 10^{-101}:\\
\;\;\;\;a \cdot t + y \cdot z\\
\mathbf{elif}\;a \leq 70000000:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.20000000000000031e132 or 7e7 < a Initial program 84.5%
associate-+l+84.5%
associate-*l*91.6%
Simplified91.6%
*-commutative91.6%
distribute-rgt-in96.8%
add-cube-cbrt96.3%
associate-*l*96.3%
pow296.3%
+-commutative96.3%
fma-def96.3%
Applied egg-rr96.3%
Taylor expanded in a around inf 77.6%
if -7.20000000000000031e132 < a < -5e10Initial program 99.8%
associate-+l+99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around 0 84.3%
+-commutative84.3%
+-commutative84.3%
associate-*r*79.1%
distribute-rgt-in79.1%
Simplified79.1%
Taylor expanded in y around 0 69.4%
Taylor expanded in z around 0 74.6%
*-commutative33.2%
associate-*l*38.0%
Simplified79.4%
if -5e10 < a < -4.10000000000000026e-101Initial program 99.8%
associate-+l+99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in t around inf 88.8%
Taylor expanded in x around 0 73.7%
if -4.10000000000000026e-101 < a < 7e7Initial program 99.6%
associate-+l+99.6%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in a around 0 77.2%
Final simplification77.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.5e+78) (not (<= y 4e+68))) (+ x (* z (+ y (* a b)))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.5e+78) || !(y <= 4e+68)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6.5d+78)) .or. (.not. (y <= 4d+68))) then
tmp = x + (z * (y + (a * b)))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.5e+78) || !(y <= 4e+68)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.5e+78) or not (y <= 4e+68): tmp = x + (z * (y + (a * b))) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.5e+78) || !(y <= 4e+68)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.5e+78) || ~((y <= 4e+68))) tmp = x + (z * (y + (a * b))); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.5e+78], N[Not[LessEqual[y, 4e+68]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+78} \lor \neg \left(y \leq 4 \cdot 10^{+68}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if y < -6.50000000000000036e78 or 3.99999999999999981e68 < y Initial program 93.4%
associate-+l+93.4%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in t around 0 84.4%
+-commutative84.4%
+-commutative84.4%
associate-*r*84.5%
distribute-rgt-in86.7%
Simplified86.7%
if -6.50000000000000036e78 < y < 3.99999999999999981e68Initial program 94.3%
associate-+l+94.3%
+-commutative94.3%
fma-def94.3%
associate-*l*96.9%
*-commutative96.9%
*-commutative96.9%
distribute-rgt-out99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in y around 0 89.2%
Final simplification88.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1e-31) (not (<= y 6.5e-6))) (+ (+ x (* y z)) (* a t)) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1e-31) || !(y <= 6.5e-6)) {
tmp = (x + (y * z)) + (a * t);
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1d-31)) .or. (.not. (y <= 6.5d-6))) then
tmp = (x + (y * z)) + (a * t)
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1e-31) || !(y <= 6.5e-6)) {
tmp = (x + (y * z)) + (a * t);
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1e-31) or not (y <= 6.5e-6): tmp = (x + (y * z)) + (a * t) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1e-31) || !(y <= 6.5e-6)) tmp = Float64(Float64(x + Float64(y * z)) + Float64(a * t)); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1e-31) || ~((y <= 6.5e-6))) tmp = (x + (y * z)) + (a * t); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1e-31], N[Not[LessEqual[y, 6.5e-6]], $MachinePrecision]], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-31} \lor \neg \left(y \leq 6.5 \cdot 10^{-6}\right):\\
\;\;\;\;\left(x + y \cdot z\right) + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if y < -1e-31 or 6.4999999999999996e-6 < y Initial program 94.4%
associate-+l+94.4%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in t around inf 91.8%
if -1e-31 < y < 6.4999999999999996e-6Initial program 93.6%
associate-+l+93.6%
+-commutative93.6%
fma-def93.6%
associate-*l*96.1%
*-commutative96.1%
*-commutative96.1%
distribute-rgt-out99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in y around 0 92.1%
Final simplification91.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.8e-85) (not (<= y 3.5e+68))) (+ x (* y z)) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.8e-85) || !(y <= 3.5e+68)) {
tmp = x + (y * z);
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-8.8d-85)) .or. (.not. (y <= 3.5d+68))) then
tmp = x + (y * z)
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.8e-85) || !(y <= 3.5e+68)) {
tmp = x + (y * z);
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.8e-85) or not (y <= 3.5e+68): tmp = x + (y * z) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.8e-85) || !(y <= 3.5e+68)) tmp = Float64(x + Float64(y * z)); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -8.8e-85) || ~((y <= 3.5e+68))) tmp = x + (y * z); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.8e-85], N[Not[LessEqual[y, 3.5e+68]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{-85} \lor \neg \left(y \leq 3.5 \cdot 10^{+68}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if y < -8.8e-85 or 3.49999999999999977e68 < y Initial program 93.4%
associate-+l+93.4%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in a around 0 73.7%
if -8.8e-85 < y < 3.49999999999999977e68Initial program 94.5%
associate-+l+94.5%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in z around 0 61.5%
+-commutative61.5%
Simplified61.5%
Final simplification67.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b -9.4e+187) (* z (* a b)) (if (<= b 5.8e+84) (+ x (* y z)) (* a (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -9.4e+187) {
tmp = z * (a * b);
} else if (b <= 5.8e+84) {
tmp = x + (y * z);
} else {
tmp = a * (z * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-9.4d+187)) then
tmp = z * (a * b)
else if (b <= 5.8d+84) then
tmp = x + (y * z)
else
tmp = a * (z * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -9.4e+187) {
tmp = z * (a * b);
} else if (b <= 5.8e+84) {
tmp = x + (y * z);
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -9.4e+187: tmp = z * (a * b) elif b <= 5.8e+84: tmp = x + (y * z) else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -9.4e+187) tmp = Float64(z * Float64(a * b)); elseif (b <= 5.8e+84) tmp = Float64(x + Float64(y * z)); else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -9.4e+187) tmp = z * (a * b); elseif (b <= 5.8e+84) tmp = x + (y * z); else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -9.4e+187], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.8e+84], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.4 \cdot 10^{+187}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{+84}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if b < -9.39999999999999978e187Initial program 91.8%
associate-+l+91.8%
associate-*l*93.8%
Simplified93.8%
*-commutative93.8%
distribute-rgt-in99.7%
add-cube-cbrt99.3%
associate-*l*99.3%
pow299.3%
+-commutative99.3%
fma-def99.3%
Applied egg-rr99.3%
Taylor expanded in b around inf 66.1%
associate-*r*71.8%
*-commutative71.8%
Simplified71.8%
if -9.39999999999999978e187 < b < 5.79999999999999977e84Initial program 95.0%
associate-+l+95.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in a around 0 61.8%
if 5.79999999999999977e84 < b Initial program 89.6%
associate-+l+89.6%
associate-*l*89.6%
Simplified89.6%
*-commutative89.6%
distribute-rgt-in99.8%
add-cube-cbrt99.5%
associate-*l*99.5%
pow299.5%
+-commutative99.5%
fma-def99.5%
Applied egg-rr99.5%
Taylor expanded in b around inf 69.9%
Final simplification63.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -8.5e+137) (not (<= t 2.2e-27))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8.5e+137) || !(t <= 2.2e-27)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-8.5d+137)) .or. (.not. (t <= 2.2d-27))) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8.5e+137) || !(t <= 2.2e-27)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8.5e+137) or not (t <= 2.2e-27): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8.5e+137) || !(t <= 2.2e-27)) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -8.5e+137) || ~((t <= 2.2e-27))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8.5e+137], N[Not[LessEqual[t, 2.2e-27]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+137} \lor \neg \left(t \leq 2.2 \cdot 10^{-27}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -8.50000000000000028e137 or 2.19999999999999987e-27 < t Initial program 92.0%
associate-+l+92.0%
associate-*l*95.0%
Simplified95.0%
*-commutative95.0%
distribute-rgt-in98.0%
add-cube-cbrt97.5%
associate-*l*97.5%
pow297.5%
+-commutative97.5%
fma-def97.5%
Applied egg-rr97.5%
Taylor expanded in t around inf 48.5%
if -8.50000000000000028e137 < t < 2.19999999999999987e-27Initial program 95.3%
associate-+l+95.3%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in x around inf 33.9%
Final simplification39.6%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.0%
associate-+l+94.0%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 25.6%
Final simplification25.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024033
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:herbie-target
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))