
(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 (if (or (<= a -2.45e+243) (not (<= a 1e+130))) (+ (fma y z x) (* a (+ t (* z b)))) (+ x (+ (* a t) (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.45e+243) || !(a <= 1e+130)) {
tmp = fma(y, z, x) + (a * (t + (z * b)));
} else {
tmp = x + ((a * t) + (z * (y + (a * b))));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.45e+243) || !(a <= 1e+130)) tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * Float64(y + Float64(a * b))))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.45e+243], N[Not[LessEqual[a, 1e+130]], $MachinePrecision]], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.45 \cdot 10^{+243} \lor \neg \left(a \leq 10^{+130}\right):\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)\\
\end{array}
\end{array}
if a < -2.44999999999999992e243 or 1.0000000000000001e130 < a Initial program 75.7%
associate-+l+75.7%
+-commutative75.7%
fma-def75.7%
associate-*l*82.9%
*-commutative82.9%
*-commutative82.9%
distribute-rgt-out99.9%
*-commutative99.9%
Simplified99.9%
if -2.44999999999999992e243 < a < 1.0000000000000001e130Initial program 92.7%
associate-+l+92.7%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in z around 0 97.6%
Final simplification98.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a z))))
(if (<= a -7.5e+242)
t_1
(if (<= a -6.5e-9)
(* a t)
(if (<= a -4.4e-296)
x
(if (<= a 9.2e-235)
(* y z)
(if (<= a 1.08e-220)
x
(if (<= a 5.8e-125) (* y z) (if (<= a 9.5e-9) t_1 (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * z);
double tmp;
if (a <= -7.5e+242) {
tmp = t_1;
} else if (a <= -6.5e-9) {
tmp = a * t;
} else if (a <= -4.4e-296) {
tmp = x;
} else if (a <= 9.2e-235) {
tmp = y * z;
} else if (a <= 1.08e-220) {
tmp = x;
} else if (a <= 5.8e-125) {
tmp = y * z;
} else if (a <= 9.5e-9) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = b * (a * z)
if (a <= (-7.5d+242)) then
tmp = t_1
else if (a <= (-6.5d-9)) then
tmp = a * t
else if (a <= (-4.4d-296)) then
tmp = x
else if (a <= 9.2d-235) then
tmp = y * z
else if (a <= 1.08d-220) then
tmp = x
else if (a <= 5.8d-125) then
tmp = y * z
else if (a <= 9.5d-9) then
tmp = t_1
else
tmp = 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 t_1 = b * (a * z);
double tmp;
if (a <= -7.5e+242) {
tmp = t_1;
} else if (a <= -6.5e-9) {
tmp = a * t;
} else if (a <= -4.4e-296) {
tmp = x;
} else if (a <= 9.2e-235) {
tmp = y * z;
} else if (a <= 1.08e-220) {
tmp = x;
} else if (a <= 5.8e-125) {
tmp = y * z;
} else if (a <= 9.5e-9) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a * z) tmp = 0 if a <= -7.5e+242: tmp = t_1 elif a <= -6.5e-9: tmp = a * t elif a <= -4.4e-296: tmp = x elif a <= 9.2e-235: tmp = y * z elif a <= 1.08e-220: tmp = x elif a <= 5.8e-125: tmp = y * z elif a <= 9.5e-9: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * z)) tmp = 0.0 if (a <= -7.5e+242) tmp = t_1; elseif (a <= -6.5e-9) tmp = Float64(a * t); elseif (a <= -4.4e-296) tmp = x; elseif (a <= 9.2e-235) tmp = Float64(y * z); elseif (a <= 1.08e-220) tmp = x; elseif (a <= 5.8e-125) tmp = Float64(y * z); elseif (a <= 9.5e-9) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a * z); tmp = 0.0; if (a <= -7.5e+242) tmp = t_1; elseif (a <= -6.5e-9) tmp = a * t; elseif (a <= -4.4e-296) tmp = x; elseif (a <= 9.2e-235) tmp = y * z; elseif (a <= 1.08e-220) tmp = x; elseif (a <= 5.8e-125) tmp = y * z; elseif (a <= 9.5e-9) tmp = t_1; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.5e+242], t$95$1, If[LessEqual[a, -6.5e-9], N[(a * t), $MachinePrecision], If[LessEqual[a, -4.4e-296], x, If[LessEqual[a, 9.2e-235], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.08e-220], x, If[LessEqual[a, 5.8e-125], N[(y * z), $MachinePrecision], If[LessEqual[a, 9.5e-9], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot z\right)\\
\mathbf{if}\;a \leq -7.5 \cdot 10^{+242}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6.5 \cdot 10^{-9}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -4.4 \cdot 10^{-296}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9.2 \cdot 10^{-235}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 1.08 \cdot 10^{-220}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-125}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -7.49999999999999961e242 or 5.8000000000000004e-125 < a < 9.5000000000000007e-9Initial program 84.5%
associate-+l+84.5%
associate-*l*79.8%
Simplified79.8%
Taylor expanded in z around 0 80.2%
Taylor expanded in x around 0 60.9%
Taylor expanded in a around inf 68.5%
+-commutative68.5%
Simplified68.5%
Taylor expanded in b around inf 50.5%
associate-*r*48.3%
*-commutative48.3%
associate-*r*57.7%
Simplified57.7%
if -7.49999999999999961e242 < a < -6.5000000000000003e-9 or 9.5000000000000007e-9 < a Initial program 84.6%
associate-+l+84.6%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in z around 0 91.1%
Taylor expanded in x around 0 78.0%
Taylor expanded in t around inf 49.8%
if -6.5000000000000003e-9 < a < -4.40000000000000024e-296 or 9.19999999999999989e-235 < a < 1.08e-220Initial program 100.0%
associate-+l+100.0%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around inf 55.9%
if -4.40000000000000024e-296 < a < 9.19999999999999989e-235 or 1.08e-220 < a < 5.8000000000000004e-125Initial program 93.0%
associate-+l+93.0%
associate-*l*83.7%
Simplified83.7%
Taylor expanded in y around inf 60.4%
*-commutative60.4%
Simplified60.4%
Final simplification54.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -3.8e+244)
(* b (* a z))
(if (<= a -7.5e-8)
(* a t)
(if (<= a -5.8e-296)
x
(if (<= a 6.2e-235)
(* y z)
(if (<= a 3.4e-220)
x
(if (<= a 5.7e-117)
(* y z)
(if (<= a 0.0038) (* z (* a b)) (* a t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.8e+244) {
tmp = b * (a * z);
} else if (a <= -7.5e-8) {
tmp = a * t;
} else if (a <= -5.8e-296) {
tmp = x;
} else if (a <= 6.2e-235) {
tmp = y * z;
} else if (a <= 3.4e-220) {
tmp = x;
} else if (a <= 5.7e-117) {
tmp = y * z;
} else if (a <= 0.0038) {
tmp = z * (a * b);
} else {
tmp = 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 (a <= (-3.8d+244)) then
tmp = b * (a * z)
else if (a <= (-7.5d-8)) then
tmp = a * t
else if (a <= (-5.8d-296)) then
tmp = x
else if (a <= 6.2d-235) then
tmp = y * z
else if (a <= 3.4d-220) then
tmp = x
else if (a <= 5.7d-117) then
tmp = y * z
else if (a <= 0.0038d0) then
tmp = z * (a * b)
else
tmp = 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 (a <= -3.8e+244) {
tmp = b * (a * z);
} else if (a <= -7.5e-8) {
tmp = a * t;
} else if (a <= -5.8e-296) {
tmp = x;
} else if (a <= 6.2e-235) {
tmp = y * z;
} else if (a <= 3.4e-220) {
tmp = x;
} else if (a <= 5.7e-117) {
tmp = y * z;
} else if (a <= 0.0038) {
tmp = z * (a * b);
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3.8e+244: tmp = b * (a * z) elif a <= -7.5e-8: tmp = a * t elif a <= -5.8e-296: tmp = x elif a <= 6.2e-235: tmp = y * z elif a <= 3.4e-220: tmp = x elif a <= 5.7e-117: tmp = y * z elif a <= 0.0038: tmp = z * (a * b) else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3.8e+244) tmp = Float64(b * Float64(a * z)); elseif (a <= -7.5e-8) tmp = Float64(a * t); elseif (a <= -5.8e-296) tmp = x; elseif (a <= 6.2e-235) tmp = Float64(y * z); elseif (a <= 3.4e-220) tmp = x; elseif (a <= 5.7e-117) tmp = Float64(y * z); elseif (a <= 0.0038) tmp = Float64(z * Float64(a * b)); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3.8e+244) tmp = b * (a * z); elseif (a <= -7.5e-8) tmp = a * t; elseif (a <= -5.8e-296) tmp = x; elseif (a <= 6.2e-235) tmp = y * z; elseif (a <= 3.4e-220) tmp = x; elseif (a <= 5.7e-117) tmp = y * z; elseif (a <= 0.0038) tmp = z * (a * b); else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.8e+244], N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -7.5e-8], N[(a * t), $MachinePrecision], If[LessEqual[a, -5.8e-296], x, If[LessEqual[a, 6.2e-235], N[(y * z), $MachinePrecision], If[LessEqual[a, 3.4e-220], x, If[LessEqual[a, 5.7e-117], N[(y * z), $MachinePrecision], If[LessEqual[a, 0.0038], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+244}:\\
\;\;\;\;b \cdot \left(a \cdot z\right)\\
\mathbf{elif}\;a \leq -7.5 \cdot 10^{-8}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -5.8 \cdot 10^{-296}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{-235}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{-220}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.7 \cdot 10^{-117}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 0.0038:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -3.79999999999999983e244Initial program 72.2%
associate-+l+72.2%
associate-*l*77.7%
Simplified77.7%
Taylor expanded in z around 0 57.0%
Taylor expanded in x around 0 57.0%
Taylor expanded in a around inf 94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in b around inf 67.0%
associate-*r*51.9%
*-commutative51.9%
associate-*r*72.4%
Simplified72.4%
if -3.79999999999999983e244 < a < -7.4999999999999997e-8 or 0.00379999999999999999 < a Initial program 84.6%
associate-+l+84.6%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in z around 0 91.1%
Taylor expanded in x around 0 78.0%
Taylor expanded in t around inf 49.8%
if -7.4999999999999997e-8 < a < -5.79999999999999965e-296 or 6.2e-235 < a < 3.39999999999999993e-220Initial program 100.0%
associate-+l+100.0%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around inf 55.9%
if -5.79999999999999965e-296 < a < 6.2e-235 or 3.39999999999999993e-220 < a < 5.6999999999999999e-117Initial program 93.0%
associate-+l+93.0%
associate-*l*83.7%
Simplified83.7%
Taylor expanded in y around inf 60.4%
*-commutative60.4%
Simplified60.4%
if 5.6999999999999999e-117 < a < 0.00379999999999999999Initial program 95.0%
associate-+l+95.0%
associate-*l*81.5%
Simplified81.5%
Taylor expanded in z around inf 53.3%
Taylor expanded in y around 0 45.3%
Final simplification54.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.65e+243)
(* a (* z b))
(if (<= a -4.2e-7)
(* a t)
(if (<= a -6.2e-296)
x
(if (<= a 2.4e-235)
(* y z)
(if (<= a 5.5e-221)
x
(if (<= a 1.7e-125) (* y z) (if (<= a 6.5e-63) x (* a t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.65e+243) {
tmp = a * (z * b);
} else if (a <= -4.2e-7) {
tmp = a * t;
} else if (a <= -6.2e-296) {
tmp = x;
} else if (a <= 2.4e-235) {
tmp = y * z;
} else if (a <= 5.5e-221) {
tmp = x;
} else if (a <= 1.7e-125) {
tmp = y * z;
} else if (a <= 6.5e-63) {
tmp = x;
} else {
tmp = 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 (a <= (-2.65d+243)) then
tmp = a * (z * b)
else if (a <= (-4.2d-7)) then
tmp = a * t
else if (a <= (-6.2d-296)) then
tmp = x
else if (a <= 2.4d-235) then
tmp = y * z
else if (a <= 5.5d-221) then
tmp = x
else if (a <= 1.7d-125) then
tmp = y * z
else if (a <= 6.5d-63) then
tmp = x
else
tmp = 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 (a <= -2.65e+243) {
tmp = a * (z * b);
} else if (a <= -4.2e-7) {
tmp = a * t;
} else if (a <= -6.2e-296) {
tmp = x;
} else if (a <= 2.4e-235) {
tmp = y * z;
} else if (a <= 5.5e-221) {
tmp = x;
} else if (a <= 1.7e-125) {
tmp = y * z;
} else if (a <= 6.5e-63) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.65e+243: tmp = a * (z * b) elif a <= -4.2e-7: tmp = a * t elif a <= -6.2e-296: tmp = x elif a <= 2.4e-235: tmp = y * z elif a <= 5.5e-221: tmp = x elif a <= 1.7e-125: tmp = y * z elif a <= 6.5e-63: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.65e+243) tmp = Float64(a * Float64(z * b)); elseif (a <= -4.2e-7) tmp = Float64(a * t); elseif (a <= -6.2e-296) tmp = x; elseif (a <= 2.4e-235) tmp = Float64(y * z); elseif (a <= 5.5e-221) tmp = x; elseif (a <= 1.7e-125) tmp = Float64(y * z); elseif (a <= 6.5e-63) tmp = x; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.65e+243) tmp = a * (z * b); elseif (a <= -4.2e-7) tmp = a * t; elseif (a <= -6.2e-296) tmp = x; elseif (a <= 2.4e-235) tmp = y * z; elseif (a <= 5.5e-221) tmp = x; elseif (a <= 1.7e-125) tmp = y * z; elseif (a <= 6.5e-63) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.65e+243], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -4.2e-7], N[(a * t), $MachinePrecision], If[LessEqual[a, -6.2e-296], x, If[LessEqual[a, 2.4e-235], N[(y * z), $MachinePrecision], If[LessEqual[a, 5.5e-221], x, If[LessEqual[a, 1.7e-125], N[(y * z), $MachinePrecision], If[LessEqual[a, 6.5e-63], x, N[(a * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.65 \cdot 10^{+243}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-7}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -6.2 \cdot 10^{-296}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-235}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-221}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-125}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-63}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -2.6499999999999999e243Initial program 72.2%
associate-+l+72.2%
associate-*l*77.7%
Simplified77.7%
Taylor expanded in z around inf 57.4%
Taylor expanded in y around 0 67.0%
if -2.6499999999999999e243 < a < -4.2e-7 or 6.4999999999999998e-63 < a Initial program 85.7%
associate-+l+85.7%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in z around 0 91.7%
Taylor expanded in x around 0 78.1%
Taylor expanded in t around inf 48.0%
if -4.2e-7 < a < -6.2000000000000004e-296 or 2.40000000000000011e-235 < a < 5.49999999999999966e-221 or 1.69999999999999988e-125 < a < 6.4999999999999998e-63Initial program 98.4%
associate-+l+98.4%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in x around inf 54.3%
if -6.2000000000000004e-296 < a < 2.40000000000000011e-235 or 5.49999999999999966e-221 < a < 1.69999999999999988e-125Initial program 93.0%
associate-+l+93.0%
associate-*l*83.7%
Simplified83.7%
Taylor expanded in y around inf 60.4%
*-commutative60.4%
Simplified60.4%
Final simplification53.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -4.5e-8)
(* a t)
(if (<= a -8.1e-296)
x
(if (<= a 1.7e-234)
(* y z)
(if (<= a 8.2e-219)
x
(if (<= a 1.1e-117) (* y z) (if (<= a 1.15e-58) x (* a t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.5e-8) {
tmp = a * t;
} else if (a <= -8.1e-296) {
tmp = x;
} else if (a <= 1.7e-234) {
tmp = y * z;
} else if (a <= 8.2e-219) {
tmp = x;
} else if (a <= 1.1e-117) {
tmp = y * z;
} else if (a <= 1.15e-58) {
tmp = x;
} else {
tmp = 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 (a <= (-4.5d-8)) then
tmp = a * t
else if (a <= (-8.1d-296)) then
tmp = x
else if (a <= 1.7d-234) then
tmp = y * z
else if (a <= 8.2d-219) then
tmp = x
else if (a <= 1.1d-117) then
tmp = y * z
else if (a <= 1.15d-58) then
tmp = x
else
tmp = 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 (a <= -4.5e-8) {
tmp = a * t;
} else if (a <= -8.1e-296) {
tmp = x;
} else if (a <= 1.7e-234) {
tmp = y * z;
} else if (a <= 8.2e-219) {
tmp = x;
} else if (a <= 1.1e-117) {
tmp = y * z;
} else if (a <= 1.15e-58) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.5e-8: tmp = a * t elif a <= -8.1e-296: tmp = x elif a <= 1.7e-234: tmp = y * z elif a <= 8.2e-219: tmp = x elif a <= 1.1e-117: tmp = y * z elif a <= 1.15e-58: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.5e-8) tmp = Float64(a * t); elseif (a <= -8.1e-296) tmp = x; elseif (a <= 1.7e-234) tmp = Float64(y * z); elseif (a <= 8.2e-219) tmp = x; elseif (a <= 1.1e-117) tmp = Float64(y * z); elseif (a <= 1.15e-58) tmp = x; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4.5e-8) tmp = a * t; elseif (a <= -8.1e-296) tmp = x; elseif (a <= 1.7e-234) tmp = y * z; elseif (a <= 8.2e-219) tmp = x; elseif (a <= 1.1e-117) tmp = y * z; elseif (a <= 1.15e-58) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.5e-8], N[(a * t), $MachinePrecision], If[LessEqual[a, -8.1e-296], x, If[LessEqual[a, 1.7e-234], N[(y * z), $MachinePrecision], If[LessEqual[a, 8.2e-219], x, If[LessEqual[a, 1.1e-117], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.15e-58], x, N[(a * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{-8}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -8.1 \cdot 10^{-296}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-234}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{-219}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-117}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{-58}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -4.49999999999999993e-8 or 1.1499999999999999e-58 < a Initial program 84.0%
associate-+l+84.0%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in z around 0 87.5%
Taylor expanded in x around 0 75.6%
Taylor expanded in t around inf 45.8%
if -4.49999999999999993e-8 < a < -8.10000000000000051e-296 or 1.69999999999999993e-234 < a < 8.2e-219 or 1.1000000000000001e-117 < a < 1.1499999999999999e-58Initial program 98.4%
associate-+l+98.4%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in x around inf 54.3%
if -8.10000000000000051e-296 < a < 1.69999999999999993e-234 or 8.2e-219 < a < 1.1000000000000001e-117Initial program 93.0%
associate-+l+93.0%
associate-*l*83.7%
Simplified83.7%
Taylor expanded in y around inf 60.4%
*-commutative60.4%
Simplified60.4%
Final simplification50.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -1.32e+160)
t_1
(if (<= a -2.4e-88)
(+ x (* a t))
(if (<= a 1.5e-116)
(+ x (* y z))
(if (<= a 2.45e-64) (+ x (* b (* a 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 <= -1.32e+160) {
tmp = t_1;
} else if (a <= -2.4e-88) {
tmp = x + (a * t);
} else if (a <= 1.5e-116) {
tmp = x + (y * z);
} else if (a <= 2.45e-64) {
tmp = x + (b * (a * 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 <= (-1.32d+160)) then
tmp = t_1
else if (a <= (-2.4d-88)) then
tmp = x + (a * t)
else if (a <= 1.5d-116) then
tmp = x + (y * z)
else if (a <= 2.45d-64) then
tmp = x + (b * (a * 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 <= -1.32e+160) {
tmp = t_1;
} else if (a <= -2.4e-88) {
tmp = x + (a * t);
} else if (a <= 1.5e-116) {
tmp = x + (y * z);
} else if (a <= 2.45e-64) {
tmp = x + (b * (a * 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 <= -1.32e+160: tmp = t_1 elif a <= -2.4e-88: tmp = x + (a * t) elif a <= 1.5e-116: tmp = x + (y * z) elif a <= 2.45e-64: tmp = x + (b * (a * 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 <= -1.32e+160) tmp = t_1; elseif (a <= -2.4e-88) tmp = Float64(x + Float64(a * t)); elseif (a <= 1.5e-116) tmp = Float64(x + Float64(y * z)); elseif (a <= 2.45e-64) tmp = Float64(x + Float64(b * Float64(a * 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 <= -1.32e+160) tmp = t_1; elseif (a <= -2.4e-88) tmp = x + (a * t); elseif (a <= 1.5e-116) tmp = x + (y * z); elseif (a <= 2.45e-64) tmp = x + (b * (a * 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, -1.32e+160], t$95$1, If[LessEqual[a, -2.4e-88], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.5e-116], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.45e-64], N[(x + N[(b * N[(a * z), $MachinePrecision]), $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 -1.32 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{-88}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-116}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 2.45 \cdot 10^{-64}:\\
\;\;\;\;x + b \cdot \left(a \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.32e160 or 2.4500000000000001e-64 < a Initial program 82.1%
associate-+l+82.1%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in z around 0 86.5%
Taylor expanded in x around 0 79.1%
Taylor expanded in a around inf 79.1%
+-commutative79.1%
Simplified79.1%
if -1.32e160 < a < -2.4e-88Initial program 90.7%
associate-+l+90.7%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in z around 0 73.6%
+-commutative73.6%
Simplified73.6%
if -2.4e-88 < a < 1.50000000000000013e-116Initial program 96.6%
associate-+l+96.6%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in a around 0 90.3%
if 1.50000000000000013e-116 < a < 2.4500000000000001e-64Initial program 99.7%
associate-+l+99.7%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in z around 0 100.0%
Taylor expanded in y around 0 82.9%
distribute-lft-in82.9%
+-commutative82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in b around inf 80.4%
associate-*r*47.8%
*-commutative47.8%
associate-*r*47.4%
Simplified97.2%
Final simplification82.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -5.3e+243)
t_1
(if (<= a 3.6e+151) (+ x (+ (* a t) (* z (+ y (* a b))))) (+ x 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 <= -5.3e+243) {
tmp = t_1;
} else if (a <= 3.6e+151) {
tmp = x + ((a * t) + (z * (y + (a * b))));
} else {
tmp = x + 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 <= (-5.3d+243)) then
tmp = t_1
else if (a <= 3.6d+151) then
tmp = x + ((a * t) + (z * (y + (a * b))))
else
tmp = x + 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 <= -5.3e+243) {
tmp = t_1;
} else if (a <= 3.6e+151) {
tmp = x + ((a * t) + (z * (y + (a * b))));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -5.3e+243: tmp = t_1 elif a <= 3.6e+151: tmp = x + ((a * t) + (z * (y + (a * b)))) else: tmp = x + 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 <= -5.3e+243) tmp = t_1; elseif (a <= 3.6e+151) tmp = Float64(x + Float64(Float64(a * t) + Float64(z * Float64(y + Float64(a * b))))); else tmp = Float64(x + 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 <= -5.3e+243) tmp = t_1; elseif (a <= 3.6e+151) tmp = x + ((a * t) + (z * (y + (a * b)))); else tmp = x + 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, -5.3e+243], t$95$1, If[LessEqual[a, 3.6e+151], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -5.3 \cdot 10^{+243}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{+151}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if a < -5.2999999999999997e243Initial program 72.2%
associate-+l+72.2%
associate-*l*77.7%
Simplified77.7%
Taylor expanded in z around 0 57.0%
Taylor expanded in x around 0 57.0%
Taylor expanded in a around inf 94.4%
+-commutative94.4%
Simplified94.4%
if -5.2999999999999997e243 < a < 3.6e151Initial program 92.8%
associate-+l+92.8%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in z around 0 97.6%
if 3.6e151 < a Initial program 74.6%
associate-+l+74.6%
+-commutative74.6%
fma-def74.6%
associate-*l*83.8%
*-commutative83.8%
*-commutative83.8%
distribute-rgt-out99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
Final simplification97.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -1.7e+159)
t_1
(if (<= a -7.2e-90)
(+ x (* a t))
(if (<= a 9.5e-64) (+ 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 <= -1.7e+159) {
tmp = t_1;
} else if (a <= -7.2e-90) {
tmp = x + (a * t);
} else if (a <= 9.5e-64) {
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 <= (-1.7d+159)) then
tmp = t_1
else if (a <= (-7.2d-90)) then
tmp = x + (a * t)
else if (a <= 9.5d-64) 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 <= -1.7e+159) {
tmp = t_1;
} else if (a <= -7.2e-90) {
tmp = x + (a * t);
} else if (a <= 9.5e-64) {
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 <= -1.7e+159: tmp = t_1 elif a <= -7.2e-90: tmp = x + (a * t) elif a <= 9.5e-64: 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 <= -1.7e+159) tmp = t_1; elseif (a <= -7.2e-90) tmp = Float64(x + Float64(a * t)); elseif (a <= 9.5e-64) 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 <= -1.7e+159) tmp = t_1; elseif (a <= -7.2e-90) tmp = x + (a * t); elseif (a <= 9.5e-64) 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, -1.7e+159], t$95$1, If[LessEqual[a, -7.2e-90], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e-64], 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 -1.7 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -7.2 \cdot 10^{-90}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-64}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.69999999999999996e159 or 9.50000000000000043e-64 < a Initial program 82.1%
associate-+l+82.1%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in z around 0 86.5%
Taylor expanded in x around 0 79.1%
Taylor expanded in a around inf 79.1%
+-commutative79.1%
Simplified79.1%
if -1.69999999999999996e159 < a < -7.19999999999999961e-90Initial program 90.7%
associate-+l+90.7%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in z around 0 73.6%
+-commutative73.6%
Simplified73.6%
if -7.19999999999999961e-90 < a < 9.50000000000000043e-64Initial program 97.0%
associate-+l+97.0%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in a around 0 85.8%
Final simplification80.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -4.5e+244)
(* b (* a z))
(if (or (<= a -1.05e-90) (not (<= a 1.05e-33)))
(+ x (* a t))
(+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.5e+244) {
tmp = b * (a * z);
} else if ((a <= -1.05e-90) || !(a <= 1.05e-33)) {
tmp = x + (a * t);
} 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 <= (-4.5d+244)) then
tmp = b * (a * z)
else if ((a <= (-1.05d-90)) .or. (.not. (a <= 1.05d-33))) then
tmp = x + (a * t)
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 <= -4.5e+244) {
tmp = b * (a * z);
} else if ((a <= -1.05e-90) || !(a <= 1.05e-33)) {
tmp = x + (a * t);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.5e+244: tmp = b * (a * z) elif (a <= -1.05e-90) or not (a <= 1.05e-33): tmp = x + (a * t) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.5e+244) tmp = Float64(b * Float64(a * z)); elseif ((a <= -1.05e-90) || !(a <= 1.05e-33)) tmp = Float64(x + Float64(a * t)); 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 <= -4.5e+244) tmp = b * (a * z); elseif ((a <= -1.05e-90) || ~((a <= 1.05e-33))) tmp = x + (a * t); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.5e+244], N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -1.05e-90], N[Not[LessEqual[a, 1.05e-33]], $MachinePrecision]], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{+244}:\\
\;\;\;\;b \cdot \left(a \cdot z\right)\\
\mathbf{elif}\;a \leq -1.05 \cdot 10^{-90} \lor \neg \left(a \leq 1.05 \cdot 10^{-33}\right):\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -4.5000000000000003e244Initial program 72.2%
associate-+l+72.2%
associate-*l*77.7%
Simplified77.7%
Taylor expanded in z around 0 57.0%
Taylor expanded in x around 0 57.0%
Taylor expanded in a around inf 94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in b around inf 67.0%
associate-*r*51.9%
*-commutative51.9%
associate-*r*72.4%
Simplified72.4%
if -4.5000000000000003e244 < a < -1.05e-90 or 1.05e-33 < a Initial program 86.0%
associate-+l+86.0%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in z around 0 64.6%
+-commutative64.6%
Simplified64.6%
if -1.05e-90 < a < 1.05e-33Initial program 96.2%
associate-+l+96.2%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in a around 0 82.8%
Final simplification72.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.8e-88) (not (<= a 2.5e-120))) (+ 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 <= -1.8e-88) || !(a <= 2.5e-120)) {
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 <= (-1.8d-88)) .or. (.not. (a <= 2.5d-120))) 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 <= -1.8e-88) || !(a <= 2.5e-120)) {
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 <= -1.8e-88) or not (a <= 2.5e-120): 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 <= -1.8e-88) || !(a <= 2.5e-120)) 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 <= -1.8e-88) || ~((a <= 2.5e-120))) 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, -1.8e-88], N[Not[LessEqual[a, 2.5e-120]], $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 -1.8 \cdot 10^{-88} \lor \neg \left(a \leq 2.5 \cdot 10^{-120}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -1.8e-88 or 2.50000000000000003e-120 < a Initial program 85.4%
associate-+l+85.4%
+-commutative85.4%
fma-def85.4%
associate-*l*88.2%
*-commutative88.2%
*-commutative88.2%
distribute-rgt-out94.7%
*-commutative94.7%
Simplified94.7%
Taylor expanded in y around 0 86.3%
if -1.8e-88 < a < 2.50000000000000003e-120Initial program 96.6%
associate-+l+96.6%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in a around 0 90.3%
Final simplification87.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.6e+188) (not (<= b 2.8e+60))) (+ x (* a (+ t (* z b)))) (+ (* a t) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.6e+188) || !(b <= 2.8e+60)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (a * t) + (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 ((b <= (-5.6d+188)) .or. (.not. (b <= 2.8d+60))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (a * t) + (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 ((b <= -5.6e+188) || !(b <= 2.8e+60)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (a * t) + (x + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.6e+188) or not (b <= 2.8e+60): tmp = x + (a * (t + (z * b))) else: tmp = (a * t) + (x + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.6e+188) || !(b <= 2.8e+60)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(a * t) + Float64(x + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5.6e+188) || ~((b <= 2.8e+60))) tmp = x + (a * (t + (z * b))); else tmp = (a * t) + (x + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.6e+188], N[Not[LessEqual[b, 2.8e+60]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * t), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.6 \cdot 10^{+188} \lor \neg \left(b \leq 2.8 \cdot 10^{+60}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot t + \left(x + y \cdot z\right)\\
\end{array}
\end{array}
if b < -5.5999999999999996e188 or 2.8e60 < b Initial program 83.7%
associate-+l+83.7%
+-commutative83.7%
fma-def83.7%
associate-*l*79.5%
*-commutative79.5%
*-commutative79.5%
distribute-rgt-out89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y around 0 89.3%
if -5.5999999999999996e188 < b < 2.8e60Initial program 91.4%
associate-+l+91.4%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in t around inf 89.4%
Final simplification89.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.9e+137) (not (<= t 2.2e+167))) (* a t) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.9e+137) || !(t <= 2.2e+167)) {
tmp = a * t;
} 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 ((t <= (-2.9d+137)) .or. (.not. (t <= 2.2d+167))) then
tmp = a * t
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 ((t <= -2.9e+137) || !(t <= 2.2e+167)) {
tmp = a * t;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.9e+137) or not (t <= 2.2e+167): tmp = a * t else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.9e+137) || !(t <= 2.2e+167)) tmp = Float64(a * t); 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 ((t <= -2.9e+137) || ~((t <= 2.2e+167))) tmp = a * t; else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.9e+137], N[Not[LessEqual[t, 2.2e+167]], $MachinePrecision]], N[(a * t), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+137} \lor \neg \left(t \leq 2.2 \cdot 10^{+167}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if t < -2.89999999999999985e137 or 2.20000000000000003e167 < t Initial program 82.5%
associate-+l+82.5%
associate-*l*79.6%
Simplified79.6%
Taylor expanded in z around 0 87.3%
Taylor expanded in x around 0 76.4%
Taylor expanded in t around inf 66.0%
if -2.89999999999999985e137 < t < 2.20000000000000003e167Initial program 91.4%
associate-+l+91.4%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in a around 0 61.9%
Final simplification62.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -5.2e-8) (not (<= a 7e-59))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -5.2e-8) || !(a <= 7e-59)) {
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 ((a <= (-5.2d-8)) .or. (.not. (a <= 7d-59))) 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 ((a <= -5.2e-8) || !(a <= 7e-59)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -5.2e-8) or not (a <= 7e-59): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -5.2e-8) || !(a <= 7e-59)) 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 ((a <= -5.2e-8) || ~((a <= 7e-59))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -5.2e-8], N[Not[LessEqual[a, 7e-59]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-8} \lor \neg \left(a \leq 7 \cdot 10^{-59}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.2000000000000002e-8 or 7.0000000000000002e-59 < a Initial program 84.0%
associate-+l+84.0%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in z around 0 87.5%
Taylor expanded in x around 0 75.6%
Taylor expanded in t around inf 45.8%
if -5.2000000000000002e-8 < a < 7.0000000000000002e-59Initial program 96.3%
associate-+l+96.3%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in x around inf 44.4%
Final simplification45.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 89.2%
associate-+l+89.2%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in x around inf 26.9%
Final simplification26.9%
(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 2024029
(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)))