
(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 -4.3e+114) (not (<= z 1e+68))) (fma z (fma a b y) (fma t a x)) (fma a (+ t (* z b)) (fma y z x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.3e+114) || !(z <= 1e+68)) {
tmp = fma(z, fma(a, b, y), fma(t, a, x));
} else {
tmp = fma(a, (t + (z * b)), fma(y, z, x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.3e+114) || !(z <= 1e+68)) tmp = fma(z, fma(a, b, y), fma(t, a, x)); else tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.3e+114], N[Not[LessEqual[z, 1e+68]], $MachinePrecision]], N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+114} \lor \neg \left(z \leq 10^{+68}\right):\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\end{array}
\end{array}
if z < -4.3000000000000001e114 or 9.99999999999999953e67 < z Initial program 82.9%
+-commutative82.9%
+-commutative82.9%
associate-+l+82.9%
associate-+r+82.9%
*-commutative82.9%
associate-*l*91.3%
*-commutative91.3%
distribute-lft-out98.7%
fma-def99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
if -4.3000000000000001e114 < z < 9.99999999999999953e67Initial program 96.0%
associate-+l+96.0%
+-commutative96.0%
*-commutative96.0%
associate-*l*96.5%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z 9e+131) (fma a (+ t (* z b)) (fma y z x)) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 9e+131) {
tmp = fma(a, (t + (z * b)), fma(y, z, x));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 9e+131) tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, x)); else tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 9e+131], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 9 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 9.00000000000000039e131Initial program 92.4%
associate-+l+92.4%
+-commutative92.4%
*-commutative92.4%
associate-*l*93.7%
distribute-lft-out96.4%
fma-def97.3%
+-commutative97.3%
fma-def97.3%
Simplified97.3%
if 9.00000000000000039e131 < z Initial program 87.9%
+-commutative87.9%
+-commutative87.9%
associate-+l+87.9%
associate-+r+87.9%
*-commutative87.9%
associate-*l*96.9%
*-commutative96.9%
distribute-lft-out99.9%
fma-def99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around 0 96.9%
Final simplification97.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* a t) (+ x (* z y))) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (+ x (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * t) + (x + (z * y))) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * t) + (x + (z * y))) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((a * t) + (x + (z * y))) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a * t) + Float64(x + Float64(z * y))) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; 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) t_1 = ((a * t) + (x + (z * y))) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + \left(x + z \cdot y\right)\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 97.9%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
+-commutative0.0%
*-commutative0.0%
associate-*l*18.8%
distribute-lft-out56.3%
fma-def68.8%
+-commutative68.8%
fma-def68.8%
Simplified68.8%
Taylor expanded in y around 0 75.5%
Final simplification96.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -7e+127)
(* a t)
(if (<= a -1.02e-38)
t_1
(if (<= a -1.45e-137)
(* z y)
(if (<= a 1.3e-278)
x
(if (<= a 4.1e+61)
(* z y)
(if (<= a 1e+117)
x
(if (<= a 3.8e+181)
(* a t)
(if (<= a 1.35e+235) t_1 (* a t)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -7e+127) {
tmp = a * t;
} else if (a <= -1.02e-38) {
tmp = t_1;
} else if (a <= -1.45e-137) {
tmp = z * y;
} else if (a <= 1.3e-278) {
tmp = x;
} else if (a <= 4.1e+61) {
tmp = z * y;
} else if (a <= 1e+117) {
tmp = x;
} else if (a <= 3.8e+181) {
tmp = a * t;
} else if (a <= 1.35e+235) {
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 = a * (z * b)
if (a <= (-7d+127)) then
tmp = a * t
else if (a <= (-1.02d-38)) then
tmp = t_1
else if (a <= (-1.45d-137)) then
tmp = z * y
else if (a <= 1.3d-278) then
tmp = x
else if (a <= 4.1d+61) then
tmp = z * y
else if (a <= 1d+117) then
tmp = x
else if (a <= 3.8d+181) then
tmp = a * t
else if (a <= 1.35d+235) 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 = a * (z * b);
double tmp;
if (a <= -7e+127) {
tmp = a * t;
} else if (a <= -1.02e-38) {
tmp = t_1;
} else if (a <= -1.45e-137) {
tmp = z * y;
} else if (a <= 1.3e-278) {
tmp = x;
} else if (a <= 4.1e+61) {
tmp = z * y;
} else if (a <= 1e+117) {
tmp = x;
} else if (a <= 3.8e+181) {
tmp = a * t;
} else if (a <= 1.35e+235) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -7e+127: tmp = a * t elif a <= -1.02e-38: tmp = t_1 elif a <= -1.45e-137: tmp = z * y elif a <= 1.3e-278: tmp = x elif a <= 4.1e+61: tmp = z * y elif a <= 1e+117: tmp = x elif a <= 3.8e+181: tmp = a * t elif a <= 1.35e+235: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -7e+127) tmp = Float64(a * t); elseif (a <= -1.02e-38) tmp = t_1; elseif (a <= -1.45e-137) tmp = Float64(z * y); elseif (a <= 1.3e-278) tmp = x; elseif (a <= 4.1e+61) tmp = Float64(z * y); elseif (a <= 1e+117) tmp = x; elseif (a <= 3.8e+181) tmp = Float64(a * t); elseif (a <= 1.35e+235) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (a <= -7e+127) tmp = a * t; elseif (a <= -1.02e-38) tmp = t_1; elseif (a <= -1.45e-137) tmp = z * y; elseif (a <= 1.3e-278) tmp = x; elseif (a <= 4.1e+61) tmp = z * y; elseif (a <= 1e+117) tmp = x; elseif (a <= 3.8e+181) tmp = a * t; elseif (a <= 1.35e+235) tmp = t_1; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7e+127], N[(a * t), $MachinePrecision], If[LessEqual[a, -1.02e-38], t$95$1, If[LessEqual[a, -1.45e-137], N[(z * y), $MachinePrecision], If[LessEqual[a, 1.3e-278], x, If[LessEqual[a, 4.1e+61], N[(z * y), $MachinePrecision], If[LessEqual[a, 1e+117], x, If[LessEqual[a, 3.8e+181], N[(a * t), $MachinePrecision], If[LessEqual[a, 1.35e+235], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -7 \cdot 10^{+127}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -1.02 \cdot 10^{-38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.45 \cdot 10^{-137}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-278}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{+61}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 10^{+117}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{+181}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{+235}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -6.99999999999999956e127 or 1.00000000000000005e117 < a < 3.8000000000000001e181 or 1.3499999999999999e235 < a Initial program 78.9%
associate-+l+78.9%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in t around inf 69.0%
if -6.99999999999999956e127 < a < -1.01999999999999998e-38 or 3.8000000000000001e181 < a < 1.3499999999999999e235Initial program 94.2%
associate-+l+94.2%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in z around inf 64.0%
Taylor expanded in y around 0 51.4%
if -1.01999999999999998e-38 < a < -1.44999999999999993e-137 or 1.2999999999999999e-278 < a < 4.09999999999999972e61Initial program 96.7%
associate-+l+96.7%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in y around inf 46.1%
*-commutative46.1%
Simplified46.1%
if -1.44999999999999993e-137 < a < 1.2999999999999999e-278 or 4.09999999999999972e61 < a < 1.00000000000000005e117Initial program 98.0%
associate-+l+98.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 65.6%
Final simplification56.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -4e+120)
(* a t)
(if (<= a -2.95e-34)
(* a (* z b))
(if (<= a -2.5e-134)
(* z y)
(if (<= a 1.02e-278)
x
(if (<= a 1.85e+64)
(* z y)
(if (<= a 1e+117)
x
(if (<= a 5.8e+179)
(* a t)
(if (<= a 3.5e+232) (* b (* z a)) (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4e+120) {
tmp = a * t;
} else if (a <= -2.95e-34) {
tmp = a * (z * b);
} else if (a <= -2.5e-134) {
tmp = z * y;
} else if (a <= 1.02e-278) {
tmp = x;
} else if (a <= 1.85e+64) {
tmp = z * y;
} else if (a <= 1e+117) {
tmp = x;
} else if (a <= 5.8e+179) {
tmp = a * t;
} else if (a <= 3.5e+232) {
tmp = b * (z * a);
} 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 <= (-4d+120)) then
tmp = a * t
else if (a <= (-2.95d-34)) then
tmp = a * (z * b)
else if (a <= (-2.5d-134)) then
tmp = z * y
else if (a <= 1.02d-278) then
tmp = x
else if (a <= 1.85d+64) then
tmp = z * y
else if (a <= 1d+117) then
tmp = x
else if (a <= 5.8d+179) then
tmp = a * t
else if (a <= 3.5d+232) then
tmp = b * (z * a)
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 <= -4e+120) {
tmp = a * t;
} else if (a <= -2.95e-34) {
tmp = a * (z * b);
} else if (a <= -2.5e-134) {
tmp = z * y;
} else if (a <= 1.02e-278) {
tmp = x;
} else if (a <= 1.85e+64) {
tmp = z * y;
} else if (a <= 1e+117) {
tmp = x;
} else if (a <= 5.8e+179) {
tmp = a * t;
} else if (a <= 3.5e+232) {
tmp = b * (z * a);
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4e+120: tmp = a * t elif a <= -2.95e-34: tmp = a * (z * b) elif a <= -2.5e-134: tmp = z * y elif a <= 1.02e-278: tmp = x elif a <= 1.85e+64: tmp = z * y elif a <= 1e+117: tmp = x elif a <= 5.8e+179: tmp = a * t elif a <= 3.5e+232: tmp = b * (z * a) else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4e+120) tmp = Float64(a * t); elseif (a <= -2.95e-34) tmp = Float64(a * Float64(z * b)); elseif (a <= -2.5e-134) tmp = Float64(z * y); elseif (a <= 1.02e-278) tmp = x; elseif (a <= 1.85e+64) tmp = Float64(z * y); elseif (a <= 1e+117) tmp = x; elseif (a <= 5.8e+179) tmp = Float64(a * t); elseif (a <= 3.5e+232) tmp = Float64(b * Float64(z * a)); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4e+120) tmp = a * t; elseif (a <= -2.95e-34) tmp = a * (z * b); elseif (a <= -2.5e-134) tmp = z * y; elseif (a <= 1.02e-278) tmp = x; elseif (a <= 1.85e+64) tmp = z * y; elseif (a <= 1e+117) tmp = x; elseif (a <= 5.8e+179) tmp = a * t; elseif (a <= 3.5e+232) tmp = b * (z * a); else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4e+120], N[(a * t), $MachinePrecision], If[LessEqual[a, -2.95e-34], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.5e-134], N[(z * y), $MachinePrecision], If[LessEqual[a, 1.02e-278], x, If[LessEqual[a, 1.85e+64], N[(z * y), $MachinePrecision], If[LessEqual[a, 1e+117], x, If[LessEqual[a, 5.8e+179], N[(a * t), $MachinePrecision], If[LessEqual[a, 3.5e+232], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{+120}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -2.95 \cdot 10^{-34}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -2.5 \cdot 10^{-134}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 1.02 \cdot 10^{-278}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{+64}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 10^{+117}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{+179}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+232}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -3.9999999999999999e120 or 1.00000000000000005e117 < a < 5.80000000000000038e179 or 3.50000000000000013e232 < a Initial program 78.9%
associate-+l+78.9%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in t around inf 69.0%
if -3.9999999999999999e120 < a < -2.9500000000000001e-34Initial program 95.1%
associate-+l+95.1%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in z around inf 66.1%
Taylor expanded in y around 0 46.2%
if -2.9500000000000001e-34 < a < -2.5000000000000002e-134 or 1.01999999999999993e-278 < a < 1.84999999999999992e64Initial program 96.7%
associate-+l+96.7%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in y around inf 46.1%
*-commutative46.1%
Simplified46.1%
if -2.5000000000000002e-134 < a < 1.01999999999999993e-278 or 1.84999999999999992e64 < a < 1.00000000000000005e117Initial program 98.0%
associate-+l+98.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 65.6%
if 5.80000000000000038e179 < a < 3.50000000000000013e232Initial program 90.9%
associate-+l+90.9%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in z around inf 56.6%
Taylor expanded in y around 0 70.2%
Taylor expanded in b around 0 70.2%
associate-*r*47.9%
*-commutative47.9%
associate-*r*70.5%
Simplified70.5%
Final simplification56.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z 4.2e+41) (+ (+ (* a (* z b)) (* a t)) (+ x (* z y))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 4.2e+41) {
tmp = ((a * (z * b)) + (a * t)) + (x + (z * y));
} else {
tmp = x + (z * (y + (a * 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 <= 4.2d+41) then
tmp = ((a * (z * b)) + (a * t)) + (x + (z * y))
else
tmp = x + (z * (y + (a * 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 <= 4.2e+41) {
tmp = ((a * (z * b)) + (a * t)) + (x + (z * y));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 4.2e+41: tmp = ((a * (z * b)) + (a * t)) + (x + (z * y)) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 4.2e+41) tmp = Float64(Float64(Float64(a * Float64(z * b)) + Float64(a * t)) + Float64(x + Float64(z * y))); else tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 4.2e+41) tmp = ((a * (z * b)) + (a * t)) + (x + (z * y)); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 4.2e+41], N[(N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.2 \cdot 10^{+41}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + a \cdot t\right) + \left(x + z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 4.1999999999999999e41Initial program 93.8%
associate-+l+93.8%
associate-*l*94.7%
Simplified94.7%
if 4.1999999999999999e41 < z Initial program 83.7%
+-commutative83.7%
+-commutative83.7%
associate-+l+83.7%
associate-+r+83.7%
*-commutative83.7%
associate-*l*91.8%
*-commutative91.8%
distribute-lft-out95.9%
fma-def95.9%
fma-def95.9%
+-commutative95.9%
fma-def95.9%
Simplified95.9%
Taylor expanded in t around 0 94.0%
Final simplification94.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.2e+73)
(* z (* a b))
(if (or (<= z -2.8e+49)
(and (not (<= z -3.8e-29))
(or (<= z -1e-61) (not (<= z 1.55e+54)))))
(* z y)
(+ x (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e+73) {
tmp = z * (a * b);
} else if ((z <= -2.8e+49) || (!(z <= -3.8e-29) && ((z <= -1e-61) || !(z <= 1.55e+54)))) {
tmp = z * y;
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.2d+73)) then
tmp = z * (a * b)
else if ((z <= (-2.8d+49)) .or. (.not. (z <= (-3.8d-29))) .and. (z <= (-1d-61)) .or. (.not. (z <= 1.55d+54))) then
tmp = z * y
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e+73) {
tmp = z * (a * b);
} else if ((z <= -2.8e+49) || (!(z <= -3.8e-29) && ((z <= -1e-61) || !(z <= 1.55e+54)))) {
tmp = z * y;
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.2e+73: tmp = z * (a * b) elif (z <= -2.8e+49) or (not (z <= -3.8e-29) and ((z <= -1e-61) or not (z <= 1.55e+54))): tmp = z * y else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.2e+73) tmp = Float64(z * Float64(a * b)); elseif ((z <= -2.8e+49) || (!(z <= -3.8e-29) && ((z <= -1e-61) || !(z <= 1.55e+54)))) tmp = Float64(z * y); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.2e+73) tmp = z * (a * b); elseif ((z <= -2.8e+49) || (~((z <= -3.8e-29)) && ((z <= -1e-61) || ~((z <= 1.55e+54))))) tmp = z * y; else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.2e+73], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.8e+49], And[N[Not[LessEqual[z, -3.8e-29]], $MachinePrecision], Or[LessEqual[z, -1e-61], N[Not[LessEqual[z, 1.55e+54]], $MachinePrecision]]]], N[(z * y), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+73}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{+49} \lor \neg \left(z \leq -3.8 \cdot 10^{-29}\right) \land \left(z \leq -1 \cdot 10^{-61} \lor \neg \left(z \leq 1.55 \cdot 10^{+54}\right)\right):\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -4.2000000000000003e73Initial program 81.1%
associate-+l+81.1%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in z around inf 83.6%
Taylor expanded in a around inf 52.7%
associate-*r*56.6%
*-commutative56.6%
Simplified56.6%
if -4.2000000000000003e73 < z < -2.7999999999999998e49 or -3.79999999999999976e-29 < z < -1e-61 or 1.55e54 < z Initial program 87.1%
associate-+l+87.1%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in y around inf 56.4%
*-commutative56.4%
Simplified56.4%
if -2.7999999999999998e49 < z < -3.79999999999999976e-29 or -1e-61 < z < 1.55e54Initial program 97.3%
associate-+l+97.3%
associate-*l*97.9%
Simplified97.9%
Taylor expanded in z around 0 76.8%
Final simplification68.2%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -3.2e-62)
(not (or (<= z 2.7e-9) (and (not (<= z 1.08e+16)) (<= z 4.5e+44)))))
(* z (+ y (* a b)))
(+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.2e-62) || !((z <= 2.7e-9) || (!(z <= 1.08e+16) && (z <= 4.5e+44)))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-3.2d-62)) .or. (.not. (z <= 2.7d-9) .or. (.not. (z <= 1.08d+16)) .and. (z <= 4.5d+44))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.2e-62) || !((z <= 2.7e-9) || (!(z <= 1.08e+16) && (z <= 4.5e+44)))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.2e-62) or not ((z <= 2.7e-9) or (not (z <= 1.08e+16) and (z <= 4.5e+44))): tmp = z * (y + (a * b)) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.2e-62) || !((z <= 2.7e-9) || (!(z <= 1.08e+16) && (z <= 4.5e+44)))) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -3.2e-62) || ~(((z <= 2.7e-9) || (~((z <= 1.08e+16)) && (z <= 4.5e+44))))) tmp = z * (y + (a * b)); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.2e-62], N[Not[Or[LessEqual[z, 2.7e-9], And[N[Not[LessEqual[z, 1.08e+16]], $MachinePrecision], LessEqual[z, 4.5e+44]]]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-62} \lor \neg \left(z \leq 2.7 \cdot 10^{-9} \lor \neg \left(z \leq 1.08 \cdot 10^{+16}\right) \land z \leq 4.5 \cdot 10^{+44}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -3.20000000000000021e-62 or 2.7000000000000002e-9 < z < 1.08e16 or 4.5e44 < z Initial program 85.8%
associate-+l+85.8%
associate-*l*85.9%
Simplified85.9%
Taylor expanded in z around inf 83.7%
if -3.20000000000000021e-62 < z < 2.7000000000000002e-9 or 1.08e16 < z < 4.5e44Initial program 97.7%
associate-+l+97.7%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in z around 0 80.4%
Final simplification82.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.7e+50)
(* a t)
(if (<= a -1.25e-140)
(* z y)
(if (<= a 1.4e-278)
x
(if (<= a 1.9e+62) (* z y) (if (<= a 1e+117) x (* a t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.7e+50) {
tmp = a * t;
} else if (a <= -1.25e-140) {
tmp = z * y;
} else if (a <= 1.4e-278) {
tmp = x;
} else if (a <= 1.9e+62) {
tmp = z * y;
} else if (a <= 1e+117) {
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.7d+50)) then
tmp = a * t
else if (a <= (-1.25d-140)) then
tmp = z * y
else if (a <= 1.4d-278) then
tmp = x
else if (a <= 1.9d+62) then
tmp = z * y
else if (a <= 1d+117) 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.7e+50) {
tmp = a * t;
} else if (a <= -1.25e-140) {
tmp = z * y;
} else if (a <= 1.4e-278) {
tmp = x;
} else if (a <= 1.9e+62) {
tmp = z * y;
} else if (a <= 1e+117) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.7e+50: tmp = a * t elif a <= -1.25e-140: tmp = z * y elif a <= 1.4e-278: tmp = x elif a <= 1.9e+62: tmp = z * y elif a <= 1e+117: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.7e+50) tmp = Float64(a * t); elseif (a <= -1.25e-140) tmp = Float64(z * y); elseif (a <= 1.4e-278) tmp = x; elseif (a <= 1.9e+62) tmp = Float64(z * y); elseif (a <= 1e+117) 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.7e+50) tmp = a * t; elseif (a <= -1.25e-140) tmp = z * y; elseif (a <= 1.4e-278) tmp = x; elseif (a <= 1.9e+62) tmp = z * y; elseif (a <= 1e+117) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.7e+50], N[(a * t), $MachinePrecision], If[LessEqual[a, -1.25e-140], N[(z * y), $MachinePrecision], If[LessEqual[a, 1.4e-278], x, If[LessEqual[a, 1.9e+62], N[(z * y), $MachinePrecision], If[LessEqual[a, 1e+117], x, N[(a * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+50}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -1.25 \cdot 10^{-140}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-278}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{+62}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 10^{+117}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -2.7e50 or 1.00000000000000005e117 < a Initial program 82.2%
associate-+l+82.2%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in t around inf 58.5%
if -2.7e50 < a < -1.25000000000000004e-140 or 1.40000000000000004e-278 < a < 1.89999999999999992e62Initial program 97.3%
associate-+l+97.3%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in y around inf 42.5%
*-commutative42.5%
Simplified42.5%
if -1.25000000000000004e-140 < a < 1.40000000000000004e-278 or 1.89999999999999992e62 < a < 1.00000000000000005e117Initial program 98.0%
associate-+l+98.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 65.6%
Final simplification52.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8.5e-57) (not (<= a 2.1e-32))) (+ x (* a (+ t (* z b)))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.5e-57) || !(a <= 2.1e-32)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
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 <= (-8.5d-57)) .or. (.not. (a <= 2.1d-32))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + (z * y)
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 <= -8.5e-57) || !(a <= 2.1e-32)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.5e-57) or not (a <= 2.1e-32): tmp = x + (a * (t + (z * b))) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8.5e-57) || !(a <= 2.1e-32)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -8.5e-57) || ~((a <= 2.1e-32))) tmp = x + (a * (t + (z * b))); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8.5e-57], N[Not[LessEqual[a, 2.1e-32]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-57} \lor \neg \left(a \leq 2.1 \cdot 10^{-32}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -8.49999999999999955e-57 or 2.0999999999999999e-32 < a Initial program 87.7%
associate-+l+87.7%
+-commutative87.7%
*-commutative87.7%
associate-*l*92.1%
distribute-lft-out96.0%
fma-def97.3%
+-commutative97.3%
fma-def97.4%
Simplified97.4%
Taylor expanded in y around 0 86.4%
if -8.49999999999999955e-57 < a < 2.0999999999999999e-32Initial program 98.1%
associate-+l+98.1%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in a around 0 82.4%
Final simplification84.8%
(FPCore (x y z t a b) :precision binary64 (if (<= b -8.2e+82) (+ x (* a (+ t (* z b)))) (if (<= b 8.2e+158) (+ (+ x (* a t)) (* z y)) (+ x (* z (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.2e+82) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 8.2e+158) {
tmp = (x + (a * t)) + (z * y);
} else {
tmp = x + (z * (a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-8.2d+82)) then
tmp = x + (a * (t + (z * b)))
else if (b <= 8.2d+158) then
tmp = (x + (a * t)) + (z * y)
else
tmp = x + (z * (a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.2e+82) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 8.2e+158) {
tmp = (x + (a * t)) + (z * y);
} else {
tmp = x + (z * (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -8.2e+82: tmp = x + (a * (t + (z * b))) elif b <= 8.2e+158: tmp = (x + (a * t)) + (z * y) else: tmp = x + (z * (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -8.2e+82) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (b <= 8.2e+158) tmp = Float64(Float64(x + Float64(a * t)) + Float64(z * y)); else tmp = Float64(x + Float64(z * Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -8.2e+82) tmp = x + (a * (t + (z * b))); elseif (b <= 8.2e+158) tmp = (x + (a * t)) + (z * y); else tmp = x + (z * (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.2e+82], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.2e+158], N[(N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{+82}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;b \leq 8.2 \cdot 10^{+158}:\\
\;\;\;\;\left(x + a \cdot t\right) + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -8.1999999999999999e82Initial program 85.1%
associate-+l+85.1%
+-commutative85.1%
*-commutative85.1%
associate-*l*80.9%
distribute-lft-out91.6%
fma-def91.6%
+-commutative91.6%
fma-def91.6%
Simplified91.6%
Taylor expanded in y around 0 89.4%
if -8.1999999999999999e82 < b < 8.20000000000000008e158Initial program 94.0%
associate-+l+94.0%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in b around 0 90.9%
if 8.20000000000000008e158 < b Initial program 89.2%
+-commutative89.2%
+-commutative89.2%
associate-+l+89.2%
associate-+r+89.2%
*-commutative89.2%
associate-*l*89.2%
*-commutative89.2%
distribute-lft-out96.4%
fma-def96.4%
fma-def96.4%
+-commutative96.4%
fma-def96.4%
Simplified96.4%
Taylor expanded in t around 0 92.8%
Taylor expanded in a around inf 74.0%
associate-*r*73.8%
*-commutative73.8%
Simplified87.4%
Final simplification90.2%
(FPCore (x y z t a b) :precision binary64 (if (<= b -6.5e+84) (+ x (* a (+ t (* z b)))) (if (<= b 3e+114) (+ (+ x (* a t)) (* z y)) (+ x (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.5e+84) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 3e+114) {
tmp = (x + (a * t)) + (z * y);
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-6.5d+84)) then
tmp = x + (a * (t + (z * b)))
else if (b <= 3d+114) then
tmp = (x + (a * t)) + (z * y)
else
tmp = x + (z * (y + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.5e+84) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 3e+114) {
tmp = (x + (a * t)) + (z * y);
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -6.5e+84: tmp = x + (a * (t + (z * b))) elif b <= 3e+114: tmp = (x + (a * t)) + (z * y) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -6.5e+84) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (b <= 3e+114) tmp = Float64(Float64(x + Float64(a * t)) + Float64(z * y)); else tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -6.5e+84) tmp = x + (a * (t + (z * b))); elseif (b <= 3e+114) tmp = (x + (a * t)) + (z * y); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -6.5e+84], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e+114], N[(N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{+84}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;b \leq 3 \cdot 10^{+114}:\\
\;\;\;\;\left(x + a \cdot t\right) + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if b < -6.50000000000000027e84Initial program 85.1%
associate-+l+85.1%
+-commutative85.1%
*-commutative85.1%
associate-*l*80.9%
distribute-lft-out91.6%
fma-def91.6%
+-commutative91.6%
fma-def91.6%
Simplified91.6%
Taylor expanded in y around 0 89.4%
if -6.50000000000000027e84 < b < 3e114Initial program 93.8%
associate-+l+93.8%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in b around 0 91.1%
if 3e114 < b Initial program 91.1%
+-commutative91.1%
+-commutative91.1%
associate-+l+91.1%
associate-+r+91.1%
*-commutative91.1%
associate-*l*91.1%
*-commutative91.1%
distribute-lft-out97.0%
fma-def97.0%
fma-def97.0%
+-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in t around 0 94.0%
Final simplification91.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.4e+73) (* z (* a b)) (if (or (<= z -5e-62) (not (<= z 3.5e-37))) (+ x (* z y)) (+ x (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.4e+73) {
tmp = z * (a * b);
} else if ((z <= -5e-62) || !(z <= 3.5e-37)) {
tmp = x + (z * y);
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.4d+73)) then
tmp = z * (a * b)
else if ((z <= (-5d-62)) .or. (.not. (z <= 3.5d-37))) then
tmp = x + (z * y)
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.4e+73) {
tmp = z * (a * b);
} else if ((z <= -5e-62) || !(z <= 3.5e-37)) {
tmp = x + (z * y);
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.4e+73: tmp = z * (a * b) elif (z <= -5e-62) or not (z <= 3.5e-37): tmp = x + (z * y) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.4e+73) tmp = Float64(z * Float64(a * b)); elseif ((z <= -5e-62) || !(z <= 3.5e-37)) tmp = Float64(x + Float64(z * y)); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.4e+73) tmp = z * (a * b); elseif ((z <= -5e-62) || ~((z <= 3.5e-37))) tmp = x + (z * y); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.4e+73], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -5e-62], N[Not[LessEqual[z, 3.5e-37]], $MachinePrecision]], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+73}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-62} \lor \neg \left(z \leq 3.5 \cdot 10^{-37}\right):\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -4.4e73Initial program 81.1%
associate-+l+81.1%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in z around inf 83.6%
Taylor expanded in a around inf 52.7%
associate-*r*56.6%
*-commutative56.6%
Simplified56.6%
if -4.4e73 < z < -5.0000000000000002e-62 or 3.5000000000000001e-37 < z Initial program 90.3%
associate-+l+90.3%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in a around 0 60.4%
if -5.0000000000000002e-62 < z < 3.5000000000000001e-37Initial program 97.4%
associate-+l+97.4%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in z around 0 82.5%
Final simplification69.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.36e-27) (* a t) (if (<= a 1.25e+117) x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.36e-27) {
tmp = a * t;
} else if (a <= 1.25e+117) {
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 <= (-1.36d-27)) then
tmp = a * t
else if (a <= 1.25d+117) 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 <= -1.36e-27) {
tmp = a * t;
} else if (a <= 1.25e+117) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.36e-27: tmp = a * t elif a <= 1.25e+117: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.36e-27) tmp = Float64(a * t); elseif (a <= 1.25e+117) 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 <= -1.36e-27) tmp = a * t; elseif (a <= 1.25e+117) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.36e-27], N[(a * t), $MachinePrecision], If[LessEqual[a, 1.25e+117], x, N[(a * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.36 \cdot 10^{-27}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+117}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -1.36e-27 or 1.24999999999999996e117 < a Initial program 85.3%
associate-+l+85.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in t around inf 51.3%
if -1.36e-27 < a < 1.24999999999999996e117Initial program 97.2%
associate-+l+97.2%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 39.2%
Final simplification44.6%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 91.8%
associate-+l+91.8%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around inf 25.4%
Final simplification25.4%
(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 2023207
(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)))