
(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 (<= a 4.8e+37) (fma z (* a b) (fma t a (fma y z x))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 4.8e+37) {
tmp = fma(z, (a * b), fma(t, a, fma(y, z, x)));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 4.8e+37) tmp = fma(z, Float64(a * b), fma(t, a, fma(y, z, x))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 4.8e+37], N[(z * N[(a * b), $MachinePrecision] + N[(t * a + N[(y * z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.8 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if a < 4.8e37Initial program 93.6%
+-commutative93.6%
*-commutative93.6%
associate-*l*95.9%
*-commutative95.9%
fma-define96.9%
*-commutative96.9%
+-commutative96.9%
fma-define97.4%
+-commutative97.4%
fma-define97.4%
Simplified97.4%
if 4.8e37 < a Initial program 83.5%
Taylor expanded in z around 0 85.3%
Taylor expanded in a around inf 96.8%
+-commutative96.8%
Simplified96.8%
Final simplification97.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -1.65e+131)
t_1
(if (<= a -5.5e+73)
(* z y)
(if (<= a -6e-7)
t_1
(if (<= a -2e-71)
(* z y)
(if (<= a -1.45e-157)
x
(if (<= a 5e-171)
(* z y)
(if (<= a 8.2e+96) x (if (<= a 1.6e+215) 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 <= -1.65e+131) {
tmp = t_1;
} else if (a <= -5.5e+73) {
tmp = z * y;
} else if (a <= -6e-7) {
tmp = t_1;
} else if (a <= -2e-71) {
tmp = z * y;
} else if (a <= -1.45e-157) {
tmp = x;
} else if (a <= 5e-171) {
tmp = z * y;
} else if (a <= 8.2e+96) {
tmp = x;
} else if (a <= 1.6e+215) {
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 <= (-1.65d+131)) then
tmp = t_1
else if (a <= (-5.5d+73)) then
tmp = z * y
else if (a <= (-6d-7)) then
tmp = t_1
else if (a <= (-2d-71)) then
tmp = z * y
else if (a <= (-1.45d-157)) then
tmp = x
else if (a <= 5d-171) then
tmp = z * y
else if (a <= 8.2d+96) then
tmp = x
else if (a <= 1.6d+215) 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 <= -1.65e+131) {
tmp = t_1;
} else if (a <= -5.5e+73) {
tmp = z * y;
} else if (a <= -6e-7) {
tmp = t_1;
} else if (a <= -2e-71) {
tmp = z * y;
} else if (a <= -1.45e-157) {
tmp = x;
} else if (a <= 5e-171) {
tmp = z * y;
} else if (a <= 8.2e+96) {
tmp = x;
} else if (a <= 1.6e+215) {
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 <= -1.65e+131: tmp = t_1 elif a <= -5.5e+73: tmp = z * y elif a <= -6e-7: tmp = t_1 elif a <= -2e-71: tmp = z * y elif a <= -1.45e-157: tmp = x elif a <= 5e-171: tmp = z * y elif a <= 8.2e+96: tmp = x elif a <= 1.6e+215: 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 <= -1.65e+131) tmp = t_1; elseif (a <= -5.5e+73) tmp = Float64(z * y); elseif (a <= -6e-7) tmp = t_1; elseif (a <= -2e-71) tmp = Float64(z * y); elseif (a <= -1.45e-157) tmp = x; elseif (a <= 5e-171) tmp = Float64(z * y); elseif (a <= 8.2e+96) tmp = x; elseif (a <= 1.6e+215) 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 <= -1.65e+131) tmp = t_1; elseif (a <= -5.5e+73) tmp = z * y; elseif (a <= -6e-7) tmp = t_1; elseif (a <= -2e-71) tmp = z * y; elseif (a <= -1.45e-157) tmp = x; elseif (a <= 5e-171) tmp = z * y; elseif (a <= 8.2e+96) tmp = x; elseif (a <= 1.6e+215) 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, -1.65e+131], t$95$1, If[LessEqual[a, -5.5e+73], N[(z * y), $MachinePrecision], If[LessEqual[a, -6e-7], t$95$1, If[LessEqual[a, -2e-71], N[(z * y), $MachinePrecision], If[LessEqual[a, -1.45e-157], x, If[LessEqual[a, 5e-171], N[(z * y), $MachinePrecision], If[LessEqual[a, 8.2e+96], x, If[LessEqual[a, 1.6e+215], 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 -1.65 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -5.5 \cdot 10^{+73}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2 \cdot 10^{-71}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq -1.45 \cdot 10^{-157}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-171}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+96}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+215}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -1.6499999999999999e131 or -5.5000000000000003e73 < a < -5.9999999999999997e-7 or 8.19999999999999996e96 < a < 1.5999999999999999e215Initial program 84.5%
Taylor expanded in b around inf 57.3%
if -1.6499999999999999e131 < a < -5.5000000000000003e73 or -5.9999999999999997e-7 < a < -1.9999999999999998e-71 or -1.44999999999999994e-157 < a < 4.99999999999999992e-171Initial program 95.6%
Taylor expanded in y around inf 53.9%
*-commutative53.9%
Simplified53.9%
if -1.9999999999999998e-71 < a < -1.44999999999999994e-157 or 4.99999999999999992e-171 < a < 8.19999999999999996e96Initial program 99.9%
Taylor expanded in x around inf 58.9%
if 1.5999999999999999e215 < a Initial program 77.3%
Taylor expanded in t around inf 69.5%
Final simplification57.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -5.2e-9)
(* z (* a b))
(if (<= a -1.25e-71)
(* z y)
(if (<= a -1.55e-157)
x
(if (<= a 1.95e-171)
(* z y)
(if (<= a 8.4e+96) x (if (<= a 5.8e+214) (* a (* z b)) (* a t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.2e-9) {
tmp = z * (a * b);
} else if (a <= -1.25e-71) {
tmp = z * y;
} else if (a <= -1.55e-157) {
tmp = x;
} else if (a <= 1.95e-171) {
tmp = z * y;
} else if (a <= 8.4e+96) {
tmp = x;
} else if (a <= 5.8e+214) {
tmp = a * (z * b);
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-5.2d-9)) then
tmp = z * (a * b)
else if (a <= (-1.25d-71)) then
tmp = z * y
else if (a <= (-1.55d-157)) then
tmp = x
else if (a <= 1.95d-171) then
tmp = z * y
else if (a <= 8.4d+96) then
tmp = x
else if (a <= 5.8d+214) then
tmp = a * (z * b)
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.2e-9) {
tmp = z * (a * b);
} else if (a <= -1.25e-71) {
tmp = z * y;
} else if (a <= -1.55e-157) {
tmp = x;
} else if (a <= 1.95e-171) {
tmp = z * y;
} else if (a <= 8.4e+96) {
tmp = x;
} else if (a <= 5.8e+214) {
tmp = a * (z * b);
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.2e-9: tmp = z * (a * b) elif a <= -1.25e-71: tmp = z * y elif a <= -1.55e-157: tmp = x elif a <= 1.95e-171: tmp = z * y elif a <= 8.4e+96: tmp = x elif a <= 5.8e+214: tmp = a * (z * b) else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.2e-9) tmp = Float64(z * Float64(a * b)); elseif (a <= -1.25e-71) tmp = Float64(z * y); elseif (a <= -1.55e-157) tmp = x; elseif (a <= 1.95e-171) tmp = Float64(z * y); elseif (a <= 8.4e+96) tmp = x; elseif (a <= 5.8e+214) tmp = Float64(a * Float64(z * b)); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -5.2e-9) tmp = z * (a * b); elseif (a <= -1.25e-71) tmp = z * y; elseif (a <= -1.55e-157) tmp = x; elseif (a <= 1.95e-171) tmp = z * y; elseif (a <= 8.4e+96) tmp = x; elseif (a <= 5.8e+214) tmp = a * (z * b); else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.2e-9], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.25e-71], N[(z * y), $MachinePrecision], If[LessEqual[a, -1.55e-157], x, If[LessEqual[a, 1.95e-171], N[(z * y), $MachinePrecision], If[LessEqual[a, 8.4e+96], x, If[LessEqual[a, 5.8e+214], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-9}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq -1.25 \cdot 10^{-71}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq -1.55 \cdot 10^{-157}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{-171}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 8.4 \cdot 10^{+96}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{+214}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -5.2000000000000002e-9Initial program 84.9%
Taylor expanded in a around inf 70.2%
Taylor expanded in t around 0 48.1%
associate-*r*50.5%
*-commutative50.5%
Simplified50.5%
if -5.2000000000000002e-9 < a < -1.24999999999999999e-71 or -1.5499999999999999e-157 < a < 1.9499999999999999e-171Initial program 99.0%
Taylor expanded in y around inf 55.3%
*-commutative55.3%
Simplified55.3%
if -1.24999999999999999e-71 < a < -1.5499999999999999e-157 or 1.9499999999999999e-171 < a < 8.4000000000000005e96Initial program 99.9%
Taylor expanded in x around inf 58.9%
if 8.4000000000000005e96 < a < 5.7999999999999999e214Initial program 81.9%
Taylor expanded in b around inf 60.8%
if 5.7999999999999999e214 < a Initial program 77.3%
Taylor expanded in t around inf 69.5%
Final simplification56.5%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -1.55e+140)
(not
(or (<= a -5.2e+88) (and (not (<= a -1.05e-5)) (<= a 1.15e-14)))))
(+ x (* a (+ t (* z b))))
(+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.55e+140) || !((a <= -5.2e+88) || (!(a <= -1.05e-5) && (a <= 1.15e-14)))) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((a * t) + (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 <= (-1.55d+140)) .or. (.not. (a <= (-5.2d+88)) .or. (.not. (a <= (-1.05d-5))) .and. (a <= 1.15d-14))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((a * t) + (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 <= -1.55e+140) || !((a <= -5.2e+88) || (!(a <= -1.05e-5) && (a <= 1.15e-14)))) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.55e+140) or not ((a <= -5.2e+88) or (not (a <= -1.05e-5) and (a <= 1.15e-14))): tmp = x + (a * (t + (z * b))) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.55e+140) || !((a <= -5.2e+88) || (!(a <= -1.05e-5) && (a <= 1.15e-14)))) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.55e+140) || ~(((a <= -5.2e+88) || (~((a <= -1.05e-5)) && (a <= 1.15e-14))))) tmp = x + (a * (t + (z * b))); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.55e+140], N[Not[Or[LessEqual[a, -5.2e+88], And[N[Not[LessEqual[a, -1.05e-5]], $MachinePrecision], LessEqual[a, 1.15e-14]]]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+140} \lor \neg \left(a \leq -5.2 \cdot 10^{+88} \lor \neg \left(a \leq -1.05 \cdot 10^{-5}\right) \land a \leq 1.15 \cdot 10^{-14}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if a < -1.55e140 or -5.2000000000000001e88 < a < -1.04999999999999994e-5 or 1.14999999999999999e-14 < a Initial program 86.0%
Taylor expanded in z around 0 89.0%
Taylor expanded in a around inf 90.6%
+-commutative90.6%
Simplified90.6%
if -1.55e140 < a < -5.2000000000000001e88 or -1.04999999999999994e-5 < a < 1.14999999999999999e-14Initial program 96.9%
Taylor expanded in b around 0 94.1%
Final simplification92.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ (* a t) (* z y)))) (t_2 (+ x (* a (+ t (* z b))))))
(if (<= a -1.55e+140)
t_2
(if (<= a -1.35e+86)
t_1
(if (<= a -1.08e-23)
(+ (* a t) (* z (+ (* a b) y)))
(if (<= a 2.4e-14) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((a * t) + (z * y));
double t_2 = x + (a * (t + (z * b)));
double tmp;
if (a <= -1.55e+140) {
tmp = t_2;
} else if (a <= -1.35e+86) {
tmp = t_1;
} else if (a <= -1.08e-23) {
tmp = (a * t) + (z * ((a * b) + y));
} else if (a <= 2.4e-14) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + ((a * t) + (z * y))
t_2 = x + (a * (t + (z * b)))
if (a <= (-1.55d+140)) then
tmp = t_2
else if (a <= (-1.35d+86)) then
tmp = t_1
else if (a <= (-1.08d-23)) then
tmp = (a * t) + (z * ((a * b) + y))
else if (a <= 2.4d-14) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((a * t) + (z * y));
double t_2 = x + (a * (t + (z * b)));
double tmp;
if (a <= -1.55e+140) {
tmp = t_2;
} else if (a <= -1.35e+86) {
tmp = t_1;
} else if (a <= -1.08e-23) {
tmp = (a * t) + (z * ((a * b) + y));
} else if (a <= 2.4e-14) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((a * t) + (z * y)) t_2 = x + (a * (t + (z * b))) tmp = 0 if a <= -1.55e+140: tmp = t_2 elif a <= -1.35e+86: tmp = t_1 elif a <= -1.08e-23: tmp = (a * t) + (z * ((a * b) + y)) elif a <= 2.4e-14: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(a * t) + Float64(z * y))) t_2 = Float64(x + Float64(a * Float64(t + Float64(z * b)))) tmp = 0.0 if (a <= -1.55e+140) tmp = t_2; elseif (a <= -1.35e+86) tmp = t_1; elseif (a <= -1.08e-23) tmp = Float64(Float64(a * t) + Float64(z * Float64(Float64(a * b) + y))); elseif (a <= 2.4e-14) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((a * t) + (z * y)); t_2 = x + (a * (t + (z * b))); tmp = 0.0; if (a <= -1.55e+140) tmp = t_2; elseif (a <= -1.35e+86) tmp = t_1; elseif (a <= -1.08e-23) tmp = (a * t) + (z * ((a * b) + y)); elseif (a <= 2.4e-14) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.55e+140], t$95$2, If[LessEqual[a, -1.35e+86], t$95$1, If[LessEqual[a, -1.08e-23], N[(N[(a * t), $MachinePrecision] + N[(z * N[(N[(a * b), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.4e-14], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(a \cdot t + z \cdot y\right)\\
t_2 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.55 \cdot 10^{+140}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1.35 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.08 \cdot 10^{-23}:\\
\;\;\;\;a \cdot t + z \cdot \left(a \cdot b + y\right)\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -1.55e140 or 2.4e-14 < a Initial program 83.5%
Taylor expanded in z around 0 87.1%
Taylor expanded in a around inf 92.3%
+-commutative92.3%
Simplified92.3%
if -1.55e140 < a < -1.35000000000000009e86 or -1.08000000000000003e-23 < a < 2.4e-14Initial program 96.9%
Taylor expanded in b around 0 94.7%
if -1.35000000000000009e86 < a < -1.08000000000000003e-23Initial program 99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 86.1%
Final simplification92.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ (* a t) (* z y)))) (t_2 (+ x (* a (+ t (* z b))))))
(if (<= a -1.56e+140)
t_2
(if (<= a -4.1e+86)
t_1
(if (<= a -1.6e-8)
(+ x (+ (* a t) (* a (* z b))))
(if (<= a 3.3e-15) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((a * t) + (z * y));
double t_2 = x + (a * (t + (z * b)));
double tmp;
if (a <= -1.56e+140) {
tmp = t_2;
} else if (a <= -4.1e+86) {
tmp = t_1;
} else if (a <= -1.6e-8) {
tmp = x + ((a * t) + (a * (z * b)));
} else if (a <= 3.3e-15) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + ((a * t) + (z * y))
t_2 = x + (a * (t + (z * b)))
if (a <= (-1.56d+140)) then
tmp = t_2
else if (a <= (-4.1d+86)) then
tmp = t_1
else if (a <= (-1.6d-8)) then
tmp = x + ((a * t) + (a * (z * b)))
else if (a <= 3.3d-15) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((a * t) + (z * y));
double t_2 = x + (a * (t + (z * b)));
double tmp;
if (a <= -1.56e+140) {
tmp = t_2;
} else if (a <= -4.1e+86) {
tmp = t_1;
} else if (a <= -1.6e-8) {
tmp = x + ((a * t) + (a * (z * b)));
} else if (a <= 3.3e-15) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((a * t) + (z * y)) t_2 = x + (a * (t + (z * b))) tmp = 0 if a <= -1.56e+140: tmp = t_2 elif a <= -4.1e+86: tmp = t_1 elif a <= -1.6e-8: tmp = x + ((a * t) + (a * (z * b))) elif a <= 3.3e-15: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(a * t) + Float64(z * y))) t_2 = Float64(x + Float64(a * Float64(t + Float64(z * b)))) tmp = 0.0 if (a <= -1.56e+140) tmp = t_2; elseif (a <= -4.1e+86) tmp = t_1; elseif (a <= -1.6e-8) tmp = Float64(x + Float64(Float64(a * t) + Float64(a * Float64(z * b)))); elseif (a <= 3.3e-15) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((a * t) + (z * y)); t_2 = x + (a * (t + (z * b))); tmp = 0.0; if (a <= -1.56e+140) tmp = t_2; elseif (a <= -4.1e+86) tmp = t_1; elseif (a <= -1.6e-8) tmp = x + ((a * t) + (a * (z * b))); elseif (a <= 3.3e-15) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.56e+140], t$95$2, If[LessEqual[a, -4.1e+86], t$95$1, If[LessEqual[a, -1.6e-8], N[(x + N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e-15], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(a \cdot t + z \cdot y\right)\\
t_2 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.56 \cdot 10^{+140}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -4.1 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.6 \cdot 10^{-8}:\\
\;\;\;\;x + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -1.56000000000000002e140 or 3.3e-15 < a Initial program 83.5%
Taylor expanded in z around 0 87.1%
Taylor expanded in a around inf 92.3%
+-commutative92.3%
Simplified92.3%
if -1.56000000000000002e140 < a < -4.0999999999999999e86 or -1.6000000000000001e-8 < a < 3.3e-15Initial program 96.9%
Taylor expanded in b around 0 94.1%
if -4.0999999999999999e86 < a < -1.6000000000000001e-8Initial program 100.0%
Taylor expanded in y around 0 80.5%
Final simplification92.3%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -1.65e+131)
(not
(or (<= a -7.6e+88) (and (not (<= a -1.12e-23)) (<= a 8.4e+96)))))
(* 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 <= -1.65e+131) || !((a <= -7.6e+88) || (!(a <= -1.12e-23) && (a <= 8.4e+96)))) {
tmp = 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 <= (-1.65d+131)) .or. (.not. (a <= (-7.6d+88)) .or. (.not. (a <= (-1.12d-23))) .and. (a <= 8.4d+96))) then
tmp = 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 <= -1.65e+131) || !((a <= -7.6e+88) || (!(a <= -1.12e-23) && (a <= 8.4e+96)))) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.65e+131) or not ((a <= -7.6e+88) or (not (a <= -1.12e-23) and (a <= 8.4e+96))): tmp = a * (t + (z * b)) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.65e+131) || !((a <= -7.6e+88) || (!(a <= -1.12e-23) && (a <= 8.4e+96)))) tmp = 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 <= -1.65e+131) || ~(((a <= -7.6e+88) || (~((a <= -1.12e-23)) && (a <= 8.4e+96))))) tmp = 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, -1.65e+131], N[Not[Or[LessEqual[a, -7.6e+88], And[N[Not[LessEqual[a, -1.12e-23]], $MachinePrecision], LessEqual[a, 8.4e+96]]]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.65 \cdot 10^{+131} \lor \neg \left(a \leq -7.6 \cdot 10^{+88} \lor \neg \left(a \leq -1.12 \cdot 10^{-23}\right) \land a \leq 8.4 \cdot 10^{+96}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.6499999999999999e131 or -7.5999999999999993e88 < a < -1.1200000000000001e-23 or 8.4000000000000005e96 < a Initial program 84.2%
Taylor expanded in a around inf 82.2%
if -1.6499999999999999e131 < a < -7.5999999999999993e88 or -1.1200000000000001e-23 < a < 8.4000000000000005e96Initial program 97.3%
Taylor expanded in a around 0 81.6%
Final simplification81.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -1.75e+131)
t_1
(if (<= a -6.1e-24)
(* z (+ (* a b) y))
(if (<= a 2.05e+97) (+ x (* z y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -1.75e+131) {
tmp = t_1;
} else if (a <= -6.1e-24) {
tmp = z * ((a * b) + y);
} else if (a <= 2.05e+97) {
tmp = x + (z * y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if (a <= (-1.75d+131)) then
tmp = t_1
else if (a <= (-6.1d-24)) then
tmp = z * ((a * b) + y)
else if (a <= 2.05d+97) then
tmp = x + (z * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -1.75e+131) {
tmp = t_1;
} else if (a <= -6.1e-24) {
tmp = z * ((a * b) + y);
} else if (a <= 2.05e+97) {
tmp = x + (z * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -1.75e+131: tmp = t_1 elif a <= -6.1e-24: tmp = z * ((a * b) + y) elif a <= 2.05e+97: tmp = x + (z * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -1.75e+131) tmp = t_1; elseif (a <= -6.1e-24) tmp = Float64(z * Float64(Float64(a * b) + y)); elseif (a <= 2.05e+97) tmp = Float64(x + Float64(z * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -1.75e+131) tmp = t_1; elseif (a <= -6.1e-24) tmp = z * ((a * b) + y); elseif (a <= 2.05e+97) tmp = x + (z * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.75e+131], t$95$1, If[LessEqual[a, -6.1e-24], N[(z * N[(N[(a * b), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.05e+97], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.75 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6.1 \cdot 10^{-24}:\\
\;\;\;\;z \cdot \left(a \cdot b + y\right)\\
\mathbf{elif}\;a \leq 2.05 \cdot 10^{+97}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.7499999999999999e131 or 2.04999999999999994e97 < a Initial program 80.5%
Taylor expanded in a around inf 86.4%
if -1.7499999999999999e131 < a < -6.10000000000000036e-24Initial program 91.3%
Taylor expanded in z around inf 65.7%
if -6.10000000000000036e-24 < a < 2.04999999999999994e97Initial program 99.4%
Taylor expanded in a around 0 82.5%
Final simplification81.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.75e+131)
(* z (* a b))
(if (<= a 3e+98)
(+ x (* z y))
(if (<= a 1.92e+214) (* a (* z b)) (+ x (* a t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.75e+131) {
tmp = z * (a * b);
} else if (a <= 3e+98) {
tmp = x + (z * y);
} else if (a <= 1.92e+214) {
tmp = a * (z * 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 (a <= (-1.75d+131)) then
tmp = z * (a * b)
else if (a <= 3d+98) then
tmp = x + (z * y)
else if (a <= 1.92d+214) then
tmp = a * (z * 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 (a <= -1.75e+131) {
tmp = z * (a * b);
} else if (a <= 3e+98) {
tmp = x + (z * y);
} else if (a <= 1.92e+214) {
tmp = a * (z * b);
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.75e+131: tmp = z * (a * b) elif a <= 3e+98: tmp = x + (z * y) elif a <= 1.92e+214: tmp = a * (z * b) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.75e+131) tmp = Float64(z * Float64(a * b)); elseif (a <= 3e+98) tmp = Float64(x + Float64(z * y)); elseif (a <= 1.92e+214) tmp = Float64(a * Float64(z * 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 (a <= -1.75e+131) tmp = z * (a * b); elseif (a <= 3e+98) tmp = x + (z * y); elseif (a <= 1.92e+214) tmp = a * (z * b); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.75e+131], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3e+98], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.92e+214], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.75 \cdot 10^{+131}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 3 \cdot 10^{+98}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 1.92 \cdot 10^{+214}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if a < -1.7499999999999999e131Initial program 81.1%
Taylor expanded in a around inf 84.5%
Taylor expanded in t around 0 58.5%
associate-*r*60.5%
*-commutative60.5%
Simplified60.5%
if -1.7499999999999999e131 < a < 3.0000000000000001e98Initial program 97.7%
Taylor expanded in a around 0 75.3%
if 3.0000000000000001e98 < a < 1.92e214Initial program 81.9%
Taylor expanded in b around inf 60.8%
if 1.92e214 < a Initial program 77.3%
Taylor expanded in z around 0 78.1%
Final simplification71.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -9.5e-24) (not (<= a 1.15e-15))) (+ 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 <= -9.5e-24) || !(a <= 1.15e-15)) {
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 <= (-9.5d-24)) .or. (.not. (a <= 1.15d-15))) 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 <= -9.5e-24) || !(a <= 1.15e-15)) {
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 <= -9.5e-24) or not (a <= 1.15e-15): 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 <= -9.5e-24) || !(a <= 1.15e-15)) 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 <= -9.5e-24) || ~((a <= 1.15e-15))) 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, -9.5e-24], N[Not[LessEqual[a, 1.15e-15]], $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 -9.5 \cdot 10^{-24} \lor \neg \left(a \leq 1.15 \cdot 10^{-15}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -9.50000000000000029e-24 or 1.14999999999999995e-15 < a Initial program 85.6%
Taylor expanded in z around 0 90.2%
Taylor expanded in a around inf 87.1%
+-commutative87.1%
Simplified87.1%
if -9.50000000000000029e-24 < a < 1.14999999999999995e-15Initial program 99.3%
Taylor expanded in a around 0 85.6%
Final simplification86.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a 4.8e+37) (+ x (+ (* a t) (* z (+ (* a b) y)))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 4.8e+37) {
tmp = x + ((a * t) + (z * ((a * b) + y)));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= 4.8d+37) then
tmp = x + ((a * t) + (z * ((a * b) + y)))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 4.8e+37) {
tmp = x + ((a * t) + (z * ((a * b) + y)));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= 4.8e+37: tmp = x + ((a * t) + (z * ((a * b) + y))) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 4.8e+37) tmp = Float64(x + Float64(Float64(a * t) + Float64(z * Float64(Float64(a * b) + y)))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= 4.8e+37) tmp = x + ((a * t) + (z * ((a * b) + y))); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 4.8e+37], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(N[(a * b), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.8 \cdot 10^{+37}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot \left(a \cdot b + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if a < 4.8e37Initial program 93.6%
Taylor expanded in z around 0 96.9%
if 4.8e37 < a Initial program 83.5%
Taylor expanded in z around 0 85.3%
Taylor expanded in a around inf 96.8%
+-commutative96.8%
Simplified96.8%
Final simplification96.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.1e+103) (* a (* z b)) (if (<= z 1.16e+70) (+ x (* a t)) (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.1e+103) {
tmp = a * (z * b);
} else if (z <= 1.16e+70) {
tmp = x + (a * t);
} else {
tmp = 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 (z <= (-4.1d+103)) then
tmp = a * (z * b)
else if (z <= 1.16d+70) then
tmp = x + (a * t)
else
tmp = 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 (z <= -4.1e+103) {
tmp = a * (z * b);
} else if (z <= 1.16e+70) {
tmp = x + (a * t);
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.1e+103: tmp = a * (z * b) elif z <= 1.16e+70: tmp = x + (a * t) else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.1e+103) tmp = Float64(a * Float64(z * b)); elseif (z <= 1.16e+70) tmp = Float64(x + Float64(a * t)); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.1e+103) tmp = a * (z * b); elseif (z <= 1.16e+70) tmp = x + (a * t); else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.1e+103], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.16e+70], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(z * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+103}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{+70}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -4.1000000000000002e103Initial program 76.1%
Taylor expanded in b around inf 54.6%
if -4.1000000000000002e103 < z < 1.1599999999999999e70Initial program 96.4%
Taylor expanded in z around 0 66.5%
if 1.1599999999999999e70 < z Initial program 87.9%
Taylor expanded in y around inf 47.5%
*-commutative47.5%
Simplified47.5%
Final simplification60.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.4e+94) x (if (<= x 6e-44) (* z y) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.4e+94) {
tmp = x;
} else if (x <= 6e-44) {
tmp = z * y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-2.4d+94)) then
tmp = x
else if (x <= 6d-44) then
tmp = z * y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.4e+94) {
tmp = x;
} else if (x <= 6e-44) {
tmp = z * y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.4e+94: tmp = x elif x <= 6e-44: tmp = z * y else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.4e+94) tmp = x; elseif (x <= 6e-44) tmp = Float64(z * y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.4e+94) tmp = x; elseif (x <= 6e-44) tmp = z * y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.4e+94], x, If[LessEqual[x, 6e-44], N[(z * y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+94}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-44}:\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.39999999999999983e94 or 6.0000000000000005e-44 < x Initial program 90.9%
Taylor expanded in x around inf 49.0%
if -2.39999999999999983e94 < x < 6.0000000000000005e-44Initial program 91.5%
Taylor expanded in y around inf 41.8%
*-commutative41.8%
Simplified41.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -9.4e-24) x (if (<= x 3.5e-42) (* a t) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.4e-24) {
tmp = x;
} else if (x <= 3.5e-42) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-9.4d-24)) then
tmp = x
else if (x <= 3.5d-42) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.4e-24) {
tmp = x;
} else if (x <= 3.5e-42) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -9.4e-24: tmp = x elif x <= 3.5e-42: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -9.4e-24) tmp = x; elseif (x <= 3.5e-42) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -9.4e-24) tmp = x; elseif (x <= 3.5e-42) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.4e-24], x, If[LessEqual[x, 3.5e-42], N[(a * t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.4 \cdot 10^{-24}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-42}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.39999999999999983e-24 or 3.5000000000000002e-42 < x Initial program 90.2%
Taylor expanded in x around inf 46.6%
if -9.39999999999999983e-24 < x < 3.5000000000000002e-42Initial program 92.4%
Taylor expanded in t around inf 31.4%
(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.2%
Taylor expanded in x around inf 27.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024097
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(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)))