
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))
(t_2 (* a (+ t (* z b)))))
(if (<= t_1 (- INFINITY))
(+ (fma y z x) t_2)
(if (<= t_1 INFINITY) t_1 t_2))))
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 t_2 = a * (t + (z * b));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(y, z, x) + t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = t_2;
}
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)) t_2 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(fma(y, z, x) + t_2); elseif (t_1 <= Inf) tmp = t_1; else tmp = t_2; end return 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]}, Block[{t$95$2 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * z + x), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, t$95$2]]]]
\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\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + t_2\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < -inf.0Initial program 84.9%
associate-+l+84.9%
+-commutative84.9%
fma-def84.9%
*-commutative84.9%
*-commutative84.9%
associate-*l*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
Simplified100.0%
if -inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
*-commutative0.0%
associate-*l*23.5%
Simplified23.5%
Taylor expanded in a around inf 82.4%
Final simplification98.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))) (t_2 (+ (+ t_1 (* t a)) (* (* z a) b))))
(if (<= t_2 (- INFINITY))
(+ t_1 (+ (* z (* a b)) (* t a)))
(if (<= t_2 INFINITY) t_2 (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = (t_1 + (t * a)) + ((z * a) * b);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1 + ((z * (a * b)) + (t * a));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} 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);
double t_2 = (t_1 + (t * a)) + ((z * a) * b);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1 + ((z * (a * b)) + (t * a));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) t_2 = (t_1 + (t * a)) + ((z * a) * b) tmp = 0 if t_2 <= -math.inf: tmp = t_1 + ((z * (a * b)) + (t * a)) elif t_2 <= math.inf: tmp = t_2 else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) t_2 = Float64(Float64(t_1 + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_1 + Float64(Float64(z * Float64(a * b)) + Float64(t * a))); elseif (t_2 <= Inf) tmp = t_2; 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_2 = (t_1 + (t * a)) + ((z * a) * b); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1 + ((z * (a * b)) + (t * a)); elseif (t_2 <= Inf) tmp = t_2; else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$1 + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := \left(t_1 + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_1 + \left(z \cdot \left(a \cdot b\right) + t \cdot a\right)\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_2\\
\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 84.9%
associate-+l+84.9%
*-commutative84.9%
associate-*l*99.9%
Simplified99.9%
if -inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
*-commutative0.0%
associate-*l*23.5%
Simplified23.5%
Taylor expanded in a around inf 82.4%
Final simplification98.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= x -1.02e+53)
x
(if (<= x -1.08e-7)
(* y z)
(if (<= x -1.25e-54)
(* t a)
(if (<= x -3.1e-263)
(* y z)
(if (<= x 9e-267)
t_1
(if (<= x 2.15e-236)
(* y z)
(if (<= x 1.32e-174)
(* t a)
(if (<= x 1.05e-96) (* y z) (if (<= x 4.7e-6) 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 (x <= -1.02e+53) {
tmp = x;
} else if (x <= -1.08e-7) {
tmp = y * z;
} else if (x <= -1.25e-54) {
tmp = t * a;
} else if (x <= -3.1e-263) {
tmp = y * z;
} else if (x <= 9e-267) {
tmp = t_1;
} else if (x <= 2.15e-236) {
tmp = y * z;
} else if (x <= 1.32e-174) {
tmp = t * a;
} else if (x <= 1.05e-96) {
tmp = y * z;
} else if (x <= 4.7e-6) {
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 (x <= (-1.02d+53)) then
tmp = x
else if (x <= (-1.08d-7)) then
tmp = y * z
else if (x <= (-1.25d-54)) then
tmp = t * a
else if (x <= (-3.1d-263)) then
tmp = y * z
else if (x <= 9d-267) then
tmp = t_1
else if (x <= 2.15d-236) then
tmp = y * z
else if (x <= 1.32d-174) then
tmp = t * a
else if (x <= 1.05d-96) then
tmp = y * z
else if (x <= 4.7d-6) 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 (x <= -1.02e+53) {
tmp = x;
} else if (x <= -1.08e-7) {
tmp = y * z;
} else if (x <= -1.25e-54) {
tmp = t * a;
} else if (x <= -3.1e-263) {
tmp = y * z;
} else if (x <= 9e-267) {
tmp = t_1;
} else if (x <= 2.15e-236) {
tmp = y * z;
} else if (x <= 1.32e-174) {
tmp = t * a;
} else if (x <= 1.05e-96) {
tmp = y * z;
} else if (x <= 4.7e-6) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if x <= -1.02e+53: tmp = x elif x <= -1.08e-7: tmp = y * z elif x <= -1.25e-54: tmp = t * a elif x <= -3.1e-263: tmp = y * z elif x <= 9e-267: tmp = t_1 elif x <= 2.15e-236: tmp = y * z elif x <= 1.32e-174: tmp = t * a elif x <= 1.05e-96: tmp = y * z elif x <= 4.7e-6: 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 (x <= -1.02e+53) tmp = x; elseif (x <= -1.08e-7) tmp = Float64(y * z); elseif (x <= -1.25e-54) tmp = Float64(t * a); elseif (x <= -3.1e-263) tmp = Float64(y * z); elseif (x <= 9e-267) tmp = t_1; elseif (x <= 2.15e-236) tmp = Float64(y * z); elseif (x <= 1.32e-174) tmp = Float64(t * a); elseif (x <= 1.05e-96) tmp = Float64(y * z); elseif (x <= 4.7e-6) 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 (x <= -1.02e+53) tmp = x; elseif (x <= -1.08e-7) tmp = y * z; elseif (x <= -1.25e-54) tmp = t * a; elseif (x <= -3.1e-263) tmp = y * z; elseif (x <= 9e-267) tmp = t_1; elseif (x <= 2.15e-236) tmp = y * z; elseif (x <= 1.32e-174) tmp = t * a; elseif (x <= 1.05e-96) tmp = y * z; elseif (x <= 4.7e-6) 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[x, -1.02e+53], x, If[LessEqual[x, -1.08e-7], N[(y * z), $MachinePrecision], If[LessEqual[x, -1.25e-54], N[(t * a), $MachinePrecision], If[LessEqual[x, -3.1e-263], N[(y * z), $MachinePrecision], If[LessEqual[x, 9e-267], t$95$1, If[LessEqual[x, 2.15e-236], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.32e-174], N[(t * a), $MachinePrecision], If[LessEqual[x, 1.05e-96], N[(y * z), $MachinePrecision], If[LessEqual[x, 4.7e-6], t$95$1, x]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.08 \cdot 10^{-7}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-54}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{-263}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-267}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-236}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{-174}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-96}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.01999999999999999e53 or 4.69999999999999989e-6 < x Initial program 90.5%
associate-+l+90.5%
*-commutative90.5%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 54.7%
if -1.01999999999999999e53 < x < -1.08000000000000001e-7 or -1.25000000000000004e-54 < x < -3.10000000000000004e-263 or 8.9999999999999999e-267 < x < 2.14999999999999986e-236 or 1.31999999999999999e-174 < x < 1.05000000000000001e-96Initial program 89.8%
associate-+l+89.8%
*-commutative89.8%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in y around inf 54.7%
*-commutative54.7%
Simplified54.7%
if -1.08000000000000001e-7 < x < -1.25000000000000004e-54 or 2.14999999999999986e-236 < x < 1.31999999999999999e-174Initial program 95.6%
associate-+l+95.6%
*-commutative95.6%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in t around inf 56.8%
if -3.10000000000000004e-263 < x < 8.9999999999999999e-267 or 1.05000000000000001e-96 < x < 4.69999999999999989e-6Initial program 95.2%
associate-+l+95.2%
*-commutative95.2%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around inf 78.9%
Taylor expanded in t around 0 49.3%
Final simplification54.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -3e+53)
x
(if (<= x -2.5e-5)
(* y z)
(if (<= x -1.25e-54)
(* t a)
(if (<= x -2e-263)
(* y z)
(if (<= x 8.5e-267)
(* a (* z b))
(if (<= x 5.5e-237)
(* y z)
(if (<= x 1.75e-172)
(* t a)
(if (<= x 3.8e-95)
(* y z)
(if (<= x 1.86e-6) (* z (* a b)) x))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3e+53) {
tmp = x;
} else if (x <= -2.5e-5) {
tmp = y * z;
} else if (x <= -1.25e-54) {
tmp = t * a;
} else if (x <= -2e-263) {
tmp = y * z;
} else if (x <= 8.5e-267) {
tmp = a * (z * b);
} else if (x <= 5.5e-237) {
tmp = y * z;
} else if (x <= 1.75e-172) {
tmp = t * a;
} else if (x <= 3.8e-95) {
tmp = y * z;
} else if (x <= 1.86e-6) {
tmp = z * (a * b);
} 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 <= (-3d+53)) then
tmp = x
else if (x <= (-2.5d-5)) then
tmp = y * z
else if (x <= (-1.25d-54)) then
tmp = t * a
else if (x <= (-2d-263)) then
tmp = y * z
else if (x <= 8.5d-267) then
tmp = a * (z * b)
else if (x <= 5.5d-237) then
tmp = y * z
else if (x <= 1.75d-172) then
tmp = t * a
else if (x <= 3.8d-95) then
tmp = y * z
else if (x <= 1.86d-6) then
tmp = z * (a * b)
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 <= -3e+53) {
tmp = x;
} else if (x <= -2.5e-5) {
tmp = y * z;
} else if (x <= -1.25e-54) {
tmp = t * a;
} else if (x <= -2e-263) {
tmp = y * z;
} else if (x <= 8.5e-267) {
tmp = a * (z * b);
} else if (x <= 5.5e-237) {
tmp = y * z;
} else if (x <= 1.75e-172) {
tmp = t * a;
} else if (x <= 3.8e-95) {
tmp = y * z;
} else if (x <= 1.86e-6) {
tmp = z * (a * b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3e+53: tmp = x elif x <= -2.5e-5: tmp = y * z elif x <= -1.25e-54: tmp = t * a elif x <= -2e-263: tmp = y * z elif x <= 8.5e-267: tmp = a * (z * b) elif x <= 5.5e-237: tmp = y * z elif x <= 1.75e-172: tmp = t * a elif x <= 3.8e-95: tmp = y * z elif x <= 1.86e-6: tmp = z * (a * b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3e+53) tmp = x; elseif (x <= -2.5e-5) tmp = Float64(y * z); elseif (x <= -1.25e-54) tmp = Float64(t * a); elseif (x <= -2e-263) tmp = Float64(y * z); elseif (x <= 8.5e-267) tmp = Float64(a * Float64(z * b)); elseif (x <= 5.5e-237) tmp = Float64(y * z); elseif (x <= 1.75e-172) tmp = Float64(t * a); elseif (x <= 3.8e-95) tmp = Float64(y * z); elseif (x <= 1.86e-6) tmp = Float64(z * Float64(a * b)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -3e+53) tmp = x; elseif (x <= -2.5e-5) tmp = y * z; elseif (x <= -1.25e-54) tmp = t * a; elseif (x <= -2e-263) tmp = y * z; elseif (x <= 8.5e-267) tmp = a * (z * b); elseif (x <= 5.5e-237) tmp = y * z; elseif (x <= 1.75e-172) tmp = t * a; elseif (x <= 3.8e-95) tmp = y * z; elseif (x <= 1.86e-6) tmp = z * (a * b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3e+53], x, If[LessEqual[x, -2.5e-5], N[(y * z), $MachinePrecision], If[LessEqual[x, -1.25e-54], N[(t * a), $MachinePrecision], If[LessEqual[x, -2e-263], N[(y * z), $MachinePrecision], If[LessEqual[x, 8.5e-267], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e-237], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.75e-172], N[(t * a), $MachinePrecision], If[LessEqual[x, 3.8e-95], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.86e-6], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], x]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-5}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-54}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-263}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-267}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-237}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-172}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-95}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.86 \cdot 10^{-6}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.99999999999999998e53 or 1.86e-6 < x Initial program 90.5%
associate-+l+90.5%
*-commutative90.5%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 54.7%
if -2.99999999999999998e53 < x < -2.50000000000000012e-5 or -1.25000000000000004e-54 < x < -2e-263 or 8.49999999999999987e-267 < x < 5.49999999999999981e-237 or 1.75000000000000014e-172 < x < 3.7999999999999997e-95Initial program 89.8%
associate-+l+89.8%
*-commutative89.8%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in y around inf 54.7%
*-commutative54.7%
Simplified54.7%
if -2.50000000000000012e-5 < x < -1.25000000000000004e-54 or 5.49999999999999981e-237 < x < 1.75000000000000014e-172Initial program 95.6%
associate-+l+95.6%
*-commutative95.6%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in t around inf 56.8%
if -2e-263 < x < 8.49999999999999987e-267Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in a around inf 85.9%
Taylor expanded in t around 0 47.0%
if 3.7999999999999997e-95 < x < 1.86e-6Initial program 89.9%
associate-+l+89.9%
*-commutative89.9%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in a around inf 71.1%
Taylor expanded in t around 0 51.9%
expm1-log1p-u31.1%
expm1-udef31.2%
sub-neg31.2%
metadata-eval31.2%
Applied egg-rr31.2%
metadata-eval31.2%
sub-neg31.2%
expm1-def31.1%
expm1-log1p51.9%
associate-*r*61.6%
*-commutative61.6%
Simplified61.6%
Final simplification54.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))) (t_2 (* a (+ t (* z b)))))
(if (<= a -3.8e-87)
t_2
(if (<= a 5500000000.0)
t_1
(if (<= a 3.15e+115)
t_2
(if (<= a 5.5e+126) t_1 (if (<= a 1.8e+163) (+ x (* t a)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -3.8e-87) {
tmp = t_2;
} else if (a <= 5500000000.0) {
tmp = t_1;
} else if (a <= 3.15e+115) {
tmp = t_2;
} else if (a <= 5.5e+126) {
tmp = t_1;
} else if (a <= 1.8e+163) {
tmp = x + (t * a);
} 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 + (y * z)
t_2 = a * (t + (z * b))
if (a <= (-3.8d-87)) then
tmp = t_2
else if (a <= 5500000000.0d0) then
tmp = t_1
else if (a <= 3.15d+115) then
tmp = t_2
else if (a <= 5.5d+126) then
tmp = t_1
else if (a <= 1.8d+163) then
tmp = x + (t * a)
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 + (y * z);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -3.8e-87) {
tmp = t_2;
} else if (a <= 5500000000.0) {
tmp = t_1;
} else if (a <= 3.15e+115) {
tmp = t_2;
} else if (a <= 5.5e+126) {
tmp = t_1;
} else if (a <= 1.8e+163) {
tmp = x + (t * a);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) t_2 = a * (t + (z * b)) tmp = 0 if a <= -3.8e-87: tmp = t_2 elif a <= 5500000000.0: tmp = t_1 elif a <= 3.15e+115: tmp = t_2 elif a <= 5.5e+126: tmp = t_1 elif a <= 1.8e+163: tmp = x + (t * a) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) t_2 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -3.8e-87) tmp = t_2; elseif (a <= 5500000000.0) tmp = t_1; elseif (a <= 3.15e+115) tmp = t_2; elseif (a <= 5.5e+126) tmp = t_1; elseif (a <= 1.8e+163) tmp = Float64(x + Float64(t * a)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); t_2 = a * (t + (z * b)); tmp = 0.0; if (a <= -3.8e-87) tmp = t_2; elseif (a <= 5500000000.0) tmp = t_1; elseif (a <= 3.15e+115) tmp = t_2; elseif (a <= 5.5e+126) tmp = t_1; elseif (a <= 1.8e+163) tmp = x + (t * a); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.8e-87], t$95$2, If[LessEqual[a, 5500000000.0], t$95$1, If[LessEqual[a, 3.15e+115], t$95$2, If[LessEqual[a, 5.5e+126], t$95$1, If[LessEqual[a, 1.8e+163], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{-87}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 5500000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 3.15 \cdot 10^{+115}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+163}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -3.8e-87 or 5.5e9 < a < 3.1499999999999998e115 or 1.79999999999999989e163 < a Initial program 84.5%
associate-+l+84.5%
*-commutative84.5%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in a around inf 72.4%
if -3.8e-87 < a < 5.5e9 or 3.1499999999999998e115 < a < 5.5000000000000004e126Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 83.6%
if 5.5000000000000004e126 < a < 1.79999999999999989e163Initial program 88.9%
associate-+l+88.9%
*-commutative88.9%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in z around 0 78.6%
+-commutative78.6%
Simplified78.6%
Final simplification77.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -9.2e+191) (+ x (* z (+ y (* a b)))) (+ (+ x (* y z)) (+ (* z (* a b)) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -9.2e+191) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (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 (y <= (-9.2d+191)) then
tmp = x + (z * (y + (a * b)))
else
tmp = (x + (y * z)) + ((z * (a * b)) + (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 (y <= -9.2e+191) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -9.2e+191: tmp = x + (z * (y + (a * b))) else: tmp = (x + (y * z)) + ((z * (a * b)) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -9.2e+191) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(z * Float64(a * b)) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -9.2e+191) tmp = x + (z * (y + (a * b))); else tmp = (x + (y * z)) + ((z * (a * b)) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9.2e+191], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+191}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(z \cdot \left(a \cdot b\right) + t \cdot a\right)\\
\end{array}
\end{array}
if y < -9.1999999999999997e191Initial program 71.4%
associate-+l+71.4%
*-commutative71.4%
associate-*l*66.9%
Simplified66.9%
Taylor expanded in t around 0 71.4%
associate-*r*71.7%
distribute-rgt-in95.5%
+-commutative95.5%
Simplified95.5%
if -9.1999999999999997e191 < y Initial program 93.3%
associate-+l+93.3%
*-commutative93.3%
associate-*l*95.0%
Simplified95.0%
Final simplification95.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.32e+54)
x
(if (<= x -2.2e-7)
(* y z)
(if (<= x -1.25e-54)
(* t a)
(if (<= x -1.85e-269)
(* y z)
(if (<= x 4.5e-174) (* t a) (if (<= x 0.00062) (* y z) x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.32e+54) {
tmp = x;
} else if (x <= -2.2e-7) {
tmp = y * z;
} else if (x <= -1.25e-54) {
tmp = t * a;
} else if (x <= -1.85e-269) {
tmp = y * z;
} else if (x <= 4.5e-174) {
tmp = t * a;
} else if (x <= 0.00062) {
tmp = y * z;
} 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 <= (-1.32d+54)) then
tmp = x
else if (x <= (-2.2d-7)) then
tmp = y * z
else if (x <= (-1.25d-54)) then
tmp = t * a
else if (x <= (-1.85d-269)) then
tmp = y * z
else if (x <= 4.5d-174) then
tmp = t * a
else if (x <= 0.00062d0) then
tmp = y * z
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 <= -1.32e+54) {
tmp = x;
} else if (x <= -2.2e-7) {
tmp = y * z;
} else if (x <= -1.25e-54) {
tmp = t * a;
} else if (x <= -1.85e-269) {
tmp = y * z;
} else if (x <= 4.5e-174) {
tmp = t * a;
} else if (x <= 0.00062) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.32e+54: tmp = x elif x <= -2.2e-7: tmp = y * z elif x <= -1.25e-54: tmp = t * a elif x <= -1.85e-269: tmp = y * z elif x <= 4.5e-174: tmp = t * a elif x <= 0.00062: tmp = y * z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.32e+54) tmp = x; elseif (x <= -2.2e-7) tmp = Float64(y * z); elseif (x <= -1.25e-54) tmp = Float64(t * a); elseif (x <= -1.85e-269) tmp = Float64(y * z); elseif (x <= 4.5e-174) tmp = Float64(t * a); elseif (x <= 0.00062) tmp = Float64(y * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.32e+54) tmp = x; elseif (x <= -2.2e-7) tmp = y * z; elseif (x <= -1.25e-54) tmp = t * a; elseif (x <= -1.85e-269) tmp = y * z; elseif (x <= 4.5e-174) tmp = t * a; elseif (x <= 0.00062) tmp = y * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.32e+54], x, If[LessEqual[x, -2.2e-7], N[(y * z), $MachinePrecision], If[LessEqual[x, -1.25e-54], N[(t * a), $MachinePrecision], If[LessEqual[x, -1.85e-269], N[(y * z), $MachinePrecision], If[LessEqual[x, 4.5e-174], N[(t * a), $MachinePrecision], If[LessEqual[x, 0.00062], N[(y * z), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{+54}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-7}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-54}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-269}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-174}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 0.00062:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.3200000000000001e54 or 6.2e-4 < x Initial program 90.4%
associate-+l+90.4%
*-commutative90.4%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in x around inf 55.2%
if -1.3200000000000001e54 < x < -2.2000000000000001e-7 or -1.25000000000000004e-54 < x < -1.84999999999999989e-269 or 4.49999999999999964e-174 < x < 6.2e-4Initial program 89.2%
associate-+l+89.2%
*-commutative89.2%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in y around inf 45.3%
*-commutative45.3%
Simplified45.3%
if -2.2000000000000001e-7 < x < -1.25000000000000004e-54 or -1.84999999999999989e-269 < x < 4.49999999999999964e-174Initial program 98.0%
associate-+l+98.0%
*-commutative98.0%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in t around inf 44.8%
Final simplification49.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))) (t_2 (* z (* a b))))
(if (<= b -2.4e+209)
t_2
(if (<= b -3.4e-275)
t_1
(if (<= b 1.3e-218) (* t a) (if (<= b 1.9e+232) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = z * (a * b);
double tmp;
if (b <= -2.4e+209) {
tmp = t_2;
} else if (b <= -3.4e-275) {
tmp = t_1;
} else if (b <= 1.3e-218) {
tmp = t * a;
} else if (b <= 1.9e+232) {
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 + (y * z)
t_2 = z * (a * b)
if (b <= (-2.4d+209)) then
tmp = t_2
else if (b <= (-3.4d-275)) then
tmp = t_1
else if (b <= 1.3d-218) then
tmp = t * a
else if (b <= 1.9d+232) 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 + (y * z);
double t_2 = z * (a * b);
double tmp;
if (b <= -2.4e+209) {
tmp = t_2;
} else if (b <= -3.4e-275) {
tmp = t_1;
} else if (b <= 1.3e-218) {
tmp = t * a;
} else if (b <= 1.9e+232) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) t_2 = z * (a * b) tmp = 0 if b <= -2.4e+209: tmp = t_2 elif b <= -3.4e-275: tmp = t_1 elif b <= 1.3e-218: tmp = t * a elif b <= 1.9e+232: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) t_2 = Float64(z * Float64(a * b)) tmp = 0.0 if (b <= -2.4e+209) tmp = t_2; elseif (b <= -3.4e-275) tmp = t_1; elseif (b <= 1.3e-218) tmp = Float64(t * a); elseif (b <= 1.9e+232) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); t_2 = z * (a * b); tmp = 0.0; if (b <= -2.4e+209) tmp = t_2; elseif (b <= -3.4e-275) tmp = t_1; elseif (b <= 1.3e-218) tmp = t * a; elseif (b <= 1.9e+232) 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[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.4e+209], t$95$2, If[LessEqual[b, -3.4e-275], t$95$1, If[LessEqual[b, 1.3e-218], N[(t * a), $MachinePrecision], If[LessEqual[b, 1.9e+232], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -2.4 \cdot 10^{+209}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -3.4 \cdot 10^{-275}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{-218}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{+232}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -2.39999999999999996e209 or 1.9e232 < b Initial program 84.7%
associate-+l+84.7%
*-commutative84.7%
associate-*l*76.4%
Simplified76.4%
Taylor expanded in a around inf 91.4%
Taylor expanded in t around 0 77.0%
expm1-log1p-u38.3%
expm1-udef38.3%
sub-neg38.3%
metadata-eval38.3%
Applied egg-rr38.3%
metadata-eval38.3%
sub-neg38.3%
expm1-def38.3%
expm1-log1p77.0%
associate-*r*80.0%
*-commutative80.0%
Simplified80.0%
if -2.39999999999999996e209 < b < -3.39999999999999968e-275 or 1.29999999999999992e-218 < b < 1.9e232Initial program 93.6%
associate-+l+93.6%
*-commutative93.6%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around 0 65.4%
if -3.39999999999999968e-275 < b < 1.29999999999999992e-218Initial program 84.0%
associate-+l+84.0%
*-commutative84.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 64.2%
Final simplification67.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3e-105) (not (<= z 4.2e-246))) (+ x (* 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 <= -3e-105) || !(z <= 4.2e-246)) {
tmp = x + (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 <= (-3d-105)) .or. (.not. (z <= 4.2d-246))) then
tmp = x + (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 <= -3e-105) || !(z <= 4.2e-246)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3e-105) or not (z <= 4.2e-246): tmp = x + (z * (y + (a * b))) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3e-105) || !(z <= 4.2e-246)) tmp = Float64(x + 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 <= -3e-105) || ~((z <= 4.2e-246))) tmp = x + (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, -3e-105], N[Not[LessEqual[z, 4.2e-246]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-105} \lor \neg \left(z \leq 4.2 \cdot 10^{-246}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -3.0000000000000001e-105 or 4.19999999999999989e-246 < z Initial program 89.5%
associate-+l+89.5%
*-commutative89.5%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in t around 0 74.7%
associate-*r*77.9%
distribute-rgt-in82.8%
+-commutative82.8%
Simplified82.8%
if -3.0000000000000001e-105 < z < 4.19999999999999989e-246Initial program 99.9%
associate-+l+99.9%
*-commutative99.9%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in z around 0 84.5%
+-commutative84.5%
Simplified84.5%
Final simplification83.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5.9e+72) (not (<= t 8.2e+15))) (+ x (+ (* t a) (* y z))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.9e+72) || !(t <= 8.2e+15)) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-5.9d+72)) .or. (.not. (t <= 8.2d+15))) then
tmp = x + ((t * a) + (y * z))
else
tmp = x + (z * (y + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.9e+72) || !(t <= 8.2e+15)) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -5.9e+72) or not (t <= 8.2e+15): tmp = x + ((t * a) + (y * z)) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5.9e+72) || !(t <= 8.2e+15)) tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); else tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -5.9e+72) || ~((t <= 8.2e+15))) tmp = x + ((t * a) + (y * z)); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5.9e+72], N[Not[LessEqual[t, 8.2e+15]], $MachinePrecision]], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.9 \cdot 10^{+72} \lor \neg \left(t \leq 8.2 \cdot 10^{+15}\right):\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if t < -5.9000000000000002e72 or 8.2e15 < t Initial program 91.4%
associate-+l+91.4%
*-commutative91.4%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in b around 0 91.3%
if -5.9000000000000002e72 < t < 8.2e15Initial program 91.6%
associate-+l+91.6%
*-commutative91.6%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in t around 0 86.2%
associate-*r*85.6%
distribute-rgt-in90.2%
+-commutative90.2%
Simplified90.2%
Final simplification90.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.3e-51) (not (<= t 15500000000.0))) (+ x (* t a)) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.3e-51) || !(t <= 15500000000.0)) {
tmp = x + (t * a);
} 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 ((t <= (-3.3d-51)) .or. (.not. (t <= 15500000000.0d0))) then
tmp = x + (t * a)
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 ((t <= -3.3e-51) || !(t <= 15500000000.0)) {
tmp = x + (t * a);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.3e-51) or not (t <= 15500000000.0): tmp = x + (t * a) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.3e-51) || !(t <= 15500000000.0)) tmp = Float64(x + Float64(t * a)); 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 ((t <= -3.3e-51) || ~((t <= 15500000000.0))) tmp = x + (t * a); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.3e-51], N[Not[LessEqual[t, 15500000000.0]], $MachinePrecision]], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{-51} \lor \neg \left(t \leq 15500000000\right):\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if t < -3.29999999999999973e-51 or 1.55e10 < t Initial program 91.1%
associate-+l+91.1%
*-commutative91.1%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in z around 0 68.5%
+-commutative68.5%
Simplified68.5%
if -3.29999999999999973e-51 < t < 1.55e10Initial program 92.0%
associate-+l+92.0%
*-commutative92.0%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in a around 0 64.6%
Final simplification66.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.5e+32) x (if (<= x 6.6e-39) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.5e+32) {
tmp = x;
} else if (x <= 6.6e-39) {
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 <= (-2.5d+32)) then
tmp = x
else if (x <= 6.6d-39) 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 <= -2.5e+32) {
tmp = x;
} else if (x <= 6.6e-39) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.5e+32: tmp = x elif x <= 6.6e-39: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.5e+32) tmp = x; elseif (x <= 6.6e-39) 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 <= -2.5e+32) tmp = x; elseif (x <= 6.6e-39) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.5e+32], x, If[LessEqual[x, 6.6e-39], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-39}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.4999999999999999e32 or 6.5999999999999997e-39 < x Initial program 90.6%
associate-+l+90.6%
*-commutative90.6%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in x around inf 51.3%
if -2.4999999999999999e32 < x < 6.5999999999999997e-39Initial program 92.4%
associate-+l+92.4%
*-commutative92.4%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in t around inf 34.9%
Final simplification43.0%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 91.5%
associate-+l+91.5%
*-commutative91.5%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in x around inf 29.3%
Final simplification29.3%
(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 2023301
(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)))