
(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 15 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 (if (or (<= z -1000000000000.0) (not (<= z 6.2e+18))) (* z (+ y (+ (* a (+ b (/ t z))) (/ x z)))) (+ (+ x (* y z)) (+ (* a (* z b)) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1000000000000.0) || !(z <= 6.2e+18)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
}
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 ((z <= (-1000000000000.0d0)) .or. (.not. (z <= 6.2d+18))) then
tmp = z * (y + ((a * (b + (t / z))) + (x / z)))
else
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a))
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 ((z <= -1000000000000.0) || !(z <= 6.2e+18)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1000000000000.0) or not (z <= 6.2e+18): tmp = z * (y + ((a * (b + (t / z))) + (x / z))) else: tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1000000000000.0) || !(z <= 6.2e+18)) tmp = Float64(z * Float64(y + Float64(Float64(a * Float64(b + Float64(t / z))) + Float64(x / z)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(a * Float64(z * b)) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1000000000000.0) || ~((z <= 6.2e+18))) tmp = z * (y + ((a * (b + (t / z))) + (x / z))); else tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1000000000000.0], N[Not[LessEqual[z, 6.2e+18]], $MachinePrecision]], N[(z * N[(y + N[(N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1000000000000 \lor \neg \left(z \leq 6.2 \cdot 10^{+18}\right):\\
\;\;\;\;z \cdot \left(y + \left(a \cdot \left(b + \frac{t}{z}\right) + \frac{x}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(a \cdot \left(z \cdot b\right) + t \cdot a\right)\\
\end{array}
\end{array}
if z < -1e12 or 6.2e18 < z Initial program 86.2%
associate-+l+86.2%
associate-*l*87.8%
Simplified87.8%
Taylor expanded in z around inf 98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-/l*99.0%
distribute-lft-out99.9%
Simplified99.9%
if -1e12 < z < 6.2e18Initial program 99.2%
associate-+l+99.2%
associate-*l*99.3%
Simplified99.3%
Final simplification99.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b))))
(if (<= t_1 5e+301)
t_1
(* x (+ 1.0 (* z (/ (+ y (* a (+ b (/ t z)))) x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= 5e+301) {
tmp = t_1;
} else {
tmp = x * (1.0 + (z * ((y + (a * (b + (t / z)))) / 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) :: t_1
real(8) :: tmp
t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b)
if (t_1 <= 5d+301) then
tmp = t_1
else
tmp = x * (1.0d0 + (z * ((y + (a * (b + (t / z)))) / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= 5e+301) {
tmp = t_1;
} else {
tmp = x * (1.0 + (z * ((y + (a * (b + (t / z)))) / x)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= 5e+301: tmp = t_1 else: tmp = x * (1.0 + (z * ((y + (a * (b + (t / z)))) / x))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= 5e+301) tmp = t_1; else tmp = Float64(x * Float64(1.0 + Float64(z * Float64(Float64(y + Float64(a * Float64(b + Float64(t / z)))) / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= 5e+301) tmp = t_1; else tmp = x * (1.0 + (z * ((y + (a * (b + (t / z)))) / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+301], t$95$1, N[(x * N[(1.0 + N[(z * N[(N[(y + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + z \cdot \frac{y + a \cdot \left(b + \frac{t}{z}\right)}{x}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 5.0000000000000004e301Initial program 99.0%
if 5.0000000000000004e301 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 74.8%
associate-+l+74.8%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in z around inf 84.7%
+-commutative84.7%
associate-+l+84.7%
+-commutative84.7%
associate-/l*86.4%
distribute-lft-out98.3%
Simplified98.3%
Taylor expanded in x around inf 98.5%
associate-/l*98.5%
Simplified98.5%
Final simplification98.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 5e+301) t_1 (* z (+ y (+ (* a (+ b (/ t z))) (/ x z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= 5e+301) {
tmp = t_1;
} else {
tmp = z * (y + ((a * (b + (t / z))) + (x / 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 = ((x + (y * z)) + (t * a)) + ((z * a) * b)
if (t_1 <= 5d+301) then
tmp = t_1
else
tmp = z * (y + ((a * (b + (t / z))) + (x / 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 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= 5e+301) {
tmp = t_1;
} else {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= 5e+301: tmp = t_1 else: tmp = z * (y + ((a * (b + (t / z))) + (x / z))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= 5e+301) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(Float64(a * Float64(b + Float64(t / z))) + Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= 5e+301) tmp = t_1; else tmp = z * (y + ((a * (b + (t / z))) + (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+301], t$95$1, N[(z * N[(y + N[(N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + \left(a \cdot \left(b + \frac{t}{z}\right) + \frac{x}{z}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 5.0000000000000004e301Initial program 99.0%
if 5.0000000000000004e301 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 74.8%
associate-+l+74.8%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in z around inf 84.7%
+-commutative84.7%
associate-+l+84.7%
+-commutative84.7%
associate-/l*86.4%
distribute-lft-out98.3%
Simplified98.3%
Final simplification98.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -8e+155)
(* a (* z b))
(if (<= a -1.15e+21)
(* t a)
(if (<= a -1.2e-77)
(* y z)
(if (<= a 1.15e-242) x (if (<= a 1.15e+57) (* y z) (* t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8e+155) {
tmp = a * (z * b);
} else if (a <= -1.15e+21) {
tmp = t * a;
} else if (a <= -1.2e-77) {
tmp = y * z;
} else if (a <= 1.15e-242) {
tmp = x;
} else if (a <= 1.15e+57) {
tmp = y * z;
} else {
tmp = t * a;
}
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 (a <= (-8d+155)) then
tmp = a * (z * b)
else if (a <= (-1.15d+21)) then
tmp = t * a
else if (a <= (-1.2d-77)) then
tmp = y * z
else if (a <= 1.15d-242) then
tmp = x
else if (a <= 1.15d+57) then
tmp = y * z
else
tmp = t * a
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 (a <= -8e+155) {
tmp = a * (z * b);
} else if (a <= -1.15e+21) {
tmp = t * a;
} else if (a <= -1.2e-77) {
tmp = y * z;
} else if (a <= 1.15e-242) {
tmp = x;
} else if (a <= 1.15e+57) {
tmp = y * z;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -8e+155: tmp = a * (z * b) elif a <= -1.15e+21: tmp = t * a elif a <= -1.2e-77: tmp = y * z elif a <= 1.15e-242: tmp = x elif a <= 1.15e+57: tmp = y * z else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -8e+155) tmp = Float64(a * Float64(z * b)); elseif (a <= -1.15e+21) tmp = Float64(t * a); elseif (a <= -1.2e-77) tmp = Float64(y * z); elseif (a <= 1.15e-242) tmp = x; elseif (a <= 1.15e+57) tmp = Float64(y * z); else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -8e+155) tmp = a * (z * b); elseif (a <= -1.15e+21) tmp = t * a; elseif (a <= -1.2e-77) tmp = y * z; elseif (a <= 1.15e-242) tmp = x; elseif (a <= 1.15e+57) tmp = y * z; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -8e+155], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.15e+21], N[(t * a), $MachinePrecision], If[LessEqual[a, -1.2e-77], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.15e-242], x, If[LessEqual[a, 1.15e+57], N[(y * z), $MachinePrecision], N[(t * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{+155}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -1.15 \cdot 10^{+21}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -1.2 \cdot 10^{-77}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{-242}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{+57}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -8.00000000000000006e155Initial program 79.6%
associate-+l+79.6%
+-commutative79.6%
fma-define79.6%
associate-*l*85.2%
*-commutative85.2%
*-commutative85.2%
distribute-rgt-out91.1%
remove-double-neg91.1%
*-commutative91.1%
distribute-lft-neg-out91.1%
sub-neg91.1%
sub-neg91.1%
distribute-lft-neg-out91.1%
*-commutative91.1%
remove-double-neg91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in y around 0 100.0%
Taylor expanded in t around 0 75.7%
Taylor expanded in x around 0 68.5%
*-commutative68.5%
Simplified68.5%
if -8.00000000000000006e155 < a < -1.15e21 or 1.1499999999999999e57 < a Initial program 89.2%
associate-+l+89.2%
+-commutative89.2%
fma-define89.2%
associate-*l*97.2%
*-commutative97.2%
*-commutative97.2%
distribute-rgt-out98.6%
remove-double-neg98.6%
*-commutative98.6%
distribute-lft-neg-out98.6%
sub-neg98.6%
sub-neg98.6%
distribute-lft-neg-out98.6%
*-commutative98.6%
remove-double-neg98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in y around inf 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in t around inf 58.7%
Taylor expanded in z around 0 51.7%
if -1.15e21 < a < -1.19999999999999995e-77 or 1.14999999999999992e-242 < a < 1.1499999999999999e57Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
fma-define97.6%
associate-*l*94.3%
*-commutative94.3%
*-commutative94.3%
distribute-rgt-out94.3%
remove-double-neg94.3%
*-commutative94.3%
distribute-lft-neg-out94.3%
sub-neg94.3%
sub-neg94.3%
distribute-lft-neg-out94.3%
*-commutative94.3%
remove-double-neg94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in y around inf 72.1%
*-commutative72.1%
Simplified72.1%
Taylor expanded in t around 0 58.9%
Taylor expanded in a around 0 48.0%
if -1.19999999999999995e-77 < a < 1.14999999999999992e-242Initial program 100.0%
associate-+l+100.0%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in z around 0 66.9%
Taylor expanded in x around inf 51.9%
Final simplification52.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.3e-40) (not (<= z 2.9e-67))) (* z (+ y (+ (* a (+ b (/ t z))) (/ x z)))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.3e-40) || !(z <= 2.9e-67)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} 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 ((z <= (-1.3d-40)) .or. (.not. (z <= 2.9d-67))) then
tmp = z * (y + ((a * (b + (t / z))) + (x / z)))
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 ((z <= -1.3e-40) || !(z <= 2.9e-67)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.3e-40) or not (z <= 2.9e-67): tmp = z * (y + ((a * (b + (t / z))) + (x / z))) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.3e-40) || !(z <= 2.9e-67)) tmp = Float64(z * Float64(y + Float64(Float64(a * Float64(b + Float64(t / z))) + Float64(x / z)))); 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 ((z <= -1.3e-40) || ~((z <= 2.9e-67))) tmp = z * (y + ((a * (b + (t / z))) + (x / z))); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.3e-40], N[Not[LessEqual[z, 2.9e-67]], $MachinePrecision]], N[(z * N[(y + N[(N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / z), $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}\;z \leq -1.3 \cdot 10^{-40} \lor \neg \left(z \leq 2.9 \cdot 10^{-67}\right):\\
\;\;\;\;z \cdot \left(y + \left(a \cdot \left(b + \frac{t}{z}\right) + \frac{x}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -1.3000000000000001e-40 or 2.90000000000000005e-67 < z Initial program 89.2%
associate-+l+89.2%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in z around inf 97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-/l*97.9%
distribute-lft-out99.3%
Simplified99.3%
if -1.3000000000000001e-40 < z < 2.90000000000000005e-67Initial program 99.0%
associate-+l+99.0%
+-commutative99.0%
fma-define99.0%
associate-*l*99.1%
*-commutative99.1%
*-commutative99.1%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
remove-double-neg100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 90.6%
Final simplification95.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -6.8e+22)
(* t a)
(if (<= a -2.2e-78)
(* y z)
(if (<= a 1.1e-242) x (if (<= a 2.55e+57) (* y z) (* t a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6.8e+22) {
tmp = t * a;
} else if (a <= -2.2e-78) {
tmp = y * z;
} else if (a <= 1.1e-242) {
tmp = x;
} else if (a <= 2.55e+57) {
tmp = y * z;
} else {
tmp = t * a;
}
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 (a <= (-6.8d+22)) then
tmp = t * a
else if (a <= (-2.2d-78)) then
tmp = y * z
else if (a <= 1.1d-242) then
tmp = x
else if (a <= 2.55d+57) then
tmp = y * z
else
tmp = t * a
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 (a <= -6.8e+22) {
tmp = t * a;
} else if (a <= -2.2e-78) {
tmp = y * z;
} else if (a <= 1.1e-242) {
tmp = x;
} else if (a <= 2.55e+57) {
tmp = y * z;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6.8e+22: tmp = t * a elif a <= -2.2e-78: tmp = y * z elif a <= 1.1e-242: tmp = x elif a <= 2.55e+57: tmp = y * z else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6.8e+22) tmp = Float64(t * a); elseif (a <= -2.2e-78) tmp = Float64(y * z); elseif (a <= 1.1e-242) tmp = x; elseif (a <= 2.55e+57) tmp = Float64(y * z); else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6.8e+22) tmp = t * a; elseif (a <= -2.2e-78) tmp = y * z; elseif (a <= 1.1e-242) tmp = x; elseif (a <= 2.55e+57) tmp = y * z; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.8e+22], N[(t * a), $MachinePrecision], If[LessEqual[a, -2.2e-78], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.1e-242], x, If[LessEqual[a, 2.55e+57], N[(y * z), $MachinePrecision], N[(t * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+22}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -2.2 \cdot 10^{-78}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-242}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.55 \cdot 10^{+57}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -6.8e22 or 2.55000000000000011e57 < a Initial program 86.2%
associate-+l+86.2%
+-commutative86.2%
fma-define86.2%
associate-*l*93.4%
*-commutative93.4%
*-commutative93.4%
distribute-rgt-out96.2%
remove-double-neg96.2%
*-commutative96.2%
distribute-lft-neg-out96.2%
sub-neg96.2%
sub-neg96.2%
distribute-lft-neg-out96.2%
*-commutative96.2%
remove-double-neg96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in y around inf 87.1%
*-commutative87.1%
Simplified87.1%
Taylor expanded in t around inf 52.6%
Taylor expanded in z around 0 46.9%
if -6.8e22 < a < -2.1999999999999999e-78 or 1.10000000000000001e-242 < a < 2.55000000000000011e57Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
fma-define97.6%
associate-*l*94.3%
*-commutative94.3%
*-commutative94.3%
distribute-rgt-out94.3%
remove-double-neg94.3%
*-commutative94.3%
distribute-lft-neg-out94.3%
sub-neg94.3%
sub-neg94.3%
distribute-lft-neg-out94.3%
*-commutative94.3%
remove-double-neg94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in y around inf 72.1%
*-commutative72.1%
Simplified72.1%
Taylor expanded in t around 0 58.9%
Taylor expanded in a around 0 48.0%
if -2.1999999999999999e-78 < a < 1.10000000000000001e-242Initial program 100.0%
associate-+l+100.0%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in z around 0 66.9%
Taylor expanded in x around inf 51.9%
Final simplification48.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -9e+20)
(+ x (* a (+ t (* z b))))
(if (<= a 1.06e-33)
(+ x (+ (* y z) (* t a)))
(* a (+ t (+ (* z b) (/ (* y z) a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9e+20) {
tmp = x + (a * (t + (z * b)));
} else if (a <= 1.06e-33) {
tmp = x + ((y * z) + (t * a));
} else {
tmp = a * (t + ((z * b) + ((y * z) / a)));
}
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 (a <= (-9d+20)) then
tmp = x + (a * (t + (z * b)))
else if (a <= 1.06d-33) then
tmp = x + ((y * z) + (t * a))
else
tmp = a * (t + ((z * b) + ((y * z) / a)))
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 (a <= -9e+20) {
tmp = x + (a * (t + (z * b)));
} else if (a <= 1.06e-33) {
tmp = x + ((y * z) + (t * a));
} else {
tmp = a * (t + ((z * b) + ((y * z) / a)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -9e+20: tmp = x + (a * (t + (z * b))) elif a <= 1.06e-33: tmp = x + ((y * z) + (t * a)) else: tmp = a * (t + ((z * b) + ((y * z) / a))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -9e+20) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (a <= 1.06e-33) tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a))); else tmp = Float64(a * Float64(t + Float64(Float64(z * b) + Float64(Float64(y * z) / a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -9e+20) tmp = x + (a * (t + (z * b))); elseif (a <= 1.06e-33) tmp = x + ((y * z) + (t * a)); else tmp = a * (t + ((z * b) + ((y * z) / a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -9e+20], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.06e-33], N[(x + N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(t + N[(N[(z * b), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{+20}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;a \leq 1.06 \cdot 10^{-33}:\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + \left(z \cdot b + \frac{y \cdot z}{a}\right)\right)\\
\end{array}
\end{array}
if a < -9e20Initial program 84.4%
associate-+l+84.4%
+-commutative84.4%
fma-define84.4%
associate-*l*91.0%
*-commutative91.0%
*-commutative91.0%
distribute-rgt-out94.6%
remove-double-neg94.6%
*-commutative94.6%
distribute-lft-neg-out94.6%
sub-neg94.6%
sub-neg94.6%
distribute-lft-neg-out94.6%
*-commutative94.6%
remove-double-neg94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in y around 0 94.9%
if -9e20 < a < 1.0599999999999999e-33Initial program 98.4%
associate-+l+98.4%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in b around 0 94.4%
if 1.0599999999999999e-33 < a Initial program 91.7%
associate-+l+91.7%
+-commutative91.7%
fma-define91.7%
associate-*l*97.2%
*-commutative97.2%
*-commutative97.2%
distribute-rgt-out98.6%
remove-double-neg98.6%
*-commutative98.6%
distribute-lft-neg-out98.6%
sub-neg98.6%
sub-neg98.6%
distribute-lft-neg-out98.6%
*-commutative98.6%
remove-double-neg98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in y around inf 88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in a around inf 88.6%
Final simplification92.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -4.6e+21)
(+ x t_1)
(if (<= a 8e-34) (+ x (+ (* y z) (* t a))) (+ (* 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 <= -4.6e+21) {
tmp = x + t_1;
} else if (a <= 8e-34) {
tmp = x + ((y * z) + (t * a));
} else {
tmp = (y * z) + 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 <= (-4.6d+21)) then
tmp = x + t_1
else if (a <= 8d-34) then
tmp = x + ((y * z) + (t * a))
else
tmp = (y * z) + 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 <= -4.6e+21) {
tmp = x + t_1;
} else if (a <= 8e-34) {
tmp = x + ((y * z) + (t * a));
} else {
tmp = (y * z) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -4.6e+21: tmp = x + t_1 elif a <= 8e-34: tmp = x + ((y * z) + (t * a)) else: tmp = (y * z) + 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 <= -4.6e+21) tmp = Float64(x + t_1); elseif (a <= 8e-34) tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a))); else tmp = Float64(Float64(y * z) + 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 <= -4.6e+21) tmp = x + t_1; elseif (a <= 8e-34) tmp = x + ((y * z) + (t * a)); else tmp = (y * z) + 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, -4.6e+21], N[(x + t$95$1), $MachinePrecision], If[LessEqual[a, 8e-34], N[(x + N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -4.6 \cdot 10^{+21}:\\
\;\;\;\;x + t\_1\\
\mathbf{elif}\;a \leq 8 \cdot 10^{-34}:\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot z + t\_1\\
\end{array}
\end{array}
if a < -4.6e21Initial program 84.4%
associate-+l+84.4%
+-commutative84.4%
fma-define84.4%
associate-*l*91.0%
*-commutative91.0%
*-commutative91.0%
distribute-rgt-out94.6%
remove-double-neg94.6%
*-commutative94.6%
distribute-lft-neg-out94.6%
sub-neg94.6%
sub-neg94.6%
distribute-lft-neg-out94.6%
*-commutative94.6%
remove-double-neg94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in y around 0 94.9%
if -4.6e21 < a < 7.99999999999999942e-34Initial program 98.4%
associate-+l+98.4%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in b around 0 94.4%
if 7.99999999999999942e-34 < a Initial program 91.7%
associate-+l+91.7%
+-commutative91.7%
fma-define91.7%
associate-*l*97.2%
*-commutative97.2%
*-commutative97.2%
distribute-rgt-out98.6%
remove-double-neg98.6%
*-commutative98.6%
distribute-lft-neg-out98.6%
sub-neg98.6%
sub-neg98.6%
distribute-lft-neg-out98.6%
*-commutative98.6%
remove-double-neg98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in y around inf 88.5%
*-commutative88.5%
Simplified88.5%
Final simplification92.8%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2.8e+149) (* a (* z b)) (if (or (<= a -4.4e+21) (not (<= a 2.4e+60))) (+ x (* t a)) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.8e+149) {
tmp = a * (z * b);
} else if ((a <= -4.4e+21) || !(a <= 2.4e+60)) {
tmp = x + (t * a);
} 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) :: tmp
if (a <= (-2.8d+149)) then
tmp = a * (z * b)
else if ((a <= (-4.4d+21)) .or. (.not. (a <= 2.4d+60))) then
tmp = x + (t * a)
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 tmp;
if (a <= -2.8e+149) {
tmp = a * (z * b);
} else if ((a <= -4.4e+21) || !(a <= 2.4e+60)) {
tmp = x + (t * a);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.8e+149: tmp = a * (z * b) elif (a <= -4.4e+21) or not (a <= 2.4e+60): tmp = x + (t * a) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.8e+149) tmp = Float64(a * Float64(z * b)); elseif ((a <= -4.4e+21) || !(a <= 2.4e+60)) tmp = Float64(x + Float64(t * a)); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.8e+149) tmp = a * (z * b); elseif ((a <= -4.4e+21) || ~((a <= 2.4e+60))) tmp = x + (t * a); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.8e+149], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -4.4e+21], N[Not[LessEqual[a, 2.4e+60]], $MachinePrecision]], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{+149}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -4.4 \cdot 10^{+21} \lor \neg \left(a \leq 2.4 \cdot 10^{+60}\right):\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -2.7999999999999999e149Initial program 79.6%
associate-+l+79.6%
+-commutative79.6%
fma-define79.6%
associate-*l*85.2%
*-commutative85.2%
*-commutative85.2%
distribute-rgt-out91.1%
remove-double-neg91.1%
*-commutative91.1%
distribute-lft-neg-out91.1%
sub-neg91.1%
sub-neg91.1%
distribute-lft-neg-out91.1%
*-commutative91.1%
remove-double-neg91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in y around 0 100.0%
Taylor expanded in t around 0 75.7%
Taylor expanded in x around 0 68.5%
*-commutative68.5%
Simplified68.5%
if -2.7999999999999999e149 < a < -4.4e21 or 2.4e60 < a Initial program 88.9%
associate-+l+88.9%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in z around 0 60.4%
if -4.4e21 < a < 2.4e60Initial program 98.6%
associate-+l+98.6%
associate-*l*94.7%
Simplified94.7%
add-cube-cbrt94.6%
pow394.6%
Applied egg-rr94.6%
Taylor expanded in a around 0 75.3%
Final simplification70.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -9e+20) (not (<= a 6.4e-34))) (+ x (* a (+ t (* z b)))) (+ x (+ (* y z) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -9e+20) || !(a <= 6.4e-34)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((y * z) + (t * a));
}
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 ((a <= (-9d+20)) .or. (.not. (a <= 6.4d-34))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((y * z) + (t * a))
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 ((a <= -9e+20) || !(a <= 6.4e-34)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((y * z) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -9e+20) or not (a <= 6.4e-34): tmp = x + (a * (t + (z * b))) else: tmp = x + ((y * z) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -9e+20) || !(a <= 6.4e-34)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -9e+20) || ~((a <= 6.4e-34))) tmp = x + (a * (t + (z * b))); else tmp = x + ((y * z) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -9e+20], N[Not[LessEqual[a, 6.4e-34]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{+20} \lor \neg \left(a \leq 6.4 \cdot 10^{-34}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\end{array}
\end{array}
if a < -9e20 or 6.40000000000000005e-34 < a Initial program 88.5%
associate-+l+88.5%
+-commutative88.5%
fma-define88.5%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
distribute-rgt-out96.8%
remove-double-neg96.8%
*-commutative96.8%
distribute-lft-neg-out96.8%
sub-neg96.8%
sub-neg96.8%
distribute-lft-neg-out96.8%
*-commutative96.8%
remove-double-neg96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in y around 0 91.1%
if -9e20 < a < 6.40000000000000005e-34Initial program 98.4%
associate-+l+98.4%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in b around 0 94.4%
Final simplification92.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6e+20) (not (<= a 5e-34))) (+ x (* a (+ t (* z b)))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6e+20) || !(a <= 5e-34)) {
tmp = x + (a * (t + (z * b)));
} 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) :: tmp
if ((a <= (-6d+20)) .or. (.not. (a <= 5d-34))) then
tmp = x + (a * (t + (z * b)))
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 tmp;
if ((a <= -6e+20) || !(a <= 5e-34)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6e+20) or not (a <= 5e-34): tmp = x + (a * (t + (z * b))) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6e+20) || !(a <= 5e-34)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -6e+20) || ~((a <= 5e-34))) tmp = x + (a * (t + (z * b))); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6e+20], N[Not[LessEqual[a, 5e-34]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+20} \lor \neg \left(a \leq 5 \cdot 10^{-34}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -6e20 or 5.0000000000000003e-34 < a Initial program 88.5%
associate-+l+88.5%
+-commutative88.5%
fma-define88.5%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
distribute-rgt-out96.8%
remove-double-neg96.8%
*-commutative96.8%
distribute-lft-neg-out96.8%
sub-neg96.8%
sub-neg96.8%
distribute-lft-neg-out96.8%
*-commutative96.8%
remove-double-neg96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in y around 0 91.1%
if -6e20 < a < 5.0000000000000003e-34Initial program 98.4%
associate-+l+98.4%
associate-*l*93.7%
Simplified93.7%
add-cube-cbrt93.6%
pow393.6%
Applied egg-rr93.6%
Taylor expanded in a around 0 78.9%
Final simplification85.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.8e+21) (not (<= a 1.5e+39))) (* a (+ t (* z b))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.8e+21) || !(a <= 1.5e+39)) {
tmp = a * (t + (z * b));
} 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) :: tmp
if ((a <= (-3.8d+21)) .or. (.not. (a <= 1.5d+39))) then
tmp = a * (t + (z * b))
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 tmp;
if ((a <= -3.8e+21) || !(a <= 1.5e+39)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.8e+21) or not (a <= 1.5e+39): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.8e+21) || !(a <= 1.5e+39)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.8e+21) || ~((a <= 1.5e+39))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.8e+21], N[Not[LessEqual[a, 1.5e+39]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+21} \lor \neg \left(a \leq 1.5 \cdot 10^{+39}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -3.8e21 or 1.5e39 < a Initial program 86.7%
associate-+l+86.7%
+-commutative86.7%
fma-define86.7%
associate-*l*93.6%
*-commutative93.6%
*-commutative93.6%
distribute-rgt-out96.4%
remove-double-neg96.4%
*-commutative96.4%
distribute-lft-neg-out96.4%
sub-neg96.4%
sub-neg96.4%
distribute-lft-neg-out96.4%
*-commutative96.4%
remove-double-neg96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in y around inf 87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y around inf 84.5%
Taylor expanded in y around 0 86.0%
if -3.8e21 < a < 1.5e39Initial program 98.6%
associate-+l+98.6%
associate-*l*94.5%
Simplified94.5%
add-cube-cbrt94.4%
pow394.4%
Applied egg-rr94.4%
Taylor expanded in a around 0 76.3%
Final simplification80.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.1e+103) (* y z) (if (<= z 1.12e+55) (+ x (* t a)) (* a (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.1e+103) {
tmp = y * z;
} else if (z <= 1.12e+55) {
tmp = x + (t * a);
} 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 (z <= (-3.1d+103)) then
tmp = y * z
else if (z <= 1.12d+55) then
tmp = x + (t * a)
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 (z <= -3.1e+103) {
tmp = y * z;
} else if (z <= 1.12e+55) {
tmp = x + (t * a);
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.1e+103: tmp = y * z elif z <= 1.12e+55: tmp = x + (t * a) else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.1e+103) tmp = Float64(y * z); elseif (z <= 1.12e+55) tmp = Float64(x + Float64(t * a)); 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 (z <= -3.1e+103) tmp = y * z; elseif (z <= 1.12e+55) tmp = x + (t * a); else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.1e+103], N[(y * z), $MachinePrecision], If[LessEqual[z, 1.12e+55], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+103}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{+55}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if z < -3.1000000000000002e103Initial program 85.4%
associate-+l+85.4%
+-commutative85.4%
fma-define85.4%
associate-*l*90.1%
*-commutative90.1%
*-commutative90.1%
distribute-rgt-out90.1%
remove-double-neg90.1%
*-commutative90.1%
distribute-lft-neg-out90.1%
sub-neg90.1%
sub-neg90.1%
distribute-lft-neg-out90.1%
*-commutative90.1%
remove-double-neg90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in y around inf 87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in t around 0 78.3%
Taylor expanded in a around 0 57.7%
if -3.1000000000000002e103 < z < 1.12000000000000006e55Initial program 98.2%
associate-+l+98.2%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in z around 0 68.3%
if 1.12000000000000006e55 < z Initial program 81.4%
associate-+l+81.4%
+-commutative81.4%
fma-define81.4%
associate-*l*83.3%
*-commutative83.3%
*-commutative83.3%
distribute-rgt-out85.6%
remove-double-neg85.6%
*-commutative85.6%
distribute-lft-neg-out85.6%
sub-neg85.6%
sub-neg85.6%
distribute-lft-neg-out85.6%
*-commutative85.6%
remove-double-neg85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y around 0 65.1%
Taylor expanded in t around 0 58.1%
Taylor expanded in x around 0 53.3%
*-commutative53.3%
Simplified53.3%
Final simplification64.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5.2e+44) (not (<= t 4.1e-89))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.2e+44) || !(t <= 4.1e-89)) {
tmp = t * a;
} 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 <= (-5.2d+44)) .or. (.not. (t <= 4.1d-89))) then
tmp = t * a
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 <= -5.2e+44) || !(t <= 4.1e-89)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -5.2e+44) or not (t <= 4.1e-89): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5.2e+44) || !(t <= 4.1e-89)) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -5.2e+44) || ~((t <= 4.1e-89))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5.2e+44], N[Not[LessEqual[t, 4.1e-89]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+44} \lor \neg \left(t \leq 4.1 \cdot 10^{-89}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -5.1999999999999998e44 or 4.0999999999999998e-89 < t Initial program 94.0%
associate-+l+94.0%
+-commutative94.0%
fma-define94.0%
associate-*l*94.0%
*-commutative94.0%
*-commutative94.0%
distribute-rgt-out96.2%
remove-double-neg96.2%
*-commutative96.2%
distribute-lft-neg-out96.2%
sub-neg96.2%
sub-neg96.2%
distribute-lft-neg-out96.2%
*-commutative96.2%
remove-double-neg96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in y around inf 80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in t around inf 72.8%
Taylor expanded in z around 0 50.5%
if -5.1999999999999998e44 < t < 4.0999999999999998e-89Initial program 92.8%
associate-+l+92.8%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in z around 0 37.8%
Taylor expanded in x around inf 33.3%
Final simplification42.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.4%
associate-+l+93.4%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in z around 0 52.3%
Taylor expanded in x around inf 25.1%
(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 2024184
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))