
(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 13 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 -5e-74) (not (<= a 2e-24))) (fma y z (fma a (fma z b t) x)) (+ (+ (* a t) (+ x (* y z))) (* b (* a z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -5e-74) || !(a <= 2e-24)) {
tmp = fma(y, z, fma(a, fma(z, b, t), x));
} else {
tmp = ((a * t) + (x + (y * z))) + (b * (a * z));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -5e-74) || !(a <= 2e-24)) tmp = fma(y, z, fma(a, fma(z, b, t), x)); else tmp = Float64(Float64(Float64(a * t) + Float64(x + Float64(y * z))) + Float64(b * Float64(a * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -5e-74], N[Not[LessEqual[a, 2e-24]], $MachinePrecision]], N[(y * z + N[(a * N[(z * b + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{-74} \lor \neg \left(a \leq 2 \cdot 10^{-24}\right):\\
\;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot t + \left(x + y \cdot z\right)\right) + b \cdot \left(a \cdot z\right)\\
\end{array}
\end{array}
if a < -4.99999999999999998e-74 or 1.99999999999999985e-24 < a Initial program 87.4%
associate-+l+87.4%
+-commutative87.4%
associate-+l+87.4%
fma-def89.5%
+-commutative89.5%
*-commutative89.5%
associate-*l*96.4%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
if -4.99999999999999998e-74 < a < 1.99999999999999985e-24Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2e-73) (fma y z (fma a (fma z b t) x)) (fma z (fma a b y) (fma t a x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2e-73) {
tmp = fma(y, z, fma(a, fma(z, b, t), x));
} else {
tmp = fma(z, fma(a, b, y), fma(t, a, x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2e-73) tmp = fma(y, z, fma(a, fma(z, b, t), x)); else tmp = fma(z, fma(a, b, y), fma(t, a, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2e-73], N[(y * z + N[(a * N[(z * b + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-73}:\\
\;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\end{array}
\end{array}
if a < -1.99999999999999999e-73Initial program 89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+l+89.7%
fma-def92.3%
+-commutative92.3%
*-commutative92.3%
associate-*l*97.3%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
if -1.99999999999999999e-73 < a Initial program 94.5%
+-commutative94.5%
+-commutative94.5%
associate-+l+94.5%
associate-+r+94.5%
*-commutative94.5%
associate-*l*96.7%
*-commutative96.7%
distribute-lft-out97.2%
fma-def97.8%
fma-def97.8%
+-commutative97.8%
fma-def97.8%
Simplified97.8%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* b (* a z))))
(t_2 (* z (+ y (* a b))))
(t_3 (+ x (* y z))))
(if (<= a -4.2e+176)
(* a t)
(if (<= a -1.16e+63)
t_2
(if (<= a -8.2e-74)
t_1
(if (<= a 7.5e-56)
t_3
(if (<= a 1.35e-15)
t_2
(if (<= a 6.5e+44) t_3 (if (<= a 4.2e+203) (* a t) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (b * (a * z));
double t_2 = z * (y + (a * b));
double t_3 = x + (y * z);
double tmp;
if (a <= -4.2e+176) {
tmp = a * t;
} else if (a <= -1.16e+63) {
tmp = t_2;
} else if (a <= -8.2e-74) {
tmp = t_1;
} else if (a <= 7.5e-56) {
tmp = t_3;
} else if (a <= 1.35e-15) {
tmp = t_2;
} else if (a <= 6.5e+44) {
tmp = t_3;
} else if (a <= 4.2e+203) {
tmp = a * t;
} 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x + (b * (a * z))
t_2 = z * (y + (a * b))
t_3 = x + (y * z)
if (a <= (-4.2d+176)) then
tmp = a * t
else if (a <= (-1.16d+63)) then
tmp = t_2
else if (a <= (-8.2d-74)) then
tmp = t_1
else if (a <= 7.5d-56) then
tmp = t_3
else if (a <= 1.35d-15) then
tmp = t_2
else if (a <= 6.5d+44) then
tmp = t_3
else if (a <= 4.2d+203) then
tmp = a * t
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 = x + (b * (a * z));
double t_2 = z * (y + (a * b));
double t_3 = x + (y * z);
double tmp;
if (a <= -4.2e+176) {
tmp = a * t;
} else if (a <= -1.16e+63) {
tmp = t_2;
} else if (a <= -8.2e-74) {
tmp = t_1;
} else if (a <= 7.5e-56) {
tmp = t_3;
} else if (a <= 1.35e-15) {
tmp = t_2;
} else if (a <= 6.5e+44) {
tmp = t_3;
} else if (a <= 4.2e+203) {
tmp = a * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (b * (a * z)) t_2 = z * (y + (a * b)) t_3 = x + (y * z) tmp = 0 if a <= -4.2e+176: tmp = a * t elif a <= -1.16e+63: tmp = t_2 elif a <= -8.2e-74: tmp = t_1 elif a <= 7.5e-56: tmp = t_3 elif a <= 1.35e-15: tmp = t_2 elif a <= 6.5e+44: tmp = t_3 elif a <= 4.2e+203: tmp = a * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(b * Float64(a * z))) t_2 = Float64(z * Float64(y + Float64(a * b))) t_3 = Float64(x + Float64(y * z)) tmp = 0.0 if (a <= -4.2e+176) tmp = Float64(a * t); elseif (a <= -1.16e+63) tmp = t_2; elseif (a <= -8.2e-74) tmp = t_1; elseif (a <= 7.5e-56) tmp = t_3; elseif (a <= 1.35e-15) tmp = t_2; elseif (a <= 6.5e+44) tmp = t_3; elseif (a <= 4.2e+203) tmp = Float64(a * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (b * (a * z)); t_2 = z * (y + (a * b)); t_3 = x + (y * z); tmp = 0.0; if (a <= -4.2e+176) tmp = a * t; elseif (a <= -1.16e+63) tmp = t_2; elseif (a <= -8.2e-74) tmp = t_1; elseif (a <= 7.5e-56) tmp = t_3; elseif (a <= 1.35e-15) tmp = t_2; elseif (a <= 6.5e+44) tmp = t_3; elseif (a <= 4.2e+203) tmp = a * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.2e+176], N[(a * t), $MachinePrecision], If[LessEqual[a, -1.16e+63], t$95$2, If[LessEqual[a, -8.2e-74], t$95$1, If[LessEqual[a, 7.5e-56], t$95$3, If[LessEqual[a, 1.35e-15], t$95$2, If[LessEqual[a, 6.5e+44], t$95$3, If[LessEqual[a, 4.2e+203], N[(a * t), $MachinePrecision], t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + b \cdot \left(a \cdot z\right)\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
t_3 := x + y \cdot z\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{+176}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -1.16 \cdot 10^{+63}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -8.2 \cdot 10^{-74}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-56}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{+44}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{+203}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -4.1999999999999998e176 or 6.50000000000000018e44 < a < 4.19999999999999967e203Initial program 82.6%
+-commutative82.6%
+-commutative82.6%
associate-+l+82.6%
associate-+r+82.6%
*-commutative82.6%
associate-*l*84.1%
*-commutative84.1%
distribute-lft-out87.3%
fma-def90.5%
fma-def90.5%
+-commutative90.5%
fma-def90.5%
Simplified90.5%
Taylor expanded in t around inf 62.5%
if -4.1999999999999998e176 < a < -1.15999999999999994e63 or 7.50000000000000041e-56 < a < 1.35000000000000005e-15Initial program 85.4%
+-commutative85.4%
+-commutative85.4%
associate-+l+85.4%
associate-+r+85.4%
*-commutative85.4%
associate-*l*92.5%
*-commutative92.5%
distribute-lft-out96.2%
fma-def96.2%
fma-def96.2%
+-commutative96.2%
fma-def96.2%
Simplified96.2%
Taylor expanded in z around inf 74.5%
if -1.15999999999999994e63 < a < -8.20000000000000063e-74 or 4.19999999999999967e203 < a Initial program 95.5%
+-commutative95.5%
+-commutative95.5%
associate-+l+95.5%
associate-+r+95.5%
*-commutative95.5%
associate-*l*91.5%
*-commutative91.5%
distribute-lft-out91.5%
fma-def91.5%
fma-def91.5%
+-commutative91.5%
fma-def91.5%
Simplified91.5%
Taylor expanded in t around 0 75.0%
Taylor expanded in a around inf 64.9%
associate-*r*62.6%
*-commutative62.6%
associate-*l*68.8%
Simplified68.8%
if -8.20000000000000063e-74 < a < 7.50000000000000041e-56 or 1.35000000000000005e-15 < a < 6.50000000000000018e44Initial program 99.2%
+-commutative99.2%
+-commutative99.2%
associate-+l+99.2%
associate-+r+99.2%
*-commutative99.2%
associate-*l*100.0%
*-commutative100.0%
distribute-lft-out100.0%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in a around 0 83.9%
Final simplification75.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))) (t_2 (* z (+ y (* a b)))))
(if (<= a -2.45e+176)
(* a t)
(if (<= a -3.75e+81)
t_2
(if (<= a -2.4e-10)
t_1
(if (<= a -8.8e-74)
t_2
(if (<= a 1.3e-53)
t_1
(if (<= a 6.2e-15) t_2 (if (<= a 2.9e+43) t_1 (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = z * (y + (a * b));
double tmp;
if (a <= -2.45e+176) {
tmp = a * t;
} else if (a <= -3.75e+81) {
tmp = t_2;
} else if (a <= -2.4e-10) {
tmp = t_1;
} else if (a <= -8.8e-74) {
tmp = t_2;
} else if (a <= 1.3e-53) {
tmp = t_1;
} else if (a <= 6.2e-15) {
tmp = t_2;
} else if (a <= 2.9e+43) {
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) :: t_2
real(8) :: tmp
t_1 = x + (y * z)
t_2 = z * (y + (a * b))
if (a <= (-2.45d+176)) then
tmp = a * t
else if (a <= (-3.75d+81)) then
tmp = t_2
else if (a <= (-2.4d-10)) then
tmp = t_1
else if (a <= (-8.8d-74)) then
tmp = t_2
else if (a <= 1.3d-53) then
tmp = t_1
else if (a <= 6.2d-15) then
tmp = t_2
else if (a <= 2.9d+43) 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 = x + (y * z);
double t_2 = z * (y + (a * b));
double tmp;
if (a <= -2.45e+176) {
tmp = a * t;
} else if (a <= -3.75e+81) {
tmp = t_2;
} else if (a <= -2.4e-10) {
tmp = t_1;
} else if (a <= -8.8e-74) {
tmp = t_2;
} else if (a <= 1.3e-53) {
tmp = t_1;
} else if (a <= 6.2e-15) {
tmp = t_2;
} else if (a <= 2.9e+43) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) t_2 = z * (y + (a * b)) tmp = 0 if a <= -2.45e+176: tmp = a * t elif a <= -3.75e+81: tmp = t_2 elif a <= -2.4e-10: tmp = t_1 elif a <= -8.8e-74: tmp = t_2 elif a <= 1.3e-53: tmp = t_1 elif a <= 6.2e-15: tmp = t_2 elif a <= 2.9e+43: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) t_2 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (a <= -2.45e+176) tmp = Float64(a * t); elseif (a <= -3.75e+81) tmp = t_2; elseif (a <= -2.4e-10) tmp = t_1; elseif (a <= -8.8e-74) tmp = t_2; elseif (a <= 1.3e-53) tmp = t_1; elseif (a <= 6.2e-15) tmp = t_2; elseif (a <= 2.9e+43) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); t_2 = z * (y + (a * b)); tmp = 0.0; if (a <= -2.45e+176) tmp = a * t; elseif (a <= -3.75e+81) tmp = t_2; elseif (a <= -2.4e-10) tmp = t_1; elseif (a <= -8.8e-74) tmp = t_2; elseif (a <= 1.3e-53) tmp = t_1; elseif (a <= 6.2e-15) tmp = t_2; elseif (a <= 2.9e+43) tmp = t_1; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.45e+176], N[(a * t), $MachinePrecision], If[LessEqual[a, -3.75e+81], t$95$2, If[LessEqual[a, -2.4e-10], t$95$1, If[LessEqual[a, -8.8e-74], t$95$2, If[LessEqual[a, 1.3e-53], t$95$1, If[LessEqual[a, 6.2e-15], t$95$2, If[LessEqual[a, 2.9e+43], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;a \leq -2.45 \cdot 10^{+176}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -3.75 \cdot 10^{+81}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -8.8 \cdot 10^{-74}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{+43}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -2.45e176 or 2.9000000000000002e43 < a Initial program 83.6%
+-commutative83.6%
+-commutative83.6%
associate-+l+83.6%
associate-+r+83.6%
*-commutative83.6%
associate-*l*83.5%
*-commutative83.5%
distribute-lft-out86.1%
fma-def88.7%
fma-def88.7%
+-commutative88.7%
fma-def88.7%
Simplified88.7%
Taylor expanded in t around inf 58.9%
if -2.45e176 < a < -3.74999999999999986e81 or -2.4e-10 < a < -8.80000000000000041e-74 or 1.29999999999999998e-53 < a < 6.1999999999999998e-15Initial program 88.9%
+-commutative88.9%
+-commutative88.9%
associate-+l+88.9%
associate-+r+88.9%
*-commutative88.9%
associate-*l*94.3%
*-commutative94.3%
distribute-lft-out97.1%
fma-def97.1%
fma-def97.1%
+-commutative97.1%
fma-def97.1%
Simplified97.1%
Taylor expanded in z around inf 75.5%
if -3.74999999999999986e81 < a < -2.4e-10 or -8.80000000000000041e-74 < a < 1.29999999999999998e-53 or 6.1999999999999998e-15 < a < 2.9000000000000002e43Initial program 99.3%
+-commutative99.3%
+-commutative99.3%
associate-+l+99.3%
associate-+r+99.3%
*-commutative99.3%
associate-*l*99.3%
*-commutative99.3%
distribute-lft-out99.3%
fma-def99.3%
fma-def99.3%
+-commutative99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in a around 0 79.6%
Final simplification72.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y z) (* a t)))
(t_2 (+ x (* b (* a z))))
(t_3 (+ x (* y z))))
(if (<= x -1.82e+90)
t_3
(if (<= x -32000000000000.0)
t_1
(if (<= x -2.1e-8)
t_2
(if (<= x -6.8e-220)
(* z (+ y (* a b)))
(if (<= x 6.4e+89) t_1 (if (<= x 1.3e+225) t_3 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * z) + (a * t);
double t_2 = x + (b * (a * z));
double t_3 = x + (y * z);
double tmp;
if (x <= -1.82e+90) {
tmp = t_3;
} else if (x <= -32000000000000.0) {
tmp = t_1;
} else if (x <= -2.1e-8) {
tmp = t_2;
} else if (x <= -6.8e-220) {
tmp = z * (y + (a * b));
} else if (x <= 6.4e+89) {
tmp = t_1;
} else if (x <= 1.3e+225) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (y * z) + (a * t)
t_2 = x + (b * (a * z))
t_3 = x + (y * z)
if (x <= (-1.82d+90)) then
tmp = t_3
else if (x <= (-32000000000000.0d0)) then
tmp = t_1
else if (x <= (-2.1d-8)) then
tmp = t_2
else if (x <= (-6.8d-220)) then
tmp = z * (y + (a * b))
else if (x <= 6.4d+89) then
tmp = t_1
else if (x <= 1.3d+225) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * z) + (a * t);
double t_2 = x + (b * (a * z));
double t_3 = x + (y * z);
double tmp;
if (x <= -1.82e+90) {
tmp = t_3;
} else if (x <= -32000000000000.0) {
tmp = t_1;
} else if (x <= -2.1e-8) {
tmp = t_2;
} else if (x <= -6.8e-220) {
tmp = z * (y + (a * b));
} else if (x <= 6.4e+89) {
tmp = t_1;
} else if (x <= 1.3e+225) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * z) + (a * t) t_2 = x + (b * (a * z)) t_3 = x + (y * z) tmp = 0 if x <= -1.82e+90: tmp = t_3 elif x <= -32000000000000.0: tmp = t_1 elif x <= -2.1e-8: tmp = t_2 elif x <= -6.8e-220: tmp = z * (y + (a * b)) elif x <= 6.4e+89: tmp = t_1 elif x <= 1.3e+225: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * z) + Float64(a * t)) t_2 = Float64(x + Float64(b * Float64(a * z))) t_3 = Float64(x + Float64(y * z)) tmp = 0.0 if (x <= -1.82e+90) tmp = t_3; elseif (x <= -32000000000000.0) tmp = t_1; elseif (x <= -2.1e-8) tmp = t_2; elseif (x <= -6.8e-220) tmp = Float64(z * Float64(y + Float64(a * b))); elseif (x <= 6.4e+89) tmp = t_1; elseif (x <= 1.3e+225) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * z) + (a * t); t_2 = x + (b * (a * z)); t_3 = x + (y * z); tmp = 0.0; if (x <= -1.82e+90) tmp = t_3; elseif (x <= -32000000000000.0) tmp = t_1; elseif (x <= -2.1e-8) tmp = t_2; elseif (x <= -6.8e-220) tmp = z * (y + (a * b)); elseif (x <= 6.4e+89) tmp = t_1; elseif (x <= 1.3e+225) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.82e+90], t$95$3, If[LessEqual[x, -32000000000000.0], t$95$1, If[LessEqual[x, -2.1e-8], t$95$2, If[LessEqual[x, -6.8e-220], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.4e+89], t$95$1, If[LessEqual[x, 1.3e+225], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z + a \cdot t\\
t_2 := x + b \cdot \left(a \cdot z\right)\\
t_3 := x + y \cdot z\\
\mathbf{if}\;x \leq -1.82 \cdot 10^{+90}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -32000000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-8}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-220}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;x \leq 6.4 \cdot 10^{+89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+225}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.81999999999999994e90 or 6.39999999999999974e89 < x < 1.30000000000000002e225Initial program 92.3%
+-commutative92.3%
+-commutative92.3%
associate-+l+92.3%
associate-+r+92.3%
*-commutative92.3%
associate-*l*88.9%
*-commutative88.9%
distribute-lft-out90.5%
fma-def90.5%
fma-def90.5%
+-commutative90.5%
fma-def90.5%
Simplified90.5%
Taylor expanded in a around 0 75.2%
if -1.81999999999999994e90 < x < -3.2e13 or -6.79999999999999987e-220 < x < 6.39999999999999974e89Initial program 93.8%
+-commutative93.8%
+-commutative93.8%
associate-+l+93.8%
associate-+r+93.8%
*-commutative93.8%
associate-*l*95.4%
*-commutative95.4%
distribute-lft-out96.1%
fma-def97.7%
fma-def97.7%
+-commutative97.7%
fma-def97.7%
Simplified97.7%
Taylor expanded in b around 0 87.1%
Taylor expanded in x around 0 78.9%
if -3.2e13 < x < -2.09999999999999994e-8 or 1.30000000000000002e225 < x Initial program 95.5%
+-commutative95.5%
+-commutative95.5%
associate-+l+95.5%
associate-+r+95.5%
*-commutative95.5%
associate-*l*95.5%
*-commutative95.5%
distribute-lft-out95.5%
fma-def95.5%
fma-def95.5%
+-commutative95.5%
fma-def95.5%
Simplified95.5%
Taylor expanded in t around 0 91.6%
Taylor expanded in a around inf 82.7%
associate-*r*87.0%
*-commutative87.0%
associate-*l*87.0%
Simplified87.0%
if -2.09999999999999994e-8 < x < -6.79999999999999987e-220Initial program 90.7%
+-commutative90.7%
+-commutative90.7%
associate-+l+90.7%
associate-+r+90.7%
*-commutative90.7%
associate-*l*95.2%
*-commutative95.2%
distribute-lft-out97.5%
fma-def97.5%
fma-def97.5%
+-commutative97.5%
fma-def97.5%
Simplified97.5%
Taylor expanded in z around inf 70.1%
Final simplification77.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.5e+192) (not (<= z 5.2e+215))) (+ x (* z (+ y (* a b)))) (+ (+ (* a t) (+ x (* y z))) (* b (* a z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.5e+192) || !(z <= 5.2e+215)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = ((a * t) + (x + (y * z))) + (b * (a * 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 ((z <= (-1.5d+192)) .or. (.not. (z <= 5.2d+215))) then
tmp = x + (z * (y + (a * b)))
else
tmp = ((a * t) + (x + (y * z))) + (b * (a * 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 ((z <= -1.5e+192) || !(z <= 5.2e+215)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = ((a * t) + (x + (y * z))) + (b * (a * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.5e+192) or not (z <= 5.2e+215): tmp = x + (z * (y + (a * b))) else: tmp = ((a * t) + (x + (y * z))) + (b * (a * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.5e+192) || !(z <= 5.2e+215)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(Float64(Float64(a * t) + Float64(x + Float64(y * z))) + Float64(b * Float64(a * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.5e+192) || ~((z <= 5.2e+215))) tmp = x + (z * (y + (a * b))); else tmp = ((a * t) + (x + (y * z))) + (b * (a * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.5e+192], N[Not[LessEqual[z, 5.2e+215]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+192} \lor \neg \left(z \leq 5.2 \cdot 10^{+215}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot t + \left(x + y \cdot z\right)\right) + b \cdot \left(a \cdot z\right)\\
\end{array}
\end{array}
if z < -1.5e192 or 5.2000000000000001e215 < z Initial program 69.3%
+-commutative69.3%
+-commutative69.3%
associate-+l+69.3%
associate-+r+69.3%
*-commutative69.3%
associate-*l*84.3%
*-commutative84.3%
distribute-lft-out90.2%
fma-def92.1%
fma-def92.1%
+-commutative92.1%
fma-def92.1%
Simplified92.1%
Taylor expanded in t around 0 96.1%
if -1.5e192 < z < 5.2000000000000001e215Initial program 99.0%
Final simplification98.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z 5e+130) (+ (+ (* a (* z b)) (* a t)) (+ x (* y z))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 5e+130) {
tmp = ((a * (z * b)) + (a * t)) + (x + (y * z));
} 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 <= 5d+130) then
tmp = ((a * (z * b)) + (a * t)) + (x + (y * z))
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 <= 5e+130) {
tmp = ((a * (z * b)) + (a * t)) + (x + (y * z));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 5e+130: tmp = ((a * (z * b)) + (a * t)) + (x + (y * z)) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 5e+130) tmp = Float64(Float64(Float64(a * Float64(z * b)) + Float64(a * t)) + Float64(x + Float64(y * z))); 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 <= 5e+130) tmp = ((a * (z * b)) + (a * t)) + (x + (y * z)); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 5e+130], N[(N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $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 5 \cdot 10^{+130}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + a \cdot t\right) + \left(x + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 4.9999999999999996e130Initial program 95.0%
associate-+l+95.0%
associate-*l*95.8%
Simplified95.8%
if 4.9999999999999996e130 < z Initial program 83.7%
+-commutative83.7%
+-commutative83.7%
associate-+l+83.7%
associate-+r+83.7%
*-commutative83.7%
associate-*l*88.3%
*-commutative88.3%
distribute-lft-out95.3%
fma-def95.3%
fma-def95.3%
+-commutative95.3%
fma-def95.3%
Simplified95.3%
Taylor expanded in t around 0 95.4%
Final simplification95.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= a -3.1e+77)
(* a t)
(if (<= a 7.5e-28)
t_1
(if (<= a 3.6e-16) (* a (* z b)) (if (<= a 1.5e+50) t_1 (* a t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (a <= -3.1e+77) {
tmp = a * t;
} else if (a <= 7.5e-28) {
tmp = t_1;
} else if (a <= 3.6e-16) {
tmp = a * (z * b);
} else if (a <= 1.5e+50) {
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 = x + (y * z)
if (a <= (-3.1d+77)) then
tmp = a * t
else if (a <= 7.5d-28) then
tmp = t_1
else if (a <= 3.6d-16) then
tmp = a * (z * b)
else if (a <= 1.5d+50) 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 = x + (y * z);
double tmp;
if (a <= -3.1e+77) {
tmp = a * t;
} else if (a <= 7.5e-28) {
tmp = t_1;
} else if (a <= 3.6e-16) {
tmp = a * (z * b);
} else if (a <= 1.5e+50) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if a <= -3.1e+77: tmp = a * t elif a <= 7.5e-28: tmp = t_1 elif a <= 3.6e-16: tmp = a * (z * b) elif a <= 1.5e+50: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (a <= -3.1e+77) tmp = Float64(a * t); elseif (a <= 7.5e-28) tmp = t_1; elseif (a <= 3.6e-16) tmp = Float64(a * Float64(z * b)); elseif (a <= 1.5e+50) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (a <= -3.1e+77) tmp = a * t; elseif (a <= 7.5e-28) tmp = t_1; elseif (a <= 3.6e-16) tmp = a * (z * b); elseif (a <= 1.5e+50) tmp = t_1; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.1e+77], N[(a * t), $MachinePrecision], If[LessEqual[a, 7.5e-28], t$95$1, If[LessEqual[a, 3.6e-16], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.5e+50], t$95$1, N[(a * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;a \leq -3.1 \cdot 10^{+77}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{-16}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+50}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -3.09999999999999999e77 or 1.4999999999999999e50 < a Initial program 82.1%
+-commutative82.1%
+-commutative82.1%
associate-+l+82.1%
associate-+r+82.1%
*-commutative82.1%
associate-*l*84.0%
*-commutative84.0%
distribute-lft-out87.3%
fma-def89.4%
fma-def89.4%
+-commutative89.4%
fma-def89.4%
Simplified89.4%
Taylor expanded in t around inf 55.1%
if -3.09999999999999999e77 < a < 7.5000000000000003e-28 or 3.59999999999999983e-16 < a < 1.4999999999999999e50Initial program 99.4%
+-commutative99.4%
+-commutative99.4%
associate-+l+99.4%
associate-+r+99.4%
*-commutative99.4%
associate-*l*99.3%
*-commutative99.3%
distribute-lft-out99.3%
fma-def99.3%
fma-def99.3%
+-commutative99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in a around 0 76.1%
if 7.5000000000000003e-28 < a < 3.59999999999999983e-16Initial program 99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
associate-+r+99.5%
*-commutative99.5%
associate-*l*99.7%
*-commutative99.7%
distribute-lft-out99.7%
fma-def99.7%
fma-def99.7%
+-commutative99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in b around inf 99.7%
*-commutative99.7%
Simplified99.7%
Final simplification69.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -9.2e-124) (not (<= t 6.5e-33))) (+ (* y z) (+ x (* a t))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -9.2e-124) || !(t <= 6.5e-33)) {
tmp = (y * z) + (x + (a * t));
} 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 ((t <= (-9.2d-124)) .or. (.not. (t <= 6.5d-33))) then
tmp = (y * z) + (x + (a * t))
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 ((t <= -9.2e-124) || !(t <= 6.5e-33)) {
tmp = (y * z) + (x + (a * t));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -9.2e-124) or not (t <= 6.5e-33): tmp = (y * z) + (x + (a * t)) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -9.2e-124) || !(t <= 6.5e-33)) tmp = Float64(Float64(y * z) + Float64(x + Float64(a * t))); 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 ((t <= -9.2e-124) || ~((t <= 6.5e-33))) tmp = (y * z) + (x + (a * t)); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -9.2e-124], N[Not[LessEqual[t, 6.5e-33]], $MachinePrecision]], N[(N[(y * z), $MachinePrecision] + N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{-124} \lor \neg \left(t \leq 6.5 \cdot 10^{-33}\right):\\
\;\;\;\;y \cdot z + \left(x + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if t < -9.20000000000000048e-124 or 6.4999999999999993e-33 < t Initial program 93.6%
+-commutative93.6%
+-commutative93.6%
associate-+l+93.6%
associate-+r+93.6%
*-commutative93.6%
associate-*l*93.5%
*-commutative93.5%
distribute-lft-out94.1%
fma-def95.3%
fma-def95.3%
+-commutative95.3%
fma-def95.3%
Simplified95.3%
Taylor expanded in b around 0 88.5%
if -9.20000000000000048e-124 < t < 6.4999999999999993e-33Initial program 92.0%
+-commutative92.0%
+-commutative92.0%
associate-+l+92.0%
associate-+r+92.0%
*-commutative92.0%
associate-*l*94.3%
*-commutative94.3%
distribute-lft-out96.6%
fma-def96.6%
fma-def96.6%
+-commutative96.6%
fma-def96.6%
Simplified96.6%
Taylor expanded in t around 0 94.4%
Final simplification90.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.38e+45)
(* y z)
(if (<= y -6.2e-298)
(* a t)
(if (<= y 2.75e-92) x (if (<= y 1.85e+83) (* a t) (* y z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.38e+45) {
tmp = y * z;
} else if (y <= -6.2e-298) {
tmp = a * t;
} else if (y <= 2.75e-92) {
tmp = x;
} else if (y <= 1.85e+83) {
tmp = a * t;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.38d+45)) then
tmp = y * z
else if (y <= (-6.2d-298)) then
tmp = a * t
else if (y <= 2.75d-92) then
tmp = x
else if (y <= 1.85d+83) then
tmp = a * t
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.38e+45) {
tmp = y * z;
} else if (y <= -6.2e-298) {
tmp = a * t;
} else if (y <= 2.75e-92) {
tmp = x;
} else if (y <= 1.85e+83) {
tmp = a * t;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.38e+45: tmp = y * z elif y <= -6.2e-298: tmp = a * t elif y <= 2.75e-92: tmp = x elif y <= 1.85e+83: tmp = a * t else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.38e+45) tmp = Float64(y * z); elseif (y <= -6.2e-298) tmp = Float64(a * t); elseif (y <= 2.75e-92) tmp = x; elseif (y <= 1.85e+83) tmp = Float64(a * t); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.38e+45) tmp = y * z; elseif (y <= -6.2e-298) tmp = a * t; elseif (y <= 2.75e-92) tmp = x; elseif (y <= 1.85e+83) tmp = a * t; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.38e+45], N[(y * z), $MachinePrecision], If[LessEqual[y, -6.2e-298], N[(a * t), $MachinePrecision], If[LessEqual[y, 2.75e-92], x, If[LessEqual[y, 1.85e+83], N[(a * t), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.38 \cdot 10^{+45}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{-298}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{-92}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+83}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -1.3799999999999999e45 or 1.8500000000000001e83 < y Initial program 93.5%
+-commutative93.5%
+-commutative93.5%
associate-+l+93.5%
associate-+r+93.5%
*-commutative93.5%
associate-*l*93.6%
*-commutative93.6%
distribute-lft-out96.4%
fma-def97.3%
fma-def97.3%
+-commutative97.3%
fma-def97.3%
Simplified97.3%
Taylor expanded in y around inf 62.3%
*-commutative62.3%
Simplified62.3%
if -1.3799999999999999e45 < y < -6.2000000000000003e-298 or 2.7500000000000001e-92 < y < 1.8500000000000001e83Initial program 93.2%
+-commutative93.2%
+-commutative93.2%
associate-+l+93.2%
associate-+r+93.2%
*-commutative93.2%
associate-*l*92.1%
*-commutative92.1%
distribute-lft-out92.1%
fma-def93.1%
fma-def93.1%
+-commutative93.1%
fma-def93.1%
Simplified93.1%
Taylor expanded in t around inf 41.9%
if -6.2000000000000003e-298 < y < 2.7500000000000001e-92Initial program 91.8%
+-commutative91.8%
+-commutative91.8%
associate-+l+91.8%
associate-+r+91.8%
*-commutative91.8%
associate-*l*97.8%
*-commutative97.8%
distribute-lft-out97.8%
fma-def97.8%
fma-def97.8%
+-commutative97.8%
fma-def97.8%
Simplified97.8%
Taylor expanded in x around inf 50.7%
Final simplification52.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z 3.6e+122) (+ (* y z) (+ x (* a t))) (* z (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 3.6e+122) {
tmp = (y * z) + (x + (a * t));
} else {
tmp = 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 <= 3.6d+122) then
tmp = (y * z) + (x + (a * t))
else
tmp = 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 <= 3.6e+122) {
tmp = (y * z) + (x + (a * t));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 3.6e+122: tmp = (y * z) + (x + (a * t)) else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 3.6e+122) tmp = Float64(Float64(y * z) + Float64(x + Float64(a * t))); else tmp = 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 <= 3.6e+122) tmp = (y * z) + (x + (a * t)); else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 3.6e+122], N[(N[(y * z), $MachinePrecision] + N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.6 \cdot 10^{+122}:\\
\;\;\;\;y \cdot z + \left(x + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 3.6000000000000003e122Initial program 95.3%
+-commutative95.3%
+-commutative95.3%
associate-+l+95.3%
associate-+r+95.3%
*-commutative95.3%
associate-*l*95.2%
*-commutative95.2%
distribute-lft-out95.2%
fma-def95.7%
fma-def95.7%
+-commutative95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in b around 0 85.1%
if 3.6000000000000003e122 < z Initial program 83.7%
+-commutative83.7%
+-commutative83.7%
associate-+l+83.7%
associate-+r+83.7%
*-commutative83.7%
associate-*l*87.7%
*-commutative87.7%
distribute-lft-out93.9%
fma-def95.9%
fma-def95.9%
+-commutative95.9%
fma-def95.9%
Simplified95.9%
Taylor expanded in z around inf 86.1%
Final simplification85.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.5e+62) (* a t) (if (<= t 3.1e-10) x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.5e+62) {
tmp = a * t;
} else if (t <= 3.1e-10) {
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 (t <= (-1.5d+62)) then
tmp = a * t
else if (t <= 3.1d-10) 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 (t <= -1.5e+62) {
tmp = a * t;
} else if (t <= 3.1e-10) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.5e+62: tmp = a * t elif t <= 3.1e-10: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.5e+62) tmp = Float64(a * t); elseif (t <= 3.1e-10) 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 (t <= -1.5e+62) tmp = a * t; elseif (t <= 3.1e-10) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.5e+62], N[(a * t), $MachinePrecision], If[LessEqual[t, 3.1e-10], x, N[(a * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+62}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -1.5e62 or 3.10000000000000015e-10 < t Initial program 92.3%
+-commutative92.3%
+-commutative92.3%
associate-+l+92.3%
associate-+r+92.3%
*-commutative92.3%
associate-*l*92.1%
*-commutative92.1%
distribute-lft-out92.9%
fma-def94.5%
fma-def94.5%
+-commutative94.5%
fma-def94.5%
Simplified94.5%
Taylor expanded in t around inf 48.9%
if -1.5e62 < t < 3.10000000000000015e-10Initial program 93.8%
+-commutative93.8%
+-commutative93.8%
associate-+l+93.8%
associate-+r+93.8%
*-commutative93.8%
associate-*l*95.4%
*-commutative95.4%
distribute-lft-out97.0%
fma-def97.0%
fma-def97.0%
+-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in x around inf 33.6%
Final simplification41.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.1%
+-commutative93.1%
+-commutative93.1%
associate-+l+93.1%
associate-+r+93.1%
*-commutative93.1%
associate-*l*93.8%
*-commutative93.8%
distribute-lft-out95.0%
fma-def95.7%
fma-def95.7%
+-commutative95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in x around inf 24.0%
Final simplification24.0%
(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 2023213
(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)))