
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5e+19) (not (<= z 7e-12))) (* z (+ y (+ (* a (+ b (/ t z))) (/ x 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 <= -5e+19) || !(z <= 7e-12)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / 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 <= (-5d+19)) .or. (.not. (z <= 7d-12))) then
tmp = z * (y + ((a * (b + (t / z))) + (x / 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 <= -5e+19) || !(z <= 7e-12)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / 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 <= -5e+19) or not (z <= 7e-12): tmp = z * (y + ((a * (b + (t / z))) + (x / 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 <= -5e+19) || !(z <= 7e-12)) tmp = Float64(z * Float64(y + Float64(Float64(a * Float64(b + Float64(t / z))) + Float64(x / 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 <= -5e+19) || ~((z <= 7e-12))) tmp = z * (y + ((a * (b + (t / z))) + (x / 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, -5e+19], N[Not[LessEqual[z, 7e-12]], $MachinePrecision]], N[(z * N[(y + N[(N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / z), $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 -5 \cdot 10^{+19} \lor \neg \left(z \leq 7 \cdot 10^{-12}\right):\\
\;\;\;\;z \cdot \left(y + \left(a \cdot \left(b + \frac{t}{z}\right) + \frac{x}{z}\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 < -5e19 or 7.0000000000000001e-12 < z Initial program 81.3%
associate-+l+81.3%
associate-*l*77.4%
Simplified77.4%
Taylor expanded in z around inf 92.5%
+-commutative92.5%
associate-+r+92.5%
associate-/l*95.8%
distribute-lft-out99.9%
Simplified99.9%
if -5e19 < z < 7.0000000000000001e-12Initial program 99.9%
associate-+l+99.9%
associate-*l*99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* 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 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (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)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * (b + (t / z))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (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 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + 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 * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (y + (a * (b + (t / z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * N[(b + N[(t / z), $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 \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot \left(b + \frac{t}{z}\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 98.3%
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*5.3%
Simplified5.3%
Taylor expanded in z around inf 57.9%
+-commutative57.9%
associate-+r+57.9%
associate-/l*78.9%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification98.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))))
(if (<= a -2.6e+142)
t_1
(if (<= a -3.8e+110)
(* (* z a) b)
(if (or (<= a -6.5e-31) (not (<= a 2.5e+15))) t_1 (+ x (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double tmp;
if (a <= -2.6e+142) {
tmp = t_1;
} else if (a <= -3.8e+110) {
tmp = (z * a) * b;
} else if ((a <= -6.5e-31) || !(a <= 2.5e+15)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (t * a)
if (a <= (-2.6d+142)) then
tmp = t_1
else if (a <= (-3.8d+110)) then
tmp = (z * a) * b
else if ((a <= (-6.5d-31)) .or. (.not. (a <= 2.5d+15))) then
tmp = t_1
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 t_1 = x + (t * a);
double tmp;
if (a <= -2.6e+142) {
tmp = t_1;
} else if (a <= -3.8e+110) {
tmp = (z * a) * b;
} else if ((a <= -6.5e-31) || !(a <= 2.5e+15)) {
tmp = t_1;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) tmp = 0 if a <= -2.6e+142: tmp = t_1 elif a <= -3.8e+110: tmp = (z * a) * b elif (a <= -6.5e-31) or not (a <= 2.5e+15): tmp = t_1 else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) tmp = 0.0 if (a <= -2.6e+142) tmp = t_1; elseif (a <= -3.8e+110) tmp = Float64(Float64(z * a) * b); elseif ((a <= -6.5e-31) || !(a <= 2.5e+15)) tmp = t_1; else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); tmp = 0.0; if (a <= -2.6e+142) tmp = t_1; elseif (a <= -3.8e+110) tmp = (z * a) * b; elseif ((a <= -6.5e-31) || ~((a <= 2.5e+15))) tmp = t_1; else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.6e+142], t$95$1, If[LessEqual[a, -3.8e+110], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[Or[LessEqual[a, -6.5e-31], N[Not[LessEqual[a, 2.5e+15]], $MachinePrecision]], t$95$1, N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -2.6 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.8 \cdot 10^{+110}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;a \leq -6.5 \cdot 10^{-31} \lor \neg \left(a \leq 2.5 \cdot 10^{+15}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -2.60000000000000021e142 or -3.79999999999999989e110 < a < -6.49999999999999967e-31 or 2.5e15 < a Initial program 82.9%
associate-+l+82.9%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in z around 0 61.4%
+-commutative61.4%
Simplified61.4%
if -2.60000000000000021e142 < a < -3.79999999999999989e110Initial program 90.0%
Taylor expanded in y around inf 61.3%
Taylor expanded in x around inf 80.2%
+-commutative80.2%
associate-+r+80.2%
associate-+l+80.2%
associate-/l*80.2%
associate-/l*80.3%
distribute-lft-out80.3%
*-commutative80.3%
associate-/l*80.4%
associate-/l*90.4%
fma-define90.4%
Simplified90.4%
Taylor expanded in b around inf 80.0%
associate-*r*80.3%
*-commutative80.3%
associate-*r*80.3%
Simplified80.3%
if -6.49999999999999967e-31 < a < 2.5e15Initial program 99.2%
associate-+l+99.2%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in a around 0 83.2%
Final simplification72.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -6.5e-32)
(* (* z a) b)
(if (<= z 9e-291)
x
(if (<= z 3.7e-122) (* t a) (if (<= z 2.4e+122) x (* a (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6.5e-32) {
tmp = (z * a) * b;
} else if (z <= 9e-291) {
tmp = x;
} else if (z <= 3.7e-122) {
tmp = t * a;
} else if (z <= 2.4e+122) {
tmp = x;
} 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) :: tmp
if (z <= (-6.5d-32)) then
tmp = (z * a) * b
else if (z <= 9d-291) then
tmp = x
else if (z <= 3.7d-122) then
tmp = t * a
else if (z <= 2.4d+122) then
tmp = x
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 tmp;
if (z <= -6.5e-32) {
tmp = (z * a) * b;
} else if (z <= 9e-291) {
tmp = x;
} else if (z <= 3.7e-122) {
tmp = t * a;
} else if (z <= 2.4e+122) {
tmp = x;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -6.5e-32: tmp = (z * a) * b elif z <= 9e-291: tmp = x elif z <= 3.7e-122: tmp = t * a elif z <= 2.4e+122: tmp = x else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -6.5e-32) tmp = Float64(Float64(z * a) * b); elseif (z <= 9e-291) tmp = x; elseif (z <= 3.7e-122) tmp = Float64(t * a); elseif (z <= 2.4e+122) tmp = x; else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -6.5e-32) tmp = (z * a) * b; elseif (z <= 9e-291) tmp = x; elseif (z <= 3.7e-122) tmp = t * a; elseif (z <= 2.4e+122) tmp = x; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -6.5e-32], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[z, 9e-291], x, If[LessEqual[z, 3.7e-122], N[(t * a), $MachinePrecision], If[LessEqual[z, 2.4e+122], x, N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-32}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-291}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-122}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+122}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if z < -6.49999999999999988e-32Initial program 86.3%
Taylor expanded in y around inf 77.7%
Taylor expanded in x around inf 64.2%
+-commutative64.2%
associate-+r+64.2%
associate-+l+64.2%
associate-/l*62.7%
associate-/l*65.7%
distribute-lft-out70.2%
*-commutative70.2%
associate-/l*74.5%
associate-/l*71.6%
fma-define71.6%
Simplified71.6%
Taylor expanded in b around inf 45.6%
associate-*r*44.2%
*-commutative44.2%
associate-*r*45.6%
Simplified45.6%
if -6.49999999999999988e-32 < z < 8.99999999999999948e-291 or 3.6999999999999997e-122 < z < 2.4000000000000002e122Initial program 99.1%
associate-+l+99.1%
associate-*l*97.5%
Simplified97.5%
Taylor expanded in x around inf 49.1%
if 8.99999999999999948e-291 < z < 3.6999999999999997e-122Initial program 99.8%
Taylor expanded in y around inf 89.8%
Taylor expanded in t around inf 57.0%
if 2.4000000000000002e122 < z Initial program 62.3%
Taylor expanded in y around inf 56.7%
Taylor expanded in x around inf 62.0%
+-commutative62.0%
associate-+r+62.0%
associate-+l+62.0%
associate-/l*65.0%
associate-/l*62.1%
distribute-lft-out68.0%
*-commutative68.0%
associate-/l*68.1%
associate-/l*79.8%
fma-define79.8%
Simplified79.8%
Taylor expanded in b around inf 57.1%
Final simplification50.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= z -8e-31)
t_1
(if (<= z 1.45e-289)
x
(if (<= z 3.9e-122) (* t a) (if (<= z 2.4e+122) x t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (z <= -8e-31) {
tmp = t_1;
} else if (z <= 1.45e-289) {
tmp = x;
} else if (z <= 3.9e-122) {
tmp = t * a;
} else if (z <= 2.4e+122) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (z <= (-8d-31)) then
tmp = t_1
else if (z <= 1.45d-289) then
tmp = x
else if (z <= 3.9d-122) then
tmp = t * a
else if (z <= 2.4d+122) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (z <= -8e-31) {
tmp = t_1;
} else if (z <= 1.45e-289) {
tmp = x;
} else if (z <= 3.9e-122) {
tmp = t * a;
} else if (z <= 2.4e+122) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if z <= -8e-31: tmp = t_1 elif z <= 1.45e-289: tmp = x elif z <= 3.9e-122: tmp = t * a elif z <= 2.4e+122: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (z <= -8e-31) tmp = t_1; elseif (z <= 1.45e-289) tmp = x; elseif (z <= 3.9e-122) tmp = Float64(t * a); elseif (z <= 2.4e+122) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (z <= -8e-31) tmp = t_1; elseif (z <= 1.45e-289) tmp = x; elseif (z <= 3.9e-122) tmp = t * a; elseif (z <= 2.4e+122) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e-31], t$95$1, If[LessEqual[z, 1.45e-289], x, If[LessEqual[z, 3.9e-122], N[(t * a), $MachinePrecision], If[LessEqual[z, 2.4e+122], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-289}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-122}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+122}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.000000000000001e-31 or 2.4000000000000002e122 < z Initial program 78.2%
Taylor expanded in y around inf 70.6%
Taylor expanded in x around inf 63.4%
+-commutative63.4%
associate-+r+63.4%
associate-+l+63.4%
associate-/l*63.4%
associate-/l*64.5%
distribute-lft-out69.5%
*-commutative69.5%
associate-/l*72.3%
associate-/l*74.4%
fma-define74.4%
Simplified74.4%
Taylor expanded in b around inf 49.5%
if -8.000000000000001e-31 < z < 1.45000000000000003e-289 or 3.8999999999999999e-122 < z < 2.4000000000000002e122Initial program 99.1%
associate-+l+99.1%
associate-*l*97.5%
Simplified97.5%
Taylor expanded in x around inf 49.1%
if 1.45000000000000003e-289 < z < 3.8999999999999999e-122Initial program 99.8%
Taylor expanded in y around inf 89.8%
Taylor expanded in t around inf 57.0%
Final simplification50.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.5e-59) (not (<= z 5.5e-82))) (* z (+ y (+ (* a (+ b (/ t z))) (/ x z)))) (+ (+ x (* y z)) (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.5e-59) || !(z <= 5.5e-82)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = (x + (y * z)) + (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 <= (-5.5d-59)) .or. (.not. (z <= 5.5d-82))) then
tmp = z * (y + ((a * (b + (t / z))) + (x / z)))
else
tmp = (x + (y * z)) + (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 <= -5.5e-59) || !(z <= 5.5e-82)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = (x + (y * z)) + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.5e-59) or not (z <= 5.5e-82): tmp = z * (y + ((a * (b + (t / z))) + (x / z))) else: tmp = (x + (y * z)) + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.5e-59) || !(z <= 5.5e-82)) tmp = Float64(z * Float64(y + Float64(Float64(a * Float64(b + Float64(t / z))) + Float64(x / z)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5.5e-59) || ~((z <= 5.5e-82))) tmp = z * (y + ((a * (b + (t / z))) + (x / z))); else tmp = (x + (y * z)) + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5.5e-59], N[Not[LessEqual[z, 5.5e-82]], $MachinePrecision]], N[(z * N[(y + N[(N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-59} \lor \neg \left(z \leq 5.5 \cdot 10^{-82}\right):\\
\;\;\;\;z \cdot \left(y + \left(a \cdot \left(b + \frac{t}{z}\right) + \frac{x}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\end{array}
\end{array}
if z < -5.50000000000000014e-59 or 5.4999999999999998e-82 < z Initial program 84.9%
associate-+l+84.9%
associate-*l*81.7%
Simplified81.7%
Taylor expanded in z around inf 91.4%
+-commutative91.4%
associate-+r+91.4%
associate-/l*94.0%
distribute-lft-out97.3%
Simplified97.3%
if -5.50000000000000014e-59 < z < 5.4999999999999998e-82Initial program 99.9%
associate-+l+99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around inf 94.0%
Final simplification96.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -3.45e-12)
(* z (+ y (* a (+ b (/ t z)))))
(if (<= z 1350000000.0)
(+ (+ x (* y z)) (* t a))
(* z (+ y (+ (/ x z) (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.45e-12) {
tmp = z * (y + (a * (b + (t / z))));
} else if (z <= 1350000000.0) {
tmp = (x + (y * z)) + (t * a);
} else {
tmp = z * (y + ((x / z) + (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 (z <= (-3.45d-12)) then
tmp = z * (y + (a * (b + (t / z))))
else if (z <= 1350000000.0d0) then
tmp = (x + (y * z)) + (t * a)
else
tmp = z * (y + ((x / z) + (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 (z <= -3.45e-12) {
tmp = z * (y + (a * (b + (t / z))));
} else if (z <= 1350000000.0) {
tmp = (x + (y * z)) + (t * a);
} else {
tmp = z * (y + ((x / z) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.45e-12: tmp = z * (y + (a * (b + (t / z)))) elif z <= 1350000000.0: tmp = (x + (y * z)) + (t * a) else: tmp = z * (y + ((x / z) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.45e-12) tmp = Float64(z * Float64(y + Float64(a * Float64(b + Float64(t / z))))); elseif (z <= 1350000000.0) tmp = Float64(Float64(x + Float64(y * z)) + Float64(t * a)); else tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.45e-12) tmp = z * (y + (a * (b + (t / z)))); elseif (z <= 1350000000.0) tmp = (x + (y * z)) + (t * a); else tmp = z * (y + ((x / z) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.45e-12], N[(z * N[(y + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1350000000.0], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.45 \cdot 10^{-12}:\\
\;\;\;\;z \cdot \left(y + a \cdot \left(b + \frac{t}{z}\right)\right)\\
\mathbf{elif}\;z \leq 1350000000:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -3.45e-12Initial program 85.7%
associate-+l+85.7%
associate-*l*75.1%
Simplified75.1%
Taylor expanded in z around inf 95.1%
+-commutative95.1%
associate-+r+95.1%
associate-/l*96.7%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in x around 0 90.8%
if -3.45e-12 < z < 1.35e9Initial program 99.2%
associate-+l+99.2%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in t around inf 90.0%
if 1.35e9 < z Initial program 77.9%
associate-+l+77.9%
associate-*l*81.2%
Simplified81.2%
Taylor expanded in z around inf 93.0%
+-commutative93.0%
associate-+r+93.0%
associate-/l*98.2%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in t around 0 94.8%
Final simplification91.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* z a) b)))
(if (<= a -5e+108)
t_1
(if (<= a -9.2e+36) (* t a) (if (<= a 4.6e+129) (+ x (* y z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * a) * b;
double tmp;
if (a <= -5e+108) {
tmp = t_1;
} else if (a <= -9.2e+36) {
tmp = t * a;
} else if (a <= 4.6e+129) {
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 = (z * a) * b
if (a <= (-5d+108)) then
tmp = t_1
else if (a <= (-9.2d+36)) then
tmp = t * a
else if (a <= 4.6d+129) 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 = (z * a) * b;
double tmp;
if (a <= -5e+108) {
tmp = t_1;
} else if (a <= -9.2e+36) {
tmp = t * a;
} else if (a <= 4.6e+129) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * a) * b tmp = 0 if a <= -5e+108: tmp = t_1 elif a <= -9.2e+36: tmp = t * a elif a <= 4.6e+129: tmp = x + (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * a) * b) tmp = 0.0 if (a <= -5e+108) tmp = t_1; elseif (a <= -9.2e+36) tmp = Float64(t * a); elseif (a <= 4.6e+129) 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 = (z * a) * b; tmp = 0.0; if (a <= -5e+108) tmp = t_1; elseif (a <= -9.2e+36) tmp = t * a; elseif (a <= 4.6e+129) 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[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[a, -5e+108], t$95$1, If[LessEqual[a, -9.2e+36], N[(t * a), $MachinePrecision], If[LessEqual[a, 4.6e+129], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;a \leq -5 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -9.2 \cdot 10^{+36}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{+129}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.99999999999999991e108 or 4.59999999999999981e129 < a Initial program 78.5%
Taylor expanded in y around inf 65.1%
Taylor expanded in x around inf 67.1%
+-commutative67.1%
associate-+r+67.1%
associate-+l+67.1%
associate-/l*67.1%
associate-/l*69.7%
distribute-lft-out77.4%
*-commutative77.4%
associate-/l*76.1%
associate-/l*82.5%
fma-define82.5%
Simplified82.5%
Taylor expanded in b around inf 53.8%
associate-*r*53.2%
*-commutative53.2%
associate-*r*55.1%
Simplified55.1%
if -4.99999999999999991e108 < a < -9.19999999999999986e36Initial program 83.7%
Taylor expanded in y around inf 73.0%
Taylor expanded in t around inf 65.3%
if -9.19999999999999986e36 < a < 4.59999999999999981e129Initial program 98.1%
associate-+l+98.1%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in a around 0 74.1%
Final simplification67.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -9.5e+59) (not (<= a 9.8e+14))) (+ x (* a (+ t (* z b)))) (+ (+ x (* y z)) (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -9.5e+59) || !(a <= 9.8e+14)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + (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 <= (-9.5d+59)) .or. (.not. (a <= 9.8d+14))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (y * z)) + (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 <= -9.5e+59) || !(a <= 9.8e+14)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -9.5e+59) or not (a <= 9.8e+14): tmp = x + (a * (t + (z * b))) else: tmp = (x + (y * z)) + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -9.5e+59) || !(a <= 9.8e+14)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -9.5e+59) || ~((a <= 9.8e+14))) tmp = x + (a * (t + (z * b))); else tmp = (x + (y * z)) + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -9.5e+59], N[Not[LessEqual[a, 9.8e+14]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+59} \lor \neg \left(a \leq 9.8 \cdot 10^{+14}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\end{array}
\end{array}
if a < -9.50000000000000023e59 or 9.8e14 < a Initial program 80.0%
associate-+l+80.0%
+-commutative80.0%
fma-define80.1%
associate-*l*83.7%
*-commutative83.7%
*-commutative83.7%
distribute-rgt-out92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in y around 0 95.3%
if -9.50000000000000023e59 < a < 9.8e14Initial program 98.7%
associate-+l+98.7%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in t around inf 89.8%
Final simplification92.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.7e-86) (not (<= a 3.2e-51))) (+ x (* 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.7e-86) || !(a <= 3.2e-51)) {
tmp = x + (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.7d-86)) .or. (.not. (a <= 3.2d-51))) then
tmp = x + (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.7e-86) || !(a <= 3.2e-51)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.7e-86) or not (a <= 3.2e-51): tmp = x + (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.7e-86) || !(a <= 3.2e-51)) tmp = Float64(x + 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.7e-86) || ~((a <= 3.2e-51))) tmp = x + (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.7e-86], N[Not[LessEqual[a, 3.2e-51]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{-86} \lor \neg \left(a \leq 3.2 \cdot 10^{-51}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -2.69999999999999992e-86 or 3.2e-51 < a Initial program 85.9%
associate-+l+85.9%
+-commutative85.9%
fma-define85.9%
associate-*l*88.4%
*-commutative88.4%
*-commutative88.4%
distribute-rgt-out94.2%
*-commutative94.2%
Simplified94.2%
Taylor expanded in y around 0 88.6%
if -2.69999999999999992e-86 < a < 3.2e-51Initial program 99.0%
associate-+l+99.0%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in a around 0 90.1%
Final simplification89.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -5.2e+34) x (if (<= x -1.62e-257) (* t a) (if (<= x 880000000000.0) (* y z) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.2e+34) {
tmp = x;
} else if (x <= -1.62e-257) {
tmp = t * a;
} else if (x <= 880000000000.0) {
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 <= (-5.2d+34)) then
tmp = x
else if (x <= (-1.62d-257)) then
tmp = t * a
else if (x <= 880000000000.0d0) 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 <= -5.2e+34) {
tmp = x;
} else if (x <= -1.62e-257) {
tmp = t * a;
} else if (x <= 880000000000.0) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5.2e+34: tmp = x elif x <= -1.62e-257: tmp = t * a elif x <= 880000000000.0: tmp = y * z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5.2e+34) tmp = x; elseif (x <= -1.62e-257) tmp = Float64(t * a); elseif (x <= 880000000000.0) 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 <= -5.2e+34) tmp = x; elseif (x <= -1.62e-257) tmp = t * a; elseif (x <= 880000000000.0) tmp = y * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5.2e+34], x, If[LessEqual[x, -1.62e-257], N[(t * a), $MachinePrecision], If[LessEqual[x, 880000000000.0], N[(y * z), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+34}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.62 \cdot 10^{-257}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 880000000000:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.19999999999999995e34 or 8.8e11 < x Initial program 89.6%
associate-+l+89.6%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in x around inf 51.6%
if -5.19999999999999995e34 < x < -1.6200000000000001e-257Initial program 94.5%
Taylor expanded in y around inf 94.5%
Taylor expanded in t around inf 43.6%
if -1.6200000000000001e-257 < x < 8.8e11Initial program 90.8%
associate-+l+90.8%
associate-*l*90.9%
Simplified90.9%
Taylor expanded in y around inf 41.6%
*-commutative41.6%
Simplified41.6%
Final simplification46.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -5.6e-40) (not (<= a 1.2e-38))) (* 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 <= -5.6e-40) || !(a <= 1.2e-38)) {
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 <= (-5.6d-40)) .or. (.not. (a <= 1.2d-38))) 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 <= -5.6e-40) || !(a <= 1.2e-38)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -5.6e-40) or not (a <= 1.2e-38): 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 <= -5.6e-40) || !(a <= 1.2e-38)) 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 <= -5.6e-40) || ~((a <= 1.2e-38))) 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, -5.6e-40], N[Not[LessEqual[a, 1.2e-38]], $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 -5.6 \cdot 10^{-40} \lor \neg \left(a \leq 1.2 \cdot 10^{-38}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -5.5999999999999999e-40 or 1.20000000000000011e-38 < a Initial program 84.8%
Taylor expanded in y around inf 75.5%
Taylor expanded in a around inf 75.8%
+-commutative75.8%
*-commutative75.8%
Simplified75.8%
if -5.5999999999999999e-40 < a < 1.20000000000000011e-38Initial program 99.1%
associate-+l+99.1%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in a around 0 88.2%
Final simplification81.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -7e+73) (not (<= t 13.6))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -7e+73) || !(t <= 13.6)) {
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 <= (-7d+73)) .or. (.not. (t <= 13.6d0))) 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 <= -7e+73) || !(t <= 13.6)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -7e+73) or not (t <= 13.6): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -7e+73) || !(t <= 13.6)) 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 <= -7e+73) || ~((t <= 13.6))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -7e+73], N[Not[LessEqual[t, 13.6]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+73} \lor \neg \left(t \leq 13.6\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -7.00000000000000004e73 or 13.5999999999999996 < t Initial program 85.9%
Taylor expanded in y around inf 77.8%
Taylor expanded in t around inf 53.4%
if -7.00000000000000004e73 < t < 13.5999999999999996Initial program 94.7%
associate-+l+94.7%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in x around inf 40.7%
Final simplification46.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.0%
associate-+l+91.0%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in x around inf 31.8%
(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 2024110
(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)))