
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* z y)) (* a t)) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(z * y)) + Float64(a * t)) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + z \cdot y\right) + a \cdot t\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 98.4%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*21.4%
Simplified21.4%
Taylor expanded in z around inf 85.7%
Final simplification97.7%
(FPCore (x y z t a b) :precision binary64 (fma z (fma a b y) (fma t a x)))
double code(double x, double y, double z, double t, double a, double b) {
return fma(z, fma(a, b, y), fma(t, a, x));
}
function code(x, y, z, t, a, b) return fma(z, fma(a, b, y), fma(t, a, x)) end
code[x_, y_, z_, t_, a_, b_] := N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)
\end{array}
Initial program 93.0%
+-commutative93.0%
+-commutative93.0%
associate-+l+93.0%
associate-+r+93.0%
*-commutative93.0%
associate-*l*93.4%
*-commutative93.4%
distribute-lft-out96.1%
fma-def96.5%
fma-def96.5%
+-commutative96.5%
fma-def96.5%
Simplified96.5%
Final simplification96.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= z -1.85e+149)
(* z y)
(if (<= z -1.6e+53)
t_1
(if (<= z -4.8e-6)
(* a t)
(if (<= z 3e-251)
x
(if (<= z 9e-239)
(* a t)
(if (<= z 100000.0)
x
(if (or (<= z 3.1e+112)
(and (not (<= z 1.85e+226)) (<= z 7e+239)))
t_1
(* z y))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (z <= -1.85e+149) {
tmp = z * y;
} else if (z <= -1.6e+53) {
tmp = t_1;
} else if (z <= -4.8e-6) {
tmp = a * t;
} else if (z <= 3e-251) {
tmp = x;
} else if (z <= 9e-239) {
tmp = a * t;
} else if (z <= 100000.0) {
tmp = x;
} else if ((z <= 3.1e+112) || (!(z <= 1.85e+226) && (z <= 7e+239))) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (z <= (-1.85d+149)) then
tmp = z * y
else if (z <= (-1.6d+53)) then
tmp = t_1
else if (z <= (-4.8d-6)) then
tmp = a * t
else if (z <= 3d-251) then
tmp = x
else if (z <= 9d-239) then
tmp = a * t
else if (z <= 100000.0d0) then
tmp = x
else if ((z <= 3.1d+112) .or. (.not. (z <= 1.85d+226)) .and. (z <= 7d+239)) then
tmp = t_1
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 t_1 = a * (z * b);
double tmp;
if (z <= -1.85e+149) {
tmp = z * y;
} else if (z <= -1.6e+53) {
tmp = t_1;
} else if (z <= -4.8e-6) {
tmp = a * t;
} else if (z <= 3e-251) {
tmp = x;
} else if (z <= 9e-239) {
tmp = a * t;
} else if (z <= 100000.0) {
tmp = x;
} else if ((z <= 3.1e+112) || (!(z <= 1.85e+226) && (z <= 7e+239))) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if z <= -1.85e+149: tmp = z * y elif z <= -1.6e+53: tmp = t_1 elif z <= -4.8e-6: tmp = a * t elif z <= 3e-251: tmp = x elif z <= 9e-239: tmp = a * t elif z <= 100000.0: tmp = x elif (z <= 3.1e+112) or (not (z <= 1.85e+226) and (z <= 7e+239)): tmp = t_1 else: tmp = z * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (z <= -1.85e+149) tmp = Float64(z * y); elseif (z <= -1.6e+53) tmp = t_1; elseif (z <= -4.8e-6) tmp = Float64(a * t); elseif (z <= 3e-251) tmp = x; elseif (z <= 9e-239) tmp = Float64(a * t); elseif (z <= 100000.0) tmp = x; elseif ((z <= 3.1e+112) || (!(z <= 1.85e+226) && (z <= 7e+239))) tmp = t_1; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (z <= -1.85e+149) tmp = z * y; elseif (z <= -1.6e+53) tmp = t_1; elseif (z <= -4.8e-6) tmp = a * t; elseif (z <= 3e-251) tmp = x; elseif (z <= 9e-239) tmp = a * t; elseif (z <= 100000.0) tmp = x; elseif ((z <= 3.1e+112) || (~((z <= 1.85e+226)) && (z <= 7e+239))) tmp = t_1; else tmp = z * y; 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[z, -1.85e+149], N[(z * y), $MachinePrecision], If[LessEqual[z, -1.6e+53], t$95$1, If[LessEqual[z, -4.8e-6], N[(a * t), $MachinePrecision], If[LessEqual[z, 3e-251], x, If[LessEqual[z, 9e-239], N[(a * t), $MachinePrecision], If[LessEqual[z, 100000.0], x, If[Or[LessEqual[z, 3.1e+112], And[N[Not[LessEqual[z, 1.85e+226]], $MachinePrecision], LessEqual[z, 7e+239]]], t$95$1, N[(z * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+149}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-6}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-251}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-239}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 100000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+112} \lor \neg \left(z \leq 1.85 \cdot 10^{+226}\right) \land z \leq 7 \cdot 10^{+239}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -1.84999999999999989e149 or 3.09999999999999983e112 < z < 1.84999999999999991e226 or 7.0000000000000003e239 < z Initial program 78.6%
associate-+l+78.6%
associate-*l*82.8%
Simplified82.8%
Taylor expanded in y around inf 58.1%
*-commutative58.1%
Simplified58.1%
if -1.84999999999999989e149 < z < -1.6e53 or 1e5 < z < 3.09999999999999983e112 or 1.84999999999999991e226 < z < 7.0000000000000003e239Initial program 96.2%
associate-+l+96.2%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in z around inf 85.3%
Taylor expanded in y around 0 62.3%
if -1.6e53 < z < -4.7999999999999998e-6 or 2.9999999999999999e-251 < z < 9.00000000000000026e-239Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 82.0%
if -4.7999999999999998e-6 < z < 2.9999999999999999e-251 or 9.00000000000000026e-239 < z < 1e5Initial program 99.2%
associate-+l+99.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 49.6%
Final simplification56.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= z -4.7e+148)
(* z y)
(if (<= z -4.2e+52)
t_1
(if (<= z -4e-5)
(* a t)
(if (<= z 1.35e-251)
x
(if (<= z 1.48e-238)
(* a t)
(if (<= z 2400.0)
x
(if (or (<= z 3.2e+112)
(and (not (<= z 2.9e+226)) (<= z 2.35e+266)))
t_1
(* z y))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (z <= -4.7e+148) {
tmp = z * y;
} else if (z <= -4.2e+52) {
tmp = t_1;
} else if (z <= -4e-5) {
tmp = a * t;
} else if (z <= 1.35e-251) {
tmp = x;
} else if (z <= 1.48e-238) {
tmp = a * t;
} else if (z <= 2400.0) {
tmp = x;
} else if ((z <= 3.2e+112) || (!(z <= 2.9e+226) && (z <= 2.35e+266))) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = z * (a * b)
if (z <= (-4.7d+148)) then
tmp = z * y
else if (z <= (-4.2d+52)) then
tmp = t_1
else if (z <= (-4d-5)) then
tmp = a * t
else if (z <= 1.35d-251) then
tmp = x
else if (z <= 1.48d-238) then
tmp = a * t
else if (z <= 2400.0d0) then
tmp = x
else if ((z <= 3.2d+112) .or. (.not. (z <= 2.9d+226)) .and. (z <= 2.35d+266)) then
tmp = t_1
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 t_1 = z * (a * b);
double tmp;
if (z <= -4.7e+148) {
tmp = z * y;
} else if (z <= -4.2e+52) {
tmp = t_1;
} else if (z <= -4e-5) {
tmp = a * t;
} else if (z <= 1.35e-251) {
tmp = x;
} else if (z <= 1.48e-238) {
tmp = a * t;
} else if (z <= 2400.0) {
tmp = x;
} else if ((z <= 3.2e+112) || (!(z <= 2.9e+226) && (z <= 2.35e+266))) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if z <= -4.7e+148: tmp = z * y elif z <= -4.2e+52: tmp = t_1 elif z <= -4e-5: tmp = a * t elif z <= 1.35e-251: tmp = x elif z <= 1.48e-238: tmp = a * t elif z <= 2400.0: tmp = x elif (z <= 3.2e+112) or (not (z <= 2.9e+226) and (z <= 2.35e+266)): tmp = t_1 else: tmp = z * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (z <= -4.7e+148) tmp = Float64(z * y); elseif (z <= -4.2e+52) tmp = t_1; elseif (z <= -4e-5) tmp = Float64(a * t); elseif (z <= 1.35e-251) tmp = x; elseif (z <= 1.48e-238) tmp = Float64(a * t); elseif (z <= 2400.0) tmp = x; elseif ((z <= 3.2e+112) || (!(z <= 2.9e+226) && (z <= 2.35e+266))) tmp = t_1; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (z <= -4.7e+148) tmp = z * y; elseif (z <= -4.2e+52) tmp = t_1; elseif (z <= -4e-5) tmp = a * t; elseif (z <= 1.35e-251) tmp = x; elseif (z <= 1.48e-238) tmp = a * t; elseif (z <= 2400.0) tmp = x; elseif ((z <= 3.2e+112) || (~((z <= 2.9e+226)) && (z <= 2.35e+266))) tmp = t_1; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.7e+148], N[(z * y), $MachinePrecision], If[LessEqual[z, -4.2e+52], t$95$1, If[LessEqual[z, -4e-5], N[(a * t), $MachinePrecision], If[LessEqual[z, 1.35e-251], x, If[LessEqual[z, 1.48e-238], N[(a * t), $MachinePrecision], If[LessEqual[z, 2400.0], x, If[Or[LessEqual[z, 3.2e+112], And[N[Not[LessEqual[z, 2.9e+226]], $MachinePrecision], LessEqual[z, 2.35e+266]]], t$95$1, N[(z * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -4.7 \cdot 10^{+148}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-5}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-251}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.48 \cdot 10^{-238}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 2400:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+112} \lor \neg \left(z \leq 2.9 \cdot 10^{+226}\right) \land z \leq 2.35 \cdot 10^{+266}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -4.6999999999999997e148 or 3.19999999999999986e112 < z < 2.89999999999999974e226 or 2.3499999999999999e266 < z Initial program 79.9%
associate-+l+79.9%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in y around inf 59.5%
*-commutative59.5%
Simplified59.5%
if -4.6999999999999997e148 < z < -4.2e52 or 2400 < z < 3.19999999999999986e112 or 2.89999999999999974e226 < z < 2.3499999999999999e266Initial program 93.2%
associate-+l+93.2%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in z around inf 84.9%
Taylor expanded in a around inf 59.0%
associate-*r*65.2%
*-commutative65.2%
Simplified65.2%
if -4.2e52 < z < -4.00000000000000033e-5 or 1.35000000000000005e-251 < z < 1.48000000000000006e-238Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 82.0%
if -4.00000000000000033e-5 < z < 1.35000000000000005e-251 or 1.48000000000000006e-238 < z < 2400Initial program 99.2%
associate-+l+99.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 49.6%
Final simplification57.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= z -5.2e+148)
(* z y)
(if (<= z -1.2e+54)
t_1
(if (<= z 2800.0)
(+ x (* a t))
(if (or (<= z 5e+112) (and (not (<= z 1.95e+226)) (<= z 4.6e+265)))
t_1
(* z y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (z <= -5.2e+148) {
tmp = z * y;
} else if (z <= -1.2e+54) {
tmp = t_1;
} else if (z <= 2800.0) {
tmp = x + (a * t);
} else if ((z <= 5e+112) || (!(z <= 1.95e+226) && (z <= 4.6e+265))) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = z * (a * b)
if (z <= (-5.2d+148)) then
tmp = z * y
else if (z <= (-1.2d+54)) then
tmp = t_1
else if (z <= 2800.0d0) then
tmp = x + (a * t)
else if ((z <= 5d+112) .or. (.not. (z <= 1.95d+226)) .and. (z <= 4.6d+265)) then
tmp = t_1
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 t_1 = z * (a * b);
double tmp;
if (z <= -5.2e+148) {
tmp = z * y;
} else if (z <= -1.2e+54) {
tmp = t_1;
} else if (z <= 2800.0) {
tmp = x + (a * t);
} else if ((z <= 5e+112) || (!(z <= 1.95e+226) && (z <= 4.6e+265))) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if z <= -5.2e+148: tmp = z * y elif z <= -1.2e+54: tmp = t_1 elif z <= 2800.0: tmp = x + (a * t) elif (z <= 5e+112) or (not (z <= 1.95e+226) and (z <= 4.6e+265)): tmp = t_1 else: tmp = z * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (z <= -5.2e+148) tmp = Float64(z * y); elseif (z <= -1.2e+54) tmp = t_1; elseif (z <= 2800.0) tmp = Float64(x + Float64(a * t)); elseif ((z <= 5e+112) || (!(z <= 1.95e+226) && (z <= 4.6e+265))) tmp = t_1; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (z <= -5.2e+148) tmp = z * y; elseif (z <= -1.2e+54) tmp = t_1; elseif (z <= 2800.0) tmp = x + (a * t); elseif ((z <= 5e+112) || (~((z <= 1.95e+226)) && (z <= 4.6e+265))) tmp = t_1; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+148], N[(z * y), $MachinePrecision], If[LessEqual[z, -1.2e+54], t$95$1, If[LessEqual[z, 2800.0], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 5e+112], And[N[Not[LessEqual[z, 1.95e+226]], $MachinePrecision], LessEqual[z, 4.6e+265]]], t$95$1, N[(z * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+148}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{+54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2800:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+112} \lor \neg \left(z \leq 1.95 \cdot 10^{+226}\right) \land z \leq 4.6 \cdot 10^{+265}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -5.2e148 or 5e112 < z < 1.94999999999999992e226 or 4.5999999999999999e265 < z Initial program 79.9%
associate-+l+79.9%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in y around inf 59.5%
*-commutative59.5%
Simplified59.5%
if -5.2e148 < z < -1.19999999999999999e54 or 2800 < z < 5e112 or 1.94999999999999992e226 < z < 4.5999999999999999e265Initial program 93.2%
associate-+l+93.2%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in z around inf 84.9%
Taylor expanded in a around inf 59.0%
associate-*r*65.2%
*-commutative65.2%
Simplified65.2%
if -1.19999999999999999e54 < z < 2800Initial program 99.2%
associate-+l+99.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 77.4%
Final simplification70.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<= z -2.9e+53)
t_1
(if (<= z -1.9e-19)
(+ (* a t) (* z y))
(if (or (<= z -2e-36) (not (<= z 220000.0))) t_1 (+ x (* a t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -2.9e+53) {
tmp = t_1;
} else if (z <= -1.9e-19) {
tmp = (a * t) + (z * y);
} else if ((z <= -2e-36) || !(z <= 220000.0)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = z * (y + (a * b))
if (z <= (-2.9d+53)) then
tmp = t_1
else if (z <= (-1.9d-19)) then
tmp = (a * t) + (z * y)
else if ((z <= (-2d-36)) .or. (.not. (z <= 220000.0d0))) then
tmp = t_1
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 t_1 = z * (y + (a * b));
double tmp;
if (z <= -2.9e+53) {
tmp = t_1;
} else if (z <= -1.9e-19) {
tmp = (a * t) + (z * y);
} else if ((z <= -2e-36) || !(z <= 220000.0)) {
tmp = t_1;
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (y + (a * b)) tmp = 0 if z <= -2.9e+53: tmp = t_1 elif z <= -1.9e-19: tmp = (a * t) + (z * y) elif (z <= -2e-36) or not (z <= 220000.0): tmp = t_1 else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -2.9e+53) tmp = t_1; elseif (z <= -1.9e-19) tmp = Float64(Float64(a * t) + Float64(z * y)); elseif ((z <= -2e-36) || !(z <= 220000.0)) tmp = t_1; else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (y + (a * b)); tmp = 0.0; if (z <= -2.9e+53) tmp = t_1; elseif (z <= -1.9e-19) tmp = (a * t) + (z * y); elseif ((z <= -2e-36) || ~((z <= 220000.0))) tmp = t_1; else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+53], t$95$1, If[LessEqual[z, -1.9e-19], N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2e-36], N[Not[LessEqual[z, 220000.0]], $MachinePrecision]], t$95$1, N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-19}:\\
\;\;\;\;a \cdot t + z \cdot y\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-36} \lor \neg \left(z \leq 220000\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -2.9000000000000002e53 or -1.9e-19 < z < -1.9999999999999999e-36 or 2.2e5 < z Initial program 86.8%
associate-+l+86.8%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in z around inf 84.3%
if -2.9000000000000002e53 < z < -1.9e-19Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around 0 100.0%
Taylor expanded in a around inf 88.2%
if -1.9999999999999999e-36 < z < 2.2e5Initial program 99.2%
associate-+l+99.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 80.6%
Final simplification82.7%
(FPCore (x y z t a b) :precision binary64 (+ (+ x (* z y)) (+ (* a (* z b)) (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + (z * y)) + ((a * (z * b)) + (a * t));
}
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 + (z * y)) + ((a * (z * b)) + (a * t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + (z * y)) + ((a * (z * b)) + (a * t));
}
def code(x, y, z, t, a, b): return (x + (z * y)) + ((a * (z * b)) + (a * t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * Float64(z * b)) + Float64(a * t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + (z * y)) + ((a * (z * b)) + (a * t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + z \cdot y\right) + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)
\end{array}
Initial program 93.0%
associate-+l+93.0%
associate-*l*93.5%
Simplified93.5%
Final simplification93.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))) (t_2 (+ x (* z y))))
(if (<= y -6.4e+125)
t_2
(if (<= y -2.05e+79)
t_1
(if (<= y -4.3e+40) (* a (* z b)) (if (<= y 4.2e+61) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double t_2 = x + (z * y);
double tmp;
if (y <= -6.4e+125) {
tmp = t_2;
} else if (y <= -2.05e+79) {
tmp = t_1;
} else if (y <= -4.3e+40) {
tmp = a * (z * b);
} else if (y <= 4.2e+61) {
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)
t_2 = x + (z * y)
if (y <= (-6.4d+125)) then
tmp = t_2
else if (y <= (-2.05d+79)) then
tmp = t_1
else if (y <= (-4.3d+40)) then
tmp = a * (z * b)
else if (y <= 4.2d+61) 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);
double t_2 = x + (z * y);
double tmp;
if (y <= -6.4e+125) {
tmp = t_2;
} else if (y <= -2.05e+79) {
tmp = t_1;
} else if (y <= -4.3e+40) {
tmp = a * (z * b);
} else if (y <= 4.2e+61) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) t_2 = x + (z * y) tmp = 0 if y <= -6.4e+125: tmp = t_2 elif y <= -2.05e+79: tmp = t_1 elif y <= -4.3e+40: tmp = a * (z * b) elif y <= 4.2e+61: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) t_2 = Float64(x + Float64(z * y)) tmp = 0.0 if (y <= -6.4e+125) tmp = t_2; elseif (y <= -2.05e+79) tmp = t_1; elseif (y <= -4.3e+40) tmp = Float64(a * Float64(z * b)); elseif (y <= 4.2e+61) 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); t_2 = x + (z * y); tmp = 0.0; if (y <= -6.4e+125) tmp = t_2; elseif (y <= -2.05e+79) tmp = t_1; elseif (y <= -4.3e+40) tmp = a * (z * b); elseif (y <= 4.2e+61) 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[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.4e+125], t$95$2, If[LessEqual[y, -2.05e+79], t$95$1, If[LessEqual[y, -4.3e+40], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+61], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
t_2 := x + z \cdot y\\
\mathbf{if}\;y \leq -6.4 \cdot 10^{+125}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.05 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.3 \cdot 10^{+40}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+61}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -6.39999999999999967e125 or 4.2000000000000002e61 < y Initial program 92.2%
associate-+l+92.2%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in a around 0 82.3%
if -6.39999999999999967e125 < y < -2.05e79 or -4.3000000000000002e40 < y < 4.2000000000000002e61Initial program 93.2%
associate-+l+93.2%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in z around 0 65.0%
if -2.05e79 < y < -4.3000000000000002e40Initial program 99.8%
associate-+l+99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in z around inf 100.0%
Taylor expanded in y around 0 85.8%
Final simplification71.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.2e+54) (not (<= z 11500000.0))) (* z (+ y (* a b))) (+ (+ x (* a t)) (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.2e+54) || !(z <= 11500000.0)) {
tmp = z * (y + (a * 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 ((z <= (-1.2d+54)) .or. (.not. (z <= 11500000.0d0))) then
tmp = z * (y + (a * 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 ((z <= -1.2e+54) || !(z <= 11500000.0)) {
tmp = z * (y + (a * b));
} else {
tmp = (x + (a * t)) + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.2e+54) or not (z <= 11500000.0): tmp = z * (y + (a * b)) else: tmp = (x + (a * t)) + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.2e+54) || !(z <= 11500000.0)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(Float64(x + Float64(a * t)) + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.2e+54) || ~((z <= 11500000.0))) tmp = z * (y + (a * b)); else tmp = (x + (a * t)) + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.2e+54], N[Not[LessEqual[z, 11500000.0]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+54} \lor \neg \left(z \leq 11500000\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + a \cdot t\right) + z \cdot y\\
\end{array}
\end{array}
if z < -1.19999999999999999e54 or 1.15e7 < z Initial program 86.3%
associate-+l+86.3%
associate-*l*86.4%
Simplified86.4%
Taylor expanded in z around inf 83.8%
if -1.19999999999999999e54 < z < 1.15e7Initial program 99.2%
associate-+l+99.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around 0 90.6%
Final simplification87.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.2e+52) (not (<= z 1.08e-32))) (+ x (* z (+ y (* a b)))) (+ (+ x (* a t)) (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.2e+52) || !(z <= 1.08e-32)) {
tmp = x + (z * (y + (a * 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 ((z <= (-3.2d+52)) .or. (.not. (z <= 1.08d-32))) then
tmp = x + (z * (y + (a * 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 ((z <= -3.2e+52) || !(z <= 1.08e-32)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (x + (a * t)) + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.2e+52) or not (z <= 1.08e-32): tmp = x + (z * (y + (a * b))) else: tmp = (x + (a * t)) + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.2e+52) || !(z <= 1.08e-32)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(Float64(x + Float64(a * t)) + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -3.2e+52) || ~((z <= 1.08e-32))) tmp = x + (z * (y + (a * b))); else tmp = (x + (a * t)) + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.2e+52], N[Not[LessEqual[z, 1.08e-32]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+52} \lor \neg \left(z \leq 1.08 \cdot 10^{-32}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + a \cdot t\right) + z \cdot y\\
\end{array}
\end{array}
if z < -3.2e52 or 1.08e-32 < z Initial program 87.0%
+-commutative87.0%
+-commutative87.0%
associate-+l+87.0%
associate-+r+87.0%
*-commutative87.0%
associate-*l*91.4%
*-commutative91.4%
distribute-lft-out96.8%
fma-def97.6%
fma-def97.6%
+-commutative97.6%
fma-def97.6%
Simplified97.6%
Taylor expanded in t around 0 93.6%
if -3.2e52 < z < 1.08e-32Initial program 99.2%
associate-+l+99.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around 0 90.9%
Final simplification92.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -3.6e-33)
(* z y)
(if (<= z 2.2e-253)
x
(if (<= z 1.55e-238) (* a t) (if (<= z 4.8e+18) x (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.6e-33) {
tmp = z * y;
} else if (z <= 2.2e-253) {
tmp = x;
} else if (z <= 1.55e-238) {
tmp = a * t;
} else if (z <= 4.8e+18) {
tmp = x;
} 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 <= (-3.6d-33)) then
tmp = z * y
else if (z <= 2.2d-253) then
tmp = x
else if (z <= 1.55d-238) then
tmp = a * t
else if (z <= 4.8d+18) then
tmp = x
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 <= -3.6e-33) {
tmp = z * y;
} else if (z <= 2.2e-253) {
tmp = x;
} else if (z <= 1.55e-238) {
tmp = a * t;
} else if (z <= 4.8e+18) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.6e-33: tmp = z * y elif z <= 2.2e-253: tmp = x elif z <= 1.55e-238: tmp = a * t elif z <= 4.8e+18: tmp = x else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.6e-33) tmp = Float64(z * y); elseif (z <= 2.2e-253) tmp = x; elseif (z <= 1.55e-238) tmp = Float64(a * t); elseif (z <= 4.8e+18) tmp = x; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.6e-33) tmp = z * y; elseif (z <= 2.2e-253) tmp = x; elseif (z <= 1.55e-238) tmp = a * t; elseif (z <= 4.8e+18) tmp = x; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.6e-33], N[(z * y), $MachinePrecision], If[LessEqual[z, 2.2e-253], x, If[LessEqual[z, 1.55e-238], N[(a * t), $MachinePrecision], If[LessEqual[z, 4.8e+18], x, N[(z * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-33}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-253}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-238}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+18}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -3.60000000000000034e-33 or 4.8e18 < z Initial program 87.3%
associate-+l+87.3%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in y around inf 43.0%
*-commutative43.0%
Simplified43.0%
if -3.60000000000000034e-33 < z < 2.19999999999999996e-253 or 1.5500000000000001e-238 < z < 4.8e18Initial program 99.2%
associate-+l+99.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 50.3%
if 2.19999999999999996e-253 < z < 1.5500000000000001e-238Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 95.9%
Final simplification47.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2e-36) (not (<= z 700.0))) (* z (+ y (* a b))) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2e-36) || !(z <= 700.0)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2d-36)) .or. (.not. (z <= 700.0d0))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2e-36) || !(z <= 700.0)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2e-36) or not (z <= 700.0): tmp = z * (y + (a * b)) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2e-36) || !(z <= 700.0)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2e-36) || ~((z <= 700.0))) tmp = z * (y + (a * b)); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2e-36], N[Not[LessEqual[z, 700.0]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-36} \lor \neg \left(z \leq 700\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -1.9999999999999999e-36 or 700 < z Initial program 87.6%
associate-+l+87.6%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in z around inf 81.2%
if -1.9999999999999999e-36 < z < 700Initial program 99.2%
associate-+l+99.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 80.6%
Final simplification80.9%
(FPCore (x y z t a b) :precision binary64 (if (<= a -3.4e+62) (* a t) (if (<= a 3800000000.0) x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.4e+62) {
tmp = a * t;
} else if (a <= 3800000000.0) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-3.4d+62)) then
tmp = a * t
else if (a <= 3800000000.0d0) then
tmp = x
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.4e+62) {
tmp = a * t;
} else if (a <= 3800000000.0) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3.4e+62: tmp = a * t elif a <= 3800000000.0: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3.4e+62) tmp = Float64(a * t); elseif (a <= 3800000000.0) tmp = x; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3.4e+62) tmp = a * t; elseif (a <= 3800000000.0) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.4e+62], N[(a * t), $MachinePrecision], If[LessEqual[a, 3800000000.0], x, N[(a * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.4 \cdot 10^{+62}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 3800000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -3.40000000000000014e62 or 3.8e9 < a Initial program 85.9%
associate-+l+85.9%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in t around inf 43.0%
if -3.40000000000000014e62 < a < 3.8e9Initial program 98.6%
associate-+l+98.6%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in x around inf 43.1%
Final simplification43.1%
(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.0%
associate-+l+93.0%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in x around inf 28.9%
Final simplification28.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023185
(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)))