
(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 (+ t (* z b))))
(if (<= (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)) INFINITY)
(fma a t_1 (fma y z x))
(* a t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (z * b);
double tmp;
if ((((x + (y * z)) + (t * a)) + ((z * a) * b)) <= ((double) INFINITY)) {
tmp = fma(a, t_1, fma(y, z, x));
} else {
tmp = a * t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(z * b)) tmp = 0.0 if (Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) <= Inf) tmp = fma(a, t_1, fma(y, z, x)); else tmp = Float64(a * t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], Infinity], N[(a * t$95$1 + N[(y * z + x), $MachinePrecision]), $MachinePrecision], N[(a * t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + z \cdot b\\
\mathbf{if}\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(a, t_1, \mathsf{fma}\left(y, z, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot t_1\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 96.3%
associate-+l+96.3%
+-commutative96.3%
*-commutative96.3%
*-commutative96.3%
associate-*l*97.1%
distribute-rgt-out97.1%
fma-def97.1%
*-commutative97.1%
+-commutative97.1%
fma-def97.1%
Simplified97.1%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
*-commutative0.0%
associate-*l*11.1%
Simplified11.1%
Taylor expanded in a around inf 94.4%
Final simplification97.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 INFINITY) t_1 (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(t + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 96.3%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
*-commutative0.0%
associate-*l*11.1%
Simplified11.1%
Taylor expanded in a around inf 94.4%
Final simplification96.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= b -2.2e+165)
t_1
(if (<= b -1.05e+55)
(* t a)
(if (<= b -3.1e-111)
(* y z)
(if (<= b -8.5e-238)
x
(if (<= b 4.5e-194)
(* y z)
(if (<= b 2.8e-82)
(* t a)
(if (<= b 950.0)
(* y z)
(if (<= b 2e+25)
x
(if (or (<= b 3e+36) (not (<= b 2.25e+99))) t_1 x)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (b <= -2.2e+165) {
tmp = t_1;
} else if (b <= -1.05e+55) {
tmp = t * a;
} else if (b <= -3.1e-111) {
tmp = y * z;
} else if (b <= -8.5e-238) {
tmp = x;
} else if (b <= 4.5e-194) {
tmp = y * z;
} else if (b <= 2.8e-82) {
tmp = t * a;
} else if (b <= 950.0) {
tmp = y * z;
} else if (b <= 2e+25) {
tmp = x;
} else if ((b <= 3e+36) || !(b <= 2.25e+99)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (b <= (-2.2d+165)) then
tmp = t_1
else if (b <= (-1.05d+55)) then
tmp = t * a
else if (b <= (-3.1d-111)) then
tmp = y * z
else if (b <= (-8.5d-238)) then
tmp = x
else if (b <= 4.5d-194) then
tmp = y * z
else if (b <= 2.8d-82) then
tmp = t * a
else if (b <= 950.0d0) then
tmp = y * z
else if (b <= 2d+25) then
tmp = x
else if ((b <= 3d+36) .or. (.not. (b <= 2.25d+99))) then
tmp = t_1
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 t_1 = a * (z * b);
double tmp;
if (b <= -2.2e+165) {
tmp = t_1;
} else if (b <= -1.05e+55) {
tmp = t * a;
} else if (b <= -3.1e-111) {
tmp = y * z;
} else if (b <= -8.5e-238) {
tmp = x;
} else if (b <= 4.5e-194) {
tmp = y * z;
} else if (b <= 2.8e-82) {
tmp = t * a;
} else if (b <= 950.0) {
tmp = y * z;
} else if (b <= 2e+25) {
tmp = x;
} else if ((b <= 3e+36) || !(b <= 2.25e+99)) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if b <= -2.2e+165: tmp = t_1 elif b <= -1.05e+55: tmp = t * a elif b <= -3.1e-111: tmp = y * z elif b <= -8.5e-238: tmp = x elif b <= 4.5e-194: tmp = y * z elif b <= 2.8e-82: tmp = t * a elif b <= 950.0: tmp = y * z elif b <= 2e+25: tmp = x elif (b <= 3e+36) or not (b <= 2.25e+99): tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (b <= -2.2e+165) tmp = t_1; elseif (b <= -1.05e+55) tmp = Float64(t * a); elseif (b <= -3.1e-111) tmp = Float64(y * z); elseif (b <= -8.5e-238) tmp = x; elseif (b <= 4.5e-194) tmp = Float64(y * z); elseif (b <= 2.8e-82) tmp = Float64(t * a); elseif (b <= 950.0) tmp = Float64(y * z); elseif (b <= 2e+25) tmp = x; elseif ((b <= 3e+36) || !(b <= 2.25e+99)) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (b <= -2.2e+165) tmp = t_1; elseif (b <= -1.05e+55) tmp = t * a; elseif (b <= -3.1e-111) tmp = y * z; elseif (b <= -8.5e-238) tmp = x; elseif (b <= 4.5e-194) tmp = y * z; elseif (b <= 2.8e-82) tmp = t * a; elseif (b <= 950.0) tmp = y * z; elseif (b <= 2e+25) tmp = x; elseif ((b <= 3e+36) || ~((b <= 2.25e+99))) tmp = t_1; else tmp = x; 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[b, -2.2e+165], t$95$1, If[LessEqual[b, -1.05e+55], N[(t * a), $MachinePrecision], If[LessEqual[b, -3.1e-111], N[(y * z), $MachinePrecision], If[LessEqual[b, -8.5e-238], x, If[LessEqual[b, 4.5e-194], N[(y * z), $MachinePrecision], If[LessEqual[b, 2.8e-82], N[(t * a), $MachinePrecision], If[LessEqual[b, 950.0], N[(y * z), $MachinePrecision], If[LessEqual[b, 2e+25], x, If[Or[LessEqual[b, 3e+36], N[Not[LessEqual[b, 2.25e+99]], $MachinePrecision]], t$95$1, x]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;b \leq -2.2 \cdot 10^{+165}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.05 \cdot 10^{+55}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq -3.1 \cdot 10^{-111}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq -8.5 \cdot 10^{-238}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{-194}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 2.8 \cdot 10^{-82}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq 950:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 2 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 3 \cdot 10^{+36} \lor \neg \left(b \leq 2.25 \cdot 10^{+99}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if b < -2.1999999999999999e165 or 2.00000000000000018e25 < b < 3e36 or 2.25e99 < b Initial program 83.0%
*-commutative83.0%
associate-*l*75.7%
Simplified75.7%
Taylor expanded in a around inf 76.1%
Taylor expanded in t around 0 72.3%
if -2.1999999999999999e165 < b < -1.05e55 or 4.4999999999999999e-194 < b < 2.80000000000000024e-82Initial program 87.7%
*-commutative87.7%
associate-*l*87.8%
Simplified87.8%
Taylor expanded in t around inf 53.4%
if -1.05e55 < b < -3.10000000000000014e-111 or -8.5000000000000006e-238 < b < 4.4999999999999999e-194 or 2.80000000000000024e-82 < b < 950Initial program 94.9%
*-commutative94.9%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in y around inf 50.3%
*-commutative50.3%
Simplified50.3%
if -3.10000000000000014e-111 < b < -8.5000000000000006e-238 or 950 < b < 2.00000000000000018e25 or 3e36 < b < 2.25e99Initial program 93.6%
*-commutative93.6%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in x around inf 51.5%
Final simplification57.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* z a) b)))
(if (<= b -2e+165)
t_1
(if (<= b -1.22e+55)
(* t a)
(if (<= b -4e-111)
(* y z)
(if (<= b -1.1e-243)
x
(if (<= b 8.7e-193)
(* y z)
(if (<= b 1.7e-82)
(* t a)
(if (<= b 1.8)
(* y z)
(if (<= b 2.5e+25)
x
(if (<= b 6.6e+36)
(* a (* z b))
(if (<= b 1.4e+98) x t_1))))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * a) * b;
double tmp;
if (b <= -2e+165) {
tmp = t_1;
} else if (b <= -1.22e+55) {
tmp = t * a;
} else if (b <= -4e-111) {
tmp = y * z;
} else if (b <= -1.1e-243) {
tmp = x;
} else if (b <= 8.7e-193) {
tmp = y * z;
} else if (b <= 1.7e-82) {
tmp = t * a;
} else if (b <= 1.8) {
tmp = y * z;
} else if (b <= 2.5e+25) {
tmp = x;
} else if (b <= 6.6e+36) {
tmp = a * (z * b);
} else if (b <= 1.4e+98) {
tmp = 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 * a) * b
if (b <= (-2d+165)) then
tmp = t_1
else if (b <= (-1.22d+55)) then
tmp = t * a
else if (b <= (-4d-111)) then
tmp = y * z
else if (b <= (-1.1d-243)) then
tmp = x
else if (b <= 8.7d-193) then
tmp = y * z
else if (b <= 1.7d-82) then
tmp = t * a
else if (b <= 1.8d0) then
tmp = y * z
else if (b <= 2.5d+25) then
tmp = x
else if (b <= 6.6d+36) then
tmp = a * (z * b)
else if (b <= 1.4d+98) then
tmp = 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 * a) * b;
double tmp;
if (b <= -2e+165) {
tmp = t_1;
} else if (b <= -1.22e+55) {
tmp = t * a;
} else if (b <= -4e-111) {
tmp = y * z;
} else if (b <= -1.1e-243) {
tmp = x;
} else if (b <= 8.7e-193) {
tmp = y * z;
} else if (b <= 1.7e-82) {
tmp = t * a;
} else if (b <= 1.8) {
tmp = y * z;
} else if (b <= 2.5e+25) {
tmp = x;
} else if (b <= 6.6e+36) {
tmp = a * (z * b);
} else if (b <= 1.4e+98) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * a) * b tmp = 0 if b <= -2e+165: tmp = t_1 elif b <= -1.22e+55: tmp = t * a elif b <= -4e-111: tmp = y * z elif b <= -1.1e-243: tmp = x elif b <= 8.7e-193: tmp = y * z elif b <= 1.7e-82: tmp = t * a elif b <= 1.8: tmp = y * z elif b <= 2.5e+25: tmp = x elif b <= 6.6e+36: tmp = a * (z * b) elif b <= 1.4e+98: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * a) * b) tmp = 0.0 if (b <= -2e+165) tmp = t_1; elseif (b <= -1.22e+55) tmp = Float64(t * a); elseif (b <= -4e-111) tmp = Float64(y * z); elseif (b <= -1.1e-243) tmp = x; elseif (b <= 8.7e-193) tmp = Float64(y * z); elseif (b <= 1.7e-82) tmp = Float64(t * a); elseif (b <= 1.8) tmp = Float64(y * z); elseif (b <= 2.5e+25) tmp = x; elseif (b <= 6.6e+36) tmp = Float64(a * Float64(z * b)); elseif (b <= 1.4e+98) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * a) * b; tmp = 0.0; if (b <= -2e+165) tmp = t_1; elseif (b <= -1.22e+55) tmp = t * a; elseif (b <= -4e-111) tmp = y * z; elseif (b <= -1.1e-243) tmp = x; elseif (b <= 8.7e-193) tmp = y * z; elseif (b <= 1.7e-82) tmp = t * a; elseif (b <= 1.8) tmp = y * z; elseif (b <= 2.5e+25) tmp = x; elseif (b <= 6.6e+36) tmp = a * (z * b); elseif (b <= 1.4e+98) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2e+165], t$95$1, If[LessEqual[b, -1.22e+55], N[(t * a), $MachinePrecision], If[LessEqual[b, -4e-111], N[(y * z), $MachinePrecision], If[LessEqual[b, -1.1e-243], x, If[LessEqual[b, 8.7e-193], N[(y * z), $MachinePrecision], If[LessEqual[b, 1.7e-82], N[(t * a), $MachinePrecision], If[LessEqual[b, 1.8], N[(y * z), $MachinePrecision], If[LessEqual[b, 2.5e+25], x, If[LessEqual[b, 6.6e+36], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.4e+98], x, t$95$1]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;b \leq -2 \cdot 10^{+165}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.22 \cdot 10^{+55}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq -4 \cdot 10^{-111}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq -1.1 \cdot 10^{-243}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 8.7 \cdot 10^{-193}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 1.7 \cdot 10^{-82}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq 1.8:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 6.6 \cdot 10^{+36}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{+98}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -1.9999999999999998e165 or 1.4e98 < b Initial program 82.1%
*-commutative82.1%
associate-*l*74.4%
Simplified74.4%
Taylor expanded in z around inf 79.9%
Taylor expanded in y around 0 72.0%
Taylor expanded in z around 0 72.2%
associate-*r*72.0%
*-commutative72.0%
associate-*r*75.3%
Simplified75.3%
if -1.9999999999999998e165 < b < -1.22e55 or 8.6999999999999997e-193 < b < 1.69999999999999988e-82Initial program 87.7%
*-commutative87.7%
associate-*l*87.8%
Simplified87.8%
Taylor expanded in t around inf 53.4%
if -1.22e55 < b < -4.00000000000000035e-111 or -1.1e-243 < b < 8.6999999999999997e-193 or 1.69999999999999988e-82 < b < 1.80000000000000004Initial program 94.9%
*-commutative94.9%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in y around inf 50.3%
*-commutative50.3%
Simplified50.3%
if -4.00000000000000035e-111 < b < -1.1e-243 or 1.80000000000000004 < b < 2.50000000000000012e25 or 6.5999999999999997e36 < b < 1.4e98Initial program 93.6%
*-commutative93.6%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in x around inf 51.5%
if 2.50000000000000012e25 < b < 6.5999999999999997e36Initial program 99.6%
*-commutative99.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in a around inf 75.2%
Taylor expanded in t around 0 75.3%
Final simplification58.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (+ x (* y z))) (t_3 (* (* z a) b)))
(if (<= b -3.4e+165)
t_3
(if (<= b -3.25e+56)
t_1
(if (<= b -2.8e-46)
t_2
(if (<= b -7.5e-227)
t_1
(if (<= b 4.75e-194)
t_2
(if (<= b 2.2e-82) t_1 (if (<= b 1.5e+105) t_2 t_3)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = x + (y * z);
double t_3 = (z * a) * b;
double tmp;
if (b <= -3.4e+165) {
tmp = t_3;
} else if (b <= -3.25e+56) {
tmp = t_1;
} else if (b <= -2.8e-46) {
tmp = t_2;
} else if (b <= -7.5e-227) {
tmp = t_1;
} else if (b <= 4.75e-194) {
tmp = t_2;
} else if (b <= 2.2e-82) {
tmp = t_1;
} else if (b <= 1.5e+105) {
tmp = t_2;
} else {
tmp = t_3;
}
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 + (t * a)
t_2 = x + (y * z)
t_3 = (z * a) * b
if (b <= (-3.4d+165)) then
tmp = t_3
else if (b <= (-3.25d+56)) then
tmp = t_1
else if (b <= (-2.8d-46)) then
tmp = t_2
else if (b <= (-7.5d-227)) then
tmp = t_1
else if (b <= 4.75d-194) then
tmp = t_2
else if (b <= 2.2d-82) then
tmp = t_1
else if (b <= 1.5d+105) then
tmp = t_2
else
tmp = t_3
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 + (t * a);
double t_2 = x + (y * z);
double t_3 = (z * a) * b;
double tmp;
if (b <= -3.4e+165) {
tmp = t_3;
} else if (b <= -3.25e+56) {
tmp = t_1;
} else if (b <= -2.8e-46) {
tmp = t_2;
} else if (b <= -7.5e-227) {
tmp = t_1;
} else if (b <= 4.75e-194) {
tmp = t_2;
} else if (b <= 2.2e-82) {
tmp = t_1;
} else if (b <= 1.5e+105) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = x + (y * z) t_3 = (z * a) * b tmp = 0 if b <= -3.4e+165: tmp = t_3 elif b <= -3.25e+56: tmp = t_1 elif b <= -2.8e-46: tmp = t_2 elif b <= -7.5e-227: tmp = t_1 elif b <= 4.75e-194: tmp = t_2 elif b <= 2.2e-82: tmp = t_1 elif b <= 1.5e+105: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(x + Float64(y * z)) t_3 = Float64(Float64(z * a) * b) tmp = 0.0 if (b <= -3.4e+165) tmp = t_3; elseif (b <= -3.25e+56) tmp = t_1; elseif (b <= -2.8e-46) tmp = t_2; elseif (b <= -7.5e-227) tmp = t_1; elseif (b <= 4.75e-194) tmp = t_2; elseif (b <= 2.2e-82) tmp = t_1; elseif (b <= 1.5e+105) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = x + (y * z); t_3 = (z * a) * b; tmp = 0.0; if (b <= -3.4e+165) tmp = t_3; elseif (b <= -3.25e+56) tmp = t_1; elseif (b <= -2.8e-46) tmp = t_2; elseif (b <= -7.5e-227) tmp = t_1; elseif (b <= 4.75e-194) tmp = t_2; elseif (b <= 2.2e-82) tmp = t_1; elseif (b <= 1.5e+105) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -3.4e+165], t$95$3, If[LessEqual[b, -3.25e+56], t$95$1, If[LessEqual[b, -2.8e-46], t$95$2, If[LessEqual[b, -7.5e-227], t$95$1, If[LessEqual[b, 4.75e-194], t$95$2, If[LessEqual[b, 2.2e-82], t$95$1, If[LessEqual[b, 1.5e+105], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := x + y \cdot z\\
t_3 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;b \leq -3.4 \cdot 10^{+165}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \leq -3.25 \cdot 10^{+56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -2.8 \cdot 10^{-46}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -7.5 \cdot 10^{-227}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 4.75 \cdot 10^{-194}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{-82}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+105}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if b < -3.40000000000000011e165 or 1.5e105 < b Initial program 81.9%
*-commutative81.9%
associate-*l*74.0%
Simplified74.0%
Taylor expanded in z around inf 79.7%
Taylor expanded in y around 0 72.9%
Taylor expanded in z around 0 73.0%
associate-*r*72.9%
*-commutative72.9%
associate-*r*76.2%
Simplified76.2%
if -3.40000000000000011e165 < b < -3.25e56 or -2.7999999999999998e-46 < b < -7.49999999999999988e-227 or 4.75000000000000005e-194 < b < 2.19999999999999986e-82Initial program 89.1%
*-commutative89.1%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in z around 0 74.4%
if -3.25e56 < b < -2.7999999999999998e-46 or -7.49999999999999988e-227 < b < 4.75000000000000005e-194 or 2.19999999999999986e-82 < b < 1.5e105Initial program 95.8%
*-commutative95.8%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in a around 0 71.5%
Final simplification73.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -3.2e+103)
(+ x t_1)
(if (<= a 1.7e+182) (+ (+ (+ x (* y z)) (* t a)) (* z (* a b))) 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 <= -3.2e+103) {
tmp = x + t_1;
} else if (a <= 1.7e+182) {
tmp = ((x + (y * z)) + (t * a)) + (z * (a * b));
} 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 <= (-3.2d+103)) then
tmp = x + t_1
else if (a <= 1.7d+182) then
tmp = ((x + (y * z)) + (t * a)) + (z * (a * b))
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 <= -3.2e+103) {
tmp = x + t_1;
} else if (a <= 1.7e+182) {
tmp = ((x + (y * z)) + (t * a)) + (z * (a * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -3.2e+103: tmp = x + t_1 elif a <= 1.7e+182: tmp = ((x + (y * z)) + (t * a)) + (z * (a * b)) 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 <= -3.2e+103) tmp = Float64(x + t_1); elseif (a <= 1.7e+182) tmp = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(z * Float64(a * b))); 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 <= -3.2e+103) tmp = x + t_1; elseif (a <= 1.7e+182) tmp = ((x + (y * z)) + (t * a)) + (z * (a * b)); 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, -3.2e+103], N[(x + t$95$1), $MachinePrecision], If[LessEqual[a, 1.7e+182], N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -3.2 \cdot 10^{+103}:\\
\;\;\;\;x + t_1\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+182}:\\
\;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -3.19999999999999993e103Initial program 77.5%
associate-+l+77.5%
+-commutative77.5%
*-commutative77.5%
*-commutative77.5%
associate-*l*85.6%
distribute-rgt-out97.0%
fma-def97.0%
*-commutative97.0%
+-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in y around 0 92.0%
if -3.19999999999999993e103 < a < 1.69999999999999993e182Initial program 95.7%
*-commutative95.7%
associate-*l*96.8%
Simplified96.8%
if 1.69999999999999993e182 < a Initial program 68.5%
*-commutative68.5%
associate-*l*66.2%
Simplified66.2%
Taylor expanded in a around inf 97.1%
Final simplification96.2%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -9e+43)
(and (not (<= z 5.6e-11)) (or (<= z 2.6e+37) (not (<= z 4e+88)))))
(* z (+ y (* a b)))
(+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9e+43) || (!(z <= 5.6e-11) && ((z <= 2.6e+37) || !(z <= 4e+88)))) {
tmp = z * (y + (a * b));
} 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 ((z <= (-9d+43)) .or. (.not. (z <= 5.6d-11)) .and. (z <= 2.6d+37) .or. (.not. (z <= 4d+88))) then
tmp = z * (y + (a * b))
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 ((z <= -9e+43) || (!(z <= 5.6e-11) && ((z <= 2.6e+37) || !(z <= 4e+88)))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9e+43) or (not (z <= 5.6e-11) and ((z <= 2.6e+37) or not (z <= 4e+88))): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9e+43) || (!(z <= 5.6e-11) && ((z <= 2.6e+37) || !(z <= 4e+88)))) tmp = Float64(z * Float64(y + Float64(a * b))); 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 ((z <= -9e+43) || (~((z <= 5.6e-11)) && ((z <= 2.6e+37) || ~((z <= 4e+88))))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9e+43], And[N[Not[LessEqual[z, 5.6e-11]], $MachinePrecision], Or[LessEqual[z, 2.6e+37], N[Not[LessEqual[z, 4e+88]], $MachinePrecision]]]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+43} \lor \neg \left(z \leq 5.6 \cdot 10^{-11}\right) \land \left(z \leq 2.6 \cdot 10^{+37} \lor \neg \left(z \leq 4 \cdot 10^{+88}\right)\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -9e43 or 5.6e-11 < z < 2.5999999999999999e37 or 3.99999999999999984e88 < z Initial program 78.8%
*-commutative78.8%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in z around inf 86.9%
if -9e43 < z < 5.6e-11 or 2.5999999999999999e37 < z < 3.99999999999999984e88Initial program 96.2%
associate-+l+96.2%
+-commutative96.2%
*-commutative96.2%
*-commutative96.2%
associate-*l*97.4%
distribute-rgt-out99.3%
fma-def99.3%
*-commutative99.3%
+-commutative99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in y around 0 90.8%
Final simplification89.3%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -1.9e-59)
(and (not (<= a 1.9e-71)) (or (<= a 4.6e+16) (not (<= a 1.4e+86)))))
(* a (+ t (* z b)))
(+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.9e-59) || (!(a <= 1.9e-71) && ((a <= 4.6e+16) || !(a <= 1.4e+86)))) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.9d-59)) .or. (.not. (a <= 1.9d-71)) .and. (a <= 4.6d+16) .or. (.not. (a <= 1.4d+86))) then
tmp = a * (t + (z * b))
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.9e-59) || (!(a <= 1.9e-71) && ((a <= 4.6e+16) || !(a <= 1.4e+86)))) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.9e-59) or (not (a <= 1.9e-71) and ((a <= 4.6e+16) or not (a <= 1.4e+86))): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.9e-59) || (!(a <= 1.9e-71) && ((a <= 4.6e+16) || !(a <= 1.4e+86)))) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.9e-59) || (~((a <= 1.9e-71)) && ((a <= 4.6e+16) || ~((a <= 1.4e+86))))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.9e-59], And[N[Not[LessEqual[a, 1.9e-71]], $MachinePrecision], Or[LessEqual[a, 4.6e+16], N[Not[LessEqual[a, 1.4e+86]], $MachinePrecision]]]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-59} \lor \neg \left(a \leq 1.9 \cdot 10^{-71}\right) \land \left(a \leq 4.6 \cdot 10^{+16} \lor \neg \left(a \leq 1.4 \cdot 10^{+86}\right)\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -1.89999999999999992e-59 or 1.89999999999999996e-71 < a < 4.6e16 or 1.40000000000000002e86 < a Initial program 85.4%
*-commutative85.4%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in a around inf 75.6%
if -1.89999999999999992e-59 < a < 1.89999999999999996e-71 or 4.6e16 < a < 1.40000000000000002e86Initial program 95.3%
*-commutative95.3%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in a around 0 79.9%
Final simplification77.4%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -1.32e-92)
(not (or (<= z 1.75e-12) (and (not (<= z 8.5e+49)) (<= z 1.12e+69)))))
(* z (+ y (* a b)))
(+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.32e-92) || !((z <= 1.75e-12) || (!(z <= 8.5e+49) && (z <= 1.12e+69)))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
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.32d-92)) .or. (.not. (z <= 1.75d-12) .or. (.not. (z <= 8.5d+49)) .and. (z <= 1.12d+69))) then
tmp = z * (y + (a * b))
else
tmp = x + (t * a)
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.32e-92) || !((z <= 1.75e-12) || (!(z <= 8.5e+49) && (z <= 1.12e+69)))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.32e-92) or not ((z <= 1.75e-12) or (not (z <= 8.5e+49) and (z <= 1.12e+69))): tmp = z * (y + (a * b)) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.32e-92) || !((z <= 1.75e-12) || (!(z <= 8.5e+49) && (z <= 1.12e+69)))) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.32e-92) || ~(((z <= 1.75e-12) || (~((z <= 8.5e+49)) && (z <= 1.12e+69))))) tmp = z * (y + (a * b)); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.32e-92], N[Not[Or[LessEqual[z, 1.75e-12], And[N[Not[LessEqual[z, 8.5e+49]], $MachinePrecision], LessEqual[z, 1.12e+69]]]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{-92} \lor \neg \left(z \leq 1.75 \cdot 10^{-12} \lor \neg \left(z \leq 8.5 \cdot 10^{+49}\right) \land z \leq 1.12 \cdot 10^{+69}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -1.3200000000000001e-92 or 1.75e-12 < z < 8.4999999999999996e49 or 1.12e69 < z Initial program 83.5%
*-commutative83.5%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in z around inf 82.2%
if -1.3200000000000001e-92 < z < 1.75e-12 or 8.4999999999999996e49 < z < 1.12e69Initial program 95.9%
*-commutative95.9%
associate-*l*87.5%
Simplified87.5%
Taylor expanded in z around 0 76.3%
Final simplification79.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (* (* z a) b)))
(if (<= b -1.5e+166)
t_2
(if (<= b -55000.0)
t_1
(if (<= b -5e-45) (* y z) (if (<= b 1.75e+118) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = (z * a) * b;
double tmp;
if (b <= -1.5e+166) {
tmp = t_2;
} else if (b <= -55000.0) {
tmp = t_1;
} else if (b <= -5e-45) {
tmp = y * z;
} else if (b <= 1.75e+118) {
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 + (t * a)
t_2 = (z * a) * b
if (b <= (-1.5d+166)) then
tmp = t_2
else if (b <= (-55000.0d0)) then
tmp = t_1
else if (b <= (-5d-45)) then
tmp = y * z
else if (b <= 1.75d+118) 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 + (t * a);
double t_2 = (z * a) * b;
double tmp;
if (b <= -1.5e+166) {
tmp = t_2;
} else if (b <= -55000.0) {
tmp = t_1;
} else if (b <= -5e-45) {
tmp = y * z;
} else if (b <= 1.75e+118) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = (z * a) * b tmp = 0 if b <= -1.5e+166: tmp = t_2 elif b <= -55000.0: tmp = t_1 elif b <= -5e-45: tmp = y * z elif b <= 1.75e+118: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(Float64(z * a) * b) tmp = 0.0 if (b <= -1.5e+166) tmp = t_2; elseif (b <= -55000.0) tmp = t_1; elseif (b <= -5e-45) tmp = Float64(y * z); elseif (b <= 1.75e+118) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = (z * a) * b; tmp = 0.0; if (b <= -1.5e+166) tmp = t_2; elseif (b <= -55000.0) tmp = t_1; elseif (b <= -5e-45) tmp = y * z; elseif (b <= 1.75e+118) 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[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.5e+166], t$95$2, If[LessEqual[b, -55000.0], t$95$1, If[LessEqual[b, -5e-45], N[(y * z), $MachinePrecision], If[LessEqual[b, 1.75e+118], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;b \leq -1.5 \cdot 10^{+166}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -55000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -5 \cdot 10^{-45}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{+118}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -1.49999999999999999e166 or 1.75000000000000008e118 < b Initial program 81.4%
*-commutative81.4%
associate-*l*73.3%
Simplified73.3%
Taylor expanded in z around inf 80.8%
Taylor expanded in y around 0 73.7%
Taylor expanded in z around 0 73.9%
associate-*r*73.7%
*-commutative73.7%
associate-*r*77.1%
Simplified77.1%
if -1.49999999999999999e166 < b < -55000 or -4.99999999999999976e-45 < b < 1.75000000000000008e118Initial program 92.3%
*-commutative92.3%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in z around 0 63.4%
if -55000 < b < -4.99999999999999976e-45Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in y around inf 86.1%
*-commutative86.1%
Simplified86.1%
Final simplification67.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.5e+83) (not (<= b 2.1e+65))) (+ x (* a (+ t (* z b)))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.5e+83) || !(b <= 2.1e+65)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-3.5d+83)) .or. (.not. (b <= 2.1d+65))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((t * a) + (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.5e+83) || !(b <= 2.1e+65)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.5e+83) or not (b <= 2.1e+65): tmp = x + (a * (t + (z * b))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.5e+83) || !(b <= 2.1e+65)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -3.5e+83) || ~((b <= 2.1e+65))) tmp = x + (a * (t + (z * b))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.5e+83], N[Not[LessEqual[b, 2.1e+65]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.5 \cdot 10^{+83} \lor \neg \left(b \leq 2.1 \cdot 10^{+65}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if b < -3.49999999999999977e83 or 2.09999999999999991e65 < b Initial program 85.3%
associate-+l+85.3%
+-commutative85.3%
*-commutative85.3%
*-commutative85.3%
associate-*l*80.4%
distribute-rgt-out87.8%
fma-def87.8%
*-commutative87.8%
+-commutative87.8%
fma-def87.8%
Simplified87.8%
Taylor expanded in y around 0 88.8%
if -3.49999999999999977e83 < b < 2.09999999999999991e65Initial program 92.0%
*-commutative92.0%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in b around 0 93.1%
Final simplification91.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.45e-64)
(* y z)
(if (<= z -2.2e-216)
x
(if (<= z 5e-258) (* t a) (if (<= z 3.4e-11) x (* y z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.45e-64) {
tmp = y * z;
} else if (z <= -2.2e-216) {
tmp = x;
} else if (z <= 5e-258) {
tmp = t * a;
} else if (z <= 3.4e-11) {
tmp = x;
} 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 (z <= (-2.45d-64)) then
tmp = y * z
else if (z <= (-2.2d-216)) then
tmp = x
else if (z <= 5d-258) then
tmp = t * a
else if (z <= 3.4d-11) then
tmp = x
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 (z <= -2.45e-64) {
tmp = y * z;
} else if (z <= -2.2e-216) {
tmp = x;
} else if (z <= 5e-258) {
tmp = t * a;
} else if (z <= 3.4e-11) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.45e-64: tmp = y * z elif z <= -2.2e-216: tmp = x elif z <= 5e-258: tmp = t * a elif z <= 3.4e-11: tmp = x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.45e-64) tmp = Float64(y * z); elseif (z <= -2.2e-216) tmp = x; elseif (z <= 5e-258) tmp = Float64(t * a); elseif (z <= 3.4e-11) tmp = x; else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.45e-64) tmp = y * z; elseif (z <= -2.2e-216) tmp = x; elseif (z <= 5e-258) tmp = t * a; elseif (z <= 3.4e-11) tmp = x; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.45e-64], N[(y * z), $MachinePrecision], If[LessEqual[z, -2.2e-216], x, If[LessEqual[z, 5e-258], N[(t * a), $MachinePrecision], If[LessEqual[z, 3.4e-11], x, N[(y * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{-64}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-216}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-258}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-11}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -2.4500000000000001e-64 or 3.3999999999999999e-11 < z Initial program 82.6%
*-commutative82.6%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in y around inf 44.7%
*-commutative44.7%
Simplified44.7%
if -2.4500000000000001e-64 < z < -2.1999999999999999e-216 or 4.9999999999999999e-258 < z < 3.3999999999999999e-11Initial program 95.7%
*-commutative95.7%
associate-*l*87.6%
Simplified87.6%
Taylor expanded in x around inf 40.2%
if -2.1999999999999999e-216 < z < 4.9999999999999999e-258Initial program 100.0%
*-commutative100.0%
associate-*l*90.9%
Simplified90.9%
Taylor expanded in t around inf 60.7%
Final simplification45.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7.5e+67) x (if (<= x 1.76e+81) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7.5e+67) {
tmp = x;
} else if (x <= 1.76e+81) {
tmp = t * a;
} 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 <= (-7.5d+67)) then
tmp = x
else if (x <= 1.76d+81) then
tmp = t * a
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 <= -7.5e+67) {
tmp = x;
} else if (x <= 1.76e+81) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7.5e+67: tmp = x elif x <= 1.76e+81: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7.5e+67) tmp = x; elseif (x <= 1.76e+81) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -7.5e+67) tmp = x; elseif (x <= 1.76e+81) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7.5e+67], x, If[LessEqual[x, 1.76e+81], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+67}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.76 \cdot 10^{+81}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.5000000000000005e67 or 1.76000000000000002e81 < x Initial program 91.6%
*-commutative91.6%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in x around inf 53.4%
if -7.5000000000000005e67 < x < 1.76000000000000002e81Initial program 88.3%
*-commutative88.3%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in t around inf 34.3%
Final simplification41.3%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 89.5%
*-commutative89.5%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in x around inf 24.4%
Final simplification24.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023271
(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)))