
(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 16 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))))
(if (<= t_1 5e+146)
(+ (fma y z x) (* a (+ t (* z b))))
(if (<= t_1 INFINITY) t_1 (* z (+ y (+ (/ x z) (* a (+ b (/ t z))))))))))
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 <= 5e+146) {
tmp = fma(y, z, x) + (a * (t + (z * b)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
}
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 <= 5e+146) tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); 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]}, If[LessEqual[t$95$1, 5e+146], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 5 \cdot 10^{+146}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 4.9999999999999999e146Initial program 96.9%
associate-+l+96.9%
+-commutative96.9%
fma-define96.9%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-in100.0%
remove-double-neg100.0%
Simplified100.0%
if 4.9999999999999999e146 < (+.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%
associate-*l*15.4%
Simplified15.4%
Taylor expanded in z around inf 69.2%
+-commutative69.2%
associate-+l+69.2%
+-commutative69.2%
associate-/l*92.3%
distribute-lft-out100.0%
Simplified100.0%
Final simplification100.0%
(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 (+ (* t a) (* a (* z b))))
(if (<= t_2 INFINITY) t_2 (* z (+ y (+ (/ x z) (* a (+ b (/ t z))))))))))
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 + ((t * a) + (a * (z * b)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
}
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 + ((t * a) + (a * (z * b)));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
}
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 + ((t * a) + (a * (z * b))) elif t_2 <= math.inf: tmp = t_2 else: tmp = z * (y + ((x / z) + (a * (b + (t / z))))) 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(t * a) + Float64(a * Float64(z * b)))); elseif (t_2 <= Inf) tmp = t_2; else tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); 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 + ((t * a) + (a * (z * b))); elseif (t_2 <= Inf) tmp = t_2; else tmp = z * (y + ((x / z) + (a * (b + (t / z))))); 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[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < -inf.0Initial program 86.8%
associate-+l+86.8%
associate-*l*100.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%
associate-*l*15.4%
Simplified15.4%
Taylor expanded in z around inf 69.2%
+-commutative69.2%
associate-+l+69.2%
+-commutative69.2%
associate-/l*92.3%
distribute-lft-out100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* z a) b)))
(if (<= z -1.7e+85)
t_1
(if (<= z -5.2e+51)
(* y z)
(if (<= z -5e-55)
t_1
(if (<= z -2.9e-143)
x
(if (<= z 2.5e-243)
(* t a)
(if (<= z 5.2e+87)
x
(if (<= z 1.1e+248) (* y z) (* a (* z b)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * a) * b;
double tmp;
if (z <= -1.7e+85) {
tmp = t_1;
} else if (z <= -5.2e+51) {
tmp = y * z;
} else if (z <= -5e-55) {
tmp = t_1;
} else if (z <= -2.9e-143) {
tmp = x;
} else if (z <= 2.5e-243) {
tmp = t * a;
} else if (z <= 5.2e+87) {
tmp = x;
} else if (z <= 1.1e+248) {
tmp = y * z;
} else {
tmp = a * (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) :: t_1
real(8) :: tmp
t_1 = (z * a) * b
if (z <= (-1.7d+85)) then
tmp = t_1
else if (z <= (-5.2d+51)) then
tmp = y * z
else if (z <= (-5d-55)) then
tmp = t_1
else if (z <= (-2.9d-143)) then
tmp = x
else if (z <= 2.5d-243) then
tmp = t * a
else if (z <= 5.2d+87) then
tmp = x
else if (z <= 1.1d+248) then
tmp = y * z
else
tmp = a * (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 t_1 = (z * a) * b;
double tmp;
if (z <= -1.7e+85) {
tmp = t_1;
} else if (z <= -5.2e+51) {
tmp = y * z;
} else if (z <= -5e-55) {
tmp = t_1;
} else if (z <= -2.9e-143) {
tmp = x;
} else if (z <= 2.5e-243) {
tmp = t * a;
} else if (z <= 5.2e+87) {
tmp = x;
} else if (z <= 1.1e+248) {
tmp = y * z;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * a) * b tmp = 0 if z <= -1.7e+85: tmp = t_1 elif z <= -5.2e+51: tmp = y * z elif z <= -5e-55: tmp = t_1 elif z <= -2.9e-143: tmp = x elif z <= 2.5e-243: tmp = t * a elif z <= 5.2e+87: tmp = x elif z <= 1.1e+248: tmp = y * z else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * a) * b) tmp = 0.0 if (z <= -1.7e+85) tmp = t_1; elseif (z <= -5.2e+51) tmp = Float64(y * z); elseif (z <= -5e-55) tmp = t_1; elseif (z <= -2.9e-143) tmp = x; elseif (z <= 2.5e-243) tmp = Float64(t * a); elseif (z <= 5.2e+87) tmp = x; elseif (z <= 1.1e+248) tmp = Float64(y * z); else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * a) * b; tmp = 0.0; if (z <= -1.7e+85) tmp = t_1; elseif (z <= -5.2e+51) tmp = y * z; elseif (z <= -5e-55) tmp = t_1; elseif (z <= -2.9e-143) tmp = x; elseif (z <= 2.5e-243) tmp = t * a; elseif (z <= 5.2e+87) tmp = x; elseif (z <= 1.1e+248) tmp = y * z; else tmp = a * (z * b); 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[z, -1.7e+85], t$95$1, If[LessEqual[z, -5.2e+51], N[(y * z), $MachinePrecision], If[LessEqual[z, -5e-55], t$95$1, If[LessEqual[z, -2.9e-143], x, If[LessEqual[z, 2.5e-243], N[(t * a), $MachinePrecision], If[LessEqual[z, 5.2e+87], x, If[LessEqual[z, 1.1e+248], N[(y * z), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{+51}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-143}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-243}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+87}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+248}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if z < -1.7000000000000002e85 or -5.2000000000000002e51 < z < -5.0000000000000002e-55Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
fma-define86.1%
associate-*l*83.3%
*-commutative83.3%
*-commutative83.3%
distribute-rgt-out86.4%
remove-double-neg86.4%
*-commutative86.4%
distribute-lft-neg-out86.4%
sub-neg86.4%
sub-neg86.4%
distribute-lft-neg-in86.4%
remove-double-neg86.4%
Simplified86.4%
Taylor expanded in y around inf 82.2%
Taylor expanded in b around inf 46.8%
associate-*r*46.9%
*-commutative46.9%
associate-*r*51.2%
Simplified51.2%
if -1.7000000000000002e85 < z < -5.2000000000000002e51 or 5.19999999999999997e87 < z < 1.1e248Initial program 89.0%
associate-+l+89.0%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in y around inf 61.5%
*-commutative61.5%
Simplified61.5%
if -5.0000000000000002e-55 < z < -2.9000000000000001e-143 or 2.5e-243 < z < 5.19999999999999997e87Initial program 96.7%
associate-+l+96.7%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in x around inf 47.4%
if -2.9000000000000001e-143 < z < 2.5e-243Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 53.0%
if 1.1e248 < z Initial program 90.0%
associate-+l+90.0%
+-commutative90.0%
fma-define90.0%
associate-*l*89.8%
*-commutative89.8%
*-commutative89.8%
distribute-rgt-out89.8%
remove-double-neg89.8%
*-commutative89.8%
distribute-lft-neg-out89.8%
sub-neg89.8%
sub-neg89.8%
distribute-lft-neg-in89.8%
remove-double-neg89.8%
Simplified89.8%
Taylor expanded in y around inf 89.8%
Taylor expanded in b around inf 92.9%
Final simplification53.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -1.5e+136)
t_1
(if (<= a -7.2e-55)
(* z (+ y (* a b)))
(if (or (<= a 6e-129) (and (not (<= a 7.6e-57)) (<= a 3.05e+32)))
(+ x (* y z))
t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -1.5e+136) {
tmp = t_1;
} else if (a <= -7.2e-55) {
tmp = z * (y + (a * b));
} else if ((a <= 6e-129) || (!(a <= 7.6e-57) && (a <= 3.05e+32))) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if (a <= (-1.5d+136)) then
tmp = t_1
else if (a <= (-7.2d-55)) then
tmp = z * (y + (a * b))
else if ((a <= 6d-129) .or. (.not. (a <= 7.6d-57)) .and. (a <= 3.05d+32)) then
tmp = x + (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -1.5e+136) {
tmp = t_1;
} else if (a <= -7.2e-55) {
tmp = z * (y + (a * b));
} else if ((a <= 6e-129) || (!(a <= 7.6e-57) && (a <= 3.05e+32))) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -1.5e+136: tmp = t_1 elif a <= -7.2e-55: tmp = z * (y + (a * b)) elif (a <= 6e-129) or (not (a <= 7.6e-57) and (a <= 3.05e+32)): tmp = x + (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -1.5e+136) tmp = t_1; elseif (a <= -7.2e-55) tmp = Float64(z * Float64(y + Float64(a * b))); elseif ((a <= 6e-129) || (!(a <= 7.6e-57) && (a <= 3.05e+32))) tmp = Float64(x + Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -1.5e+136) tmp = t_1; elseif (a <= -7.2e-55) tmp = z * (y + (a * b)); elseif ((a <= 6e-129) || (~((a <= 7.6e-57)) && (a <= 3.05e+32))) tmp = x + (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.5e+136], t$95$1, If[LessEqual[a, -7.2e-55], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 6e-129], And[N[Not[LessEqual[a, 7.6e-57]], $MachinePrecision], LessEqual[a, 3.05e+32]]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.5 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -7.2 \cdot 10^{-55}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-129} \lor \neg \left(a \leq 7.6 \cdot 10^{-57}\right) \land a \leq 3.05 \cdot 10^{+32}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.49999999999999989e136 or 5.9999999999999996e-129 < a < 7.5999999999999995e-57 or 3.05000000000000014e32 < a Initial program 85.3%
associate-+l+85.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in a around inf 76.5%
if -1.49999999999999989e136 < a < -7.2000000000000001e-55Initial program 96.9%
associate-+l+96.9%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in z around inf 77.9%
if -7.2000000000000001e-55 < a < 5.9999999999999996e-129 or 7.5999999999999995e-57 < a < 3.05000000000000014e32Initial program 100.0%
associate-+l+100.0%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in a around 0 81.9%
Final simplification78.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -4e+97)
(* y z)
(if (<= y -7.8e+49)
(* t a)
(if (<= y -1.12e-132)
x
(if (<= y -7.2e-235) (* t a) (if (<= y 6.1e+22) x (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4e+97) {
tmp = y * z;
} else if (y <= -7.8e+49) {
tmp = t * a;
} else if (y <= -1.12e-132) {
tmp = x;
} else if (y <= -7.2e-235) {
tmp = t * a;
} else if (y <= 6.1e+22) {
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 (y <= (-4d+97)) then
tmp = y * z
else if (y <= (-7.8d+49)) then
tmp = t * a
else if (y <= (-1.12d-132)) then
tmp = x
else if (y <= (-7.2d-235)) then
tmp = t * a
else if (y <= 6.1d+22) 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 (y <= -4e+97) {
tmp = y * z;
} else if (y <= -7.8e+49) {
tmp = t * a;
} else if (y <= -1.12e-132) {
tmp = x;
} else if (y <= -7.2e-235) {
tmp = t * a;
} else if (y <= 6.1e+22) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4e+97: tmp = y * z elif y <= -7.8e+49: tmp = t * a elif y <= -1.12e-132: tmp = x elif y <= -7.2e-235: tmp = t * a elif y <= 6.1e+22: tmp = x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4e+97) tmp = Float64(y * z); elseif (y <= -7.8e+49) tmp = Float64(t * a); elseif (y <= -1.12e-132) tmp = x; elseif (y <= -7.2e-235) tmp = Float64(t * a); elseif (y <= 6.1e+22) 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 (y <= -4e+97) tmp = y * z; elseif (y <= -7.8e+49) tmp = t * a; elseif (y <= -1.12e-132) tmp = x; elseif (y <= -7.2e-235) tmp = t * a; elseif (y <= 6.1e+22) tmp = x; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4e+97], N[(y * z), $MachinePrecision], If[LessEqual[y, -7.8e+49], N[(t * a), $MachinePrecision], If[LessEqual[y, -1.12e-132], x, If[LessEqual[y, -7.2e-235], N[(t * a), $MachinePrecision], If[LessEqual[y, 6.1e+22], x, N[(y * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+97}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -7.8 \cdot 10^{+49}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;y \leq -1.12 \cdot 10^{-132}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{-235}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;y \leq 6.1 \cdot 10^{+22}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -4.0000000000000003e97 or 6.0999999999999998e22 < y Initial program 90.7%
associate-+l+90.7%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in y around inf 53.5%
*-commutative53.5%
Simplified53.5%
if -4.0000000000000003e97 < y < -7.8000000000000002e49 or -1.1199999999999999e-132 < y < -7.19999999999999998e-235Initial program 92.3%
associate-+l+92.3%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in t around inf 52.9%
if -7.8000000000000002e49 < y < -1.1199999999999999e-132 or -7.19999999999999998e-235 < y < 6.0999999999999998e22Initial program 96.0%
associate-+l+96.0%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in x around inf 41.7%
Final simplification48.9%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -2.4e+63)
(not (or (<= a 6e-129) (and (not (<= a 1.65e-56)) (<= a 4.5e+33)))))
(* 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 <= -2.4e+63) || !((a <= 6e-129) || (!(a <= 1.65e-56) && (a <= 4.5e+33)))) {
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 <= (-2.4d+63)) .or. (.not. (a <= 6d-129) .or. (.not. (a <= 1.65d-56)) .and. (a <= 4.5d+33))) 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 <= -2.4e+63) || !((a <= 6e-129) || (!(a <= 1.65e-56) && (a <= 4.5e+33)))) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.4e+63) or not ((a <= 6e-129) or (not (a <= 1.65e-56) and (a <= 4.5e+33))): 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 <= -2.4e+63) || !((a <= 6e-129) || (!(a <= 1.65e-56) && (a <= 4.5e+33)))) 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 <= -2.4e+63) || ~(((a <= 6e-129) || (~((a <= 1.65e-56)) && (a <= 4.5e+33))))) 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, -2.4e+63], N[Not[Or[LessEqual[a, 6e-129], And[N[Not[LessEqual[a, 1.65e-56]], $MachinePrecision], LessEqual[a, 4.5e+33]]]], $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 -2.4 \cdot 10^{+63} \lor \neg \left(a \leq 6 \cdot 10^{-129} \lor \neg \left(a \leq 1.65 \cdot 10^{-56}\right) \land a \leq 4.5 \cdot 10^{+33}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -2.4e63 or 5.9999999999999996e-129 < a < 1.64999999999999992e-56 or 4.5e33 < a Initial program 86.5%
associate-+l+86.5%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in a around inf 76.8%
if -2.4e63 < a < 5.9999999999999996e-129 or 1.64999999999999992e-56 < a < 4.5e33Initial program 99.2%
associate-+l+99.2%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in a around 0 77.6%
Final simplification77.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -500000000000.0) (not (<= z 4.5e+67))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ (+ x (* y z)) (+ (* t a) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -500000000000.0) || !(z <= 4.5e+67)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (y * z)) + ((t * a) + (a * (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 <= (-500000000000.0d0)) .or. (.not. (z <= 4.5d+67))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = (x + (y * z)) + ((t * a) + (a * (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 <= -500000000000.0) || !(z <= 4.5e+67)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (y * z)) + ((t * a) + (a * (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -500000000000.0) or not (z <= 4.5e+67): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = (x + (y * z)) + ((t * a) + (a * (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -500000000000.0) || !(z <= 4.5e+67)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(t * a) + Float64(a * Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -500000000000.0) || ~((z <= 4.5e+67))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = (x + (y * z)) + ((t * a) + (a * (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -500000000000.0], N[Not[LessEqual[z, 4.5e+67]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -500000000000 \lor \neg \left(z \leq 4.5 \cdot 10^{+67}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -5e11 or 4.4999999999999998e67 < z Initial program 86.0%
associate-+l+86.0%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in z around inf 96.4%
+-commutative96.4%
associate-+l+96.4%
+-commutative96.4%
associate-/l*99.0%
distribute-lft-out99.9%
Simplified99.9%
if -5e11 < z < 4.4999999999999998e67Initial program 98.6%
associate-+l+98.6%
associate-*l*100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.5e-91) (not (<= z 1.35e-22))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.5e-91) || !(z <= 1.35e-22)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} 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 ((z <= (-1.5d-91)) .or. (.not. (z <= 1.35d-22))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
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 ((z <= -1.5e-91) || !(z <= 1.35e-22)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.5e-91) or not (z <= 1.35e-22): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.5e-91) || !(z <= 1.35e-22)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); 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 ((z <= -1.5e-91) || ~((z <= 1.35e-22))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.5e-91], N[Not[LessEqual[z, 1.35e-22]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $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}\;z \leq -1.5 \cdot 10^{-91} \lor \neg \left(z \leq 1.35 \cdot 10^{-22}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if z < -1.5000000000000001e-91 or 1.3500000000000001e-22 < z Initial program 87.8%
associate-+l+87.8%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in z around inf 96.5%
+-commutative96.5%
associate-+l+96.5%
+-commutative96.5%
associate-/l*98.6%
distribute-lft-out99.2%
Simplified99.2%
if -1.5000000000000001e-91 < z < 1.3500000000000001e-22Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around 0 92.9%
Final simplification96.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* t a) (* y z))) (t_2 (+ x (* z (+ y (* a b))))))
(if (<= z -4.9e+101)
t_2
(if (<= z -2.2e-55)
(+ (* (* z a) b) t_1)
(if (<= z 5e+67) (+ x t_1) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t * a) + (y * z);
double t_2 = x + (z * (y + (a * b)));
double tmp;
if (z <= -4.9e+101) {
tmp = t_2;
} else if (z <= -2.2e-55) {
tmp = ((z * a) * b) + t_1;
} else if (z <= 5e+67) {
tmp = x + 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 = (t * a) + (y * z)
t_2 = x + (z * (y + (a * b)))
if (z <= (-4.9d+101)) then
tmp = t_2
else if (z <= (-2.2d-55)) then
tmp = ((z * a) * b) + t_1
else if (z <= 5d+67) then
tmp = x + 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 = (t * a) + (y * z);
double t_2 = x + (z * (y + (a * b)));
double tmp;
if (z <= -4.9e+101) {
tmp = t_2;
} else if (z <= -2.2e-55) {
tmp = ((z * a) * b) + t_1;
} else if (z <= 5e+67) {
tmp = x + t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t * a) + (y * z) t_2 = x + (z * (y + (a * b))) tmp = 0 if z <= -4.9e+101: tmp = t_2 elif z <= -2.2e-55: tmp = ((z * a) * b) + t_1 elif z <= 5e+67: tmp = x + t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t * a) + Float64(y * z)) t_2 = Float64(x + Float64(z * Float64(y + Float64(a * b)))) tmp = 0.0 if (z <= -4.9e+101) tmp = t_2; elseif (z <= -2.2e-55) tmp = Float64(Float64(Float64(z * a) * b) + t_1); elseif (z <= 5e+67) tmp = Float64(x + t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t * a) + (y * z); t_2 = x + (z * (y + (a * b))); tmp = 0.0; if (z <= -4.9e+101) tmp = t_2; elseif (z <= -2.2e-55) tmp = ((z * a) * b) + t_1; elseif (z <= 5e+67) tmp = x + t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e+101], t$95$2, If[LessEqual[z, -2.2e-55], N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 5e+67], N[(x + t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot a + y \cdot z\\
t_2 := x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{+101}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-55}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b + t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+67}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.89999999999999983e101 or 4.99999999999999976e67 < z Initial program 83.9%
associate-+l+83.9%
associate-*l*81.7%
Simplified81.7%
Taylor expanded in t around 0 81.9%
+-commutative81.9%
+-commutative81.9%
associate-*r*87.4%
distribute-rgt-in95.5%
Simplified95.5%
if -4.89999999999999983e101 < z < -2.2e-55Initial program 95.1%
Taylor expanded in x around 0 90.1%
if -2.2e-55 < z < 4.99999999999999976e67Initial program 98.5%
associate-+l+98.5%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around 0 91.4%
Final simplification92.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.75e+63)
(* a (* z b))
(if (<= a -1.3e-38)
(* y z)
(if (<= a -2.7e-278) x (if (<= a 1.55e+32) (* y z) (* t a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.75e+63) {
tmp = a * (z * b);
} else if (a <= -1.3e-38) {
tmp = y * z;
} else if (a <= -2.7e-278) {
tmp = x;
} else if (a <= 1.55e+32) {
tmp = y * z;
} else {
tmp = 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 (a <= (-2.75d+63)) then
tmp = a * (z * b)
else if (a <= (-1.3d-38)) then
tmp = y * z
else if (a <= (-2.7d-278)) then
tmp = x
else if (a <= 1.55d+32) then
tmp = y * z
else
tmp = 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 (a <= -2.75e+63) {
tmp = a * (z * b);
} else if (a <= -1.3e-38) {
tmp = y * z;
} else if (a <= -2.7e-278) {
tmp = x;
} else if (a <= 1.55e+32) {
tmp = y * z;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.75e+63: tmp = a * (z * b) elif a <= -1.3e-38: tmp = y * z elif a <= -2.7e-278: tmp = x elif a <= 1.55e+32: tmp = y * z else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.75e+63) tmp = Float64(a * Float64(z * b)); elseif (a <= -1.3e-38) tmp = Float64(y * z); elseif (a <= -2.7e-278) tmp = x; elseif (a <= 1.55e+32) tmp = Float64(y * z); else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.75e+63) tmp = a * (z * b); elseif (a <= -1.3e-38) tmp = y * z; elseif (a <= -2.7e-278) tmp = x; elseif (a <= 1.55e+32) tmp = y * z; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.75e+63], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.3e-38], N[(y * z), $MachinePrecision], If[LessEqual[a, -2.7e-278], x, If[LessEqual[a, 1.55e+32], N[(y * z), $MachinePrecision], N[(t * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.75 \cdot 10^{+63}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -1.3 \cdot 10^{-38}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-278}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+32}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -2.75000000000000002e63Initial program 85.9%
associate-+l+85.9%
+-commutative85.9%
fma-define85.9%
associate-*l*91.2%
*-commutative91.2%
*-commutative91.2%
distribute-rgt-out94.7%
remove-double-neg94.7%
*-commutative94.7%
distribute-lft-neg-out94.7%
sub-neg94.7%
sub-neg94.7%
distribute-lft-neg-in94.7%
remove-double-neg94.7%
Simplified94.7%
Taylor expanded in y around inf 83.3%
Taylor expanded in b around inf 47.8%
if -2.75000000000000002e63 < a < -1.30000000000000005e-38 or -2.7000000000000001e-278 < a < 1.54999999999999997e32Initial program 98.9%
associate-+l+98.9%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in y around inf 52.1%
*-commutative52.1%
Simplified52.1%
if -1.30000000000000005e-38 < a < -2.7000000000000001e-278Initial program 100.0%
associate-+l+100.0%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in x around inf 50.0%
if 1.54999999999999997e32 < a Initial program 85.0%
associate-+l+85.0%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in t around inf 44.0%
Final simplification48.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.3e+85) (not (<= z 1.25e+68))) (+ x (* z (+ y (* a b)))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.3e+85) || !(z <= 1.25e+68)) {
tmp = x + (z * (y + (a * 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 ((z <= (-5.3d+85)) .or. (.not. (z <= 1.25d+68))) then
tmp = x + (z * (y + (a * 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 ((z <= -5.3e+85) || !(z <= 1.25e+68)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.3e+85) or not (z <= 1.25e+68): tmp = x + (z * (y + (a * b))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.3e+85) || !(z <= 1.25e+68)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * 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 ((z <= -5.3e+85) || ~((z <= 1.25e+68))) tmp = x + (z * (y + (a * b))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5.3e+85], N[Not[LessEqual[z, 1.25e+68]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * 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}\;z \leq -5.3 \cdot 10^{+85} \lor \neg \left(z \leq 1.25 \cdot 10^{+68}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if z < -5.2999999999999999e85 or 1.2500000000000001e68 < z Initial program 85.1%
associate-+l+85.1%
associate-*l*82.0%
Simplified82.0%
Taylor expanded in t around 0 81.2%
+-commutative81.2%
+-commutative81.2%
associate-*r*87.4%
distribute-rgt-in94.8%
Simplified94.8%
if -5.2999999999999999e85 < z < 1.2500000000000001e68Initial program 97.5%
associate-+l+97.5%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in b around 0 87.8%
Final simplification90.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.05e+86) (not (<= z 1.8e+163))) (* z (+ y (* a b))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.05e+86) || !(z <= 1.8e+163)) {
tmp = z * (y + (a * 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 ((z <= (-2.05d+86)) .or. (.not. (z <= 1.8d+163))) then
tmp = z * (y + (a * 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 ((z <= -2.05e+86) || !(z <= 1.8e+163)) {
tmp = z * (y + (a * b));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.05e+86) or not (z <= 1.8e+163): tmp = z * (y + (a * b)) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.05e+86) || !(z <= 1.8e+163)) tmp = Float64(z * Float64(y + Float64(a * 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 ((z <= -2.05e+86) || ~((z <= 1.8e+163))) tmp = z * (y + (a * b)); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.05e+86], N[Not[LessEqual[z, 1.8e+163]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+86} \lor \neg \left(z \leq 1.8 \cdot 10^{+163}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if z < -2.05e86 or 1.79999999999999989e163 < z Initial program 82.7%
associate-+l+82.7%
associate-*l*81.4%
Simplified81.4%
Taylor expanded in z around inf 86.4%
if -2.05e86 < z < 1.79999999999999989e163Initial program 97.3%
associate-+l+97.3%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in b around 0 87.0%
Final simplification86.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -6.6e-18) (not (<= t 3.8e+81))) (+ x (* t a)) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -6.6e-18) || !(t <= 3.8e+81)) {
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 <= (-6.6d-18)) .or. (.not. (t <= 3.8d+81))) 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 <= -6.6e-18) || !(t <= 3.8e+81)) {
tmp = x + (t * a);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -6.6e-18) or not (t <= 3.8e+81): tmp = x + (t * a) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -6.6e-18) || !(t <= 3.8e+81)) 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 <= -6.6e-18) || ~((t <= 3.8e+81))) 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, -6.6e-18], N[Not[LessEqual[t, 3.8e+81]], $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 -6.6 \cdot 10^{-18} \lor \neg \left(t \leq 3.8 \cdot 10^{+81}\right):\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if t < -6.6000000000000003e-18 or 3.8e81 < t Initial program 87.6%
associate-+l+87.6%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in z around 0 69.6%
+-commutative69.6%
Simplified69.6%
if -6.6000000000000003e-18 < t < 3.8e81Initial program 96.7%
associate-+l+96.7%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around 0 68.7%
Final simplification69.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -7.6e+47) (not (<= t 1.9e+141))) (* t a) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -7.6e+47) || !(t <= 1.9e+141)) {
tmp = 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 <= (-7.6d+47)) .or. (.not. (t <= 1.9d+141))) then
tmp = 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 <= -7.6e+47) || !(t <= 1.9e+141)) {
tmp = t * a;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -7.6e+47) or not (t <= 1.9e+141): tmp = t * a else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -7.6e+47) || !(t <= 1.9e+141)) tmp = 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 <= -7.6e+47) || ~((t <= 1.9e+141))) tmp = t * a; else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -7.6e+47], N[Not[LessEqual[t, 1.9e+141]], $MachinePrecision]], N[(t * a), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.6 \cdot 10^{+47} \lor \neg \left(t \leq 1.9 \cdot 10^{+141}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if t < -7.6000000000000007e47 or 1.89999999999999988e141 < t Initial program 87.3%
associate-+l+87.3%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in t around inf 60.8%
if -7.6000000000000007e47 < t < 1.89999999999999988e141Initial program 95.5%
associate-+l+95.5%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in a around 0 65.5%
Final simplification64.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.25e-61) (not (<= t 9e+140))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.25e-61) || !(t <= 9e+140)) {
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 ((t <= (-1.25d-61)) .or. (.not. (t <= 9d+140))) 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 ((t <= -1.25e-61) || !(t <= 9e+140)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.25e-61) or not (t <= 9e+140): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.25e-61) || !(t <= 9e+140)) 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 ((t <= -1.25e-61) || ~((t <= 9e+140))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.25e-61], N[Not[LessEqual[t, 9e+140]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{-61} \lor \neg \left(t \leq 9 \cdot 10^{+140}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.25e-61 or 9.0000000000000003e140 < t Initial program 87.1%
associate-+l+87.1%
associate-*l*88.0%
Simplified88.0%
Taylor expanded in t around inf 53.9%
if -1.25e-61 < t < 9.0000000000000003e140Initial program 96.8%
associate-+l+96.8%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in x around inf 33.8%
Final simplification41.6%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.0%
associate-+l+93.0%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in x around inf 26.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 2024086
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))