
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.6e+31) (not (<= z 8.5e+110))) (* 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 <= -1.6e+31) || !(z <= 8.5e+110)) {
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 <= (-1.6d+31)) .or. (.not. (z <= 8.5d+110))) 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 <= -1.6e+31) || !(z <= 8.5e+110)) {
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 <= -1.6e+31) or not (z <= 8.5e+110): 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 <= -1.6e+31) || !(z <= 8.5e+110)) 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 <= -1.6e+31) || ~((z <= 8.5e+110))) 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, -1.6e+31], N[Not[LessEqual[z, 8.5e+110]], $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 -1.6 \cdot 10^{+31} \lor \neg \left(z \leq 8.5 \cdot 10^{+110}\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 < -1.6e31 or 8.5000000000000004e110 < z Initial program 85.3%
associate-+l+85.3%
associate-*l*84.5%
Simplified84.5%
Taylor expanded in z around inf 97.4%
+-commutative97.4%
associate-+l+97.4%
+-commutative97.4%
associate-/l*99.9%
distribute-lft-out99.9%
Simplified99.9%
if -1.6e31 < z < 8.5000000000000004e110Initial program 97.6%
associate-+l+97.6%
associate-*l*99.3%
Simplified99.3%
Final simplification99.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= y -8.6e+31)
(* y z)
(if (<= y -1.05e-36)
x
(if (<= y -3.4e-57)
t_1
(if (<= y -8.8e-72)
(* t a)
(if (<= y -1.3e-267)
x
(if (<= y 5.2e-286) t_1 (if (<= y 2.65e+70) x (* y z))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (y <= -8.6e+31) {
tmp = y * z;
} else if (y <= -1.05e-36) {
tmp = x;
} else if (y <= -3.4e-57) {
tmp = t_1;
} else if (y <= -8.8e-72) {
tmp = t * a;
} else if (y <= -1.3e-267) {
tmp = x;
} else if (y <= 5.2e-286) {
tmp = t_1;
} else if (y <= 2.65e+70) {
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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (y <= (-8.6d+31)) then
tmp = y * z
else if (y <= (-1.05d-36)) then
tmp = x
else if (y <= (-3.4d-57)) then
tmp = t_1
else if (y <= (-8.8d-72)) then
tmp = t * a
else if (y <= (-1.3d-267)) then
tmp = x
else if (y <= 5.2d-286) then
tmp = t_1
else if (y <= 2.65d+70) 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 t_1 = a * (z * b);
double tmp;
if (y <= -8.6e+31) {
tmp = y * z;
} else if (y <= -1.05e-36) {
tmp = x;
} else if (y <= -3.4e-57) {
tmp = t_1;
} else if (y <= -8.8e-72) {
tmp = t * a;
} else if (y <= -1.3e-267) {
tmp = x;
} else if (y <= 5.2e-286) {
tmp = t_1;
} else if (y <= 2.65e+70) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if y <= -8.6e+31: tmp = y * z elif y <= -1.05e-36: tmp = x elif y <= -3.4e-57: tmp = t_1 elif y <= -8.8e-72: tmp = t * a elif y <= -1.3e-267: tmp = x elif y <= 5.2e-286: tmp = t_1 elif y <= 2.65e+70: tmp = x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (y <= -8.6e+31) tmp = Float64(y * z); elseif (y <= -1.05e-36) tmp = x; elseif (y <= -3.4e-57) tmp = t_1; elseif (y <= -8.8e-72) tmp = Float64(t * a); elseif (y <= -1.3e-267) tmp = x; elseif (y <= 5.2e-286) tmp = t_1; elseif (y <= 2.65e+70) tmp = x; else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (y <= -8.6e+31) tmp = y * z; elseif (y <= -1.05e-36) tmp = x; elseif (y <= -3.4e-57) tmp = t_1; elseif (y <= -8.8e-72) tmp = t * a; elseif (y <= -1.3e-267) tmp = x; elseif (y <= 5.2e-286) tmp = t_1; elseif (y <= 2.65e+70) tmp = x; else tmp = y * z; 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[y, -8.6e+31], N[(y * z), $MachinePrecision], If[LessEqual[y, -1.05e-36], x, If[LessEqual[y, -3.4e-57], t$95$1, If[LessEqual[y, -8.8e-72], N[(t * a), $MachinePrecision], If[LessEqual[y, -1.3e-267], x, If[LessEqual[y, 5.2e-286], t$95$1, If[LessEqual[y, 2.65e+70], x, N[(y * z), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;y \leq -8.6 \cdot 10^{+31}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-36}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-72}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{-267}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-286}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{+70}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -8.59999999999999978e31 or 2.65e70 < y Initial program 92.4%
associate-+l+92.4%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in y around inf 56.1%
*-commutative56.1%
Simplified56.1%
if -8.59999999999999978e31 < y < -1.04999999999999995e-36 or -8.8000000000000001e-72 < y < -1.3000000000000001e-267 or 5.1999999999999999e-286 < y < 2.65e70Initial program 95.5%
associate-+l+95.5%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 43.3%
if -1.04999999999999995e-36 < y < -3.40000000000000016e-57 or -1.3000000000000001e-267 < y < 5.1999999999999999e-286Initial program 89.7%
associate-+l+89.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around inf 95.0%
Taylor expanded in b around inf 64.1%
if -3.40000000000000016e-57 < y < -8.8000000000000001e-72Initial program 100.0%
associate-+l+100.0%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in t around inf 76.3%
Final simplification51.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 1e+308) 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 <= 1e+308) {
tmp = t_1;
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / 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 + (y * z)) + (t * a)) + ((z * a) * b)
if (t_1 <= 1d+308) then
tmp = t_1
else
tmp = z * (y + ((x / z) + (a * (b + (t / 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 + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= 1e+308) {
tmp = t_1;
} 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 * a)) + ((z * a) * b) tmp = 0 if t_1 <= 1e+308: 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 <= 1e+308) tmp = t_1; 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 * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= 1e+308) tmp = t_1; 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[(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, 1e+308], 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 10^{+308}:\\
\;\;\;\;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)) < 1e308Initial program 98.0%
if 1e308 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 73.1%
associate-+l+73.1%
associate-*l*84.1%
Simplified84.1%
Taylor expanded in z around inf 90.9%
+-commutative90.9%
associate-+l+90.9%
+-commutative90.9%
associate-/l*95.5%
distribute-lft-out100.0%
Simplified100.0%
Final simplification98.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -2.65e+202)
t_1
(if (<= a -3.2e+178)
(+ x (* t a))
(if (<= a -9e+130)
t_1
(if (<= a -1.45e-12)
(+ (* y z) (* t a))
(if (<= a 2900.0) (+ 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 <= -2.65e+202) {
tmp = t_1;
} else if (a <= -3.2e+178) {
tmp = x + (t * a);
} else if (a <= -9e+130) {
tmp = t_1;
} else if (a <= -1.45e-12) {
tmp = (y * z) + (t * a);
} else if (a <= 2900.0) {
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 <= (-2.65d+202)) then
tmp = t_1
else if (a <= (-3.2d+178)) then
tmp = x + (t * a)
else if (a <= (-9d+130)) then
tmp = t_1
else if (a <= (-1.45d-12)) then
tmp = (y * z) + (t * a)
else if (a <= 2900.0d0) 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 <= -2.65e+202) {
tmp = t_1;
} else if (a <= -3.2e+178) {
tmp = x + (t * a);
} else if (a <= -9e+130) {
tmp = t_1;
} else if (a <= -1.45e-12) {
tmp = (y * z) + (t * a);
} else if (a <= 2900.0) {
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 <= -2.65e+202: tmp = t_1 elif a <= -3.2e+178: tmp = x + (t * a) elif a <= -9e+130: tmp = t_1 elif a <= -1.45e-12: tmp = (y * z) + (t * a) elif a <= 2900.0: 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 <= -2.65e+202) tmp = t_1; elseif (a <= -3.2e+178) tmp = Float64(x + Float64(t * a)); elseif (a <= -9e+130) tmp = t_1; elseif (a <= -1.45e-12) tmp = Float64(Float64(y * z) + Float64(t * a)); elseif (a <= 2900.0) 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 <= -2.65e+202) tmp = t_1; elseif (a <= -3.2e+178) tmp = x + (t * a); elseif (a <= -9e+130) tmp = t_1; elseif (a <= -1.45e-12) tmp = (y * z) + (t * a); elseif (a <= 2900.0) 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, -2.65e+202], t$95$1, If[LessEqual[a, -3.2e+178], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -9e+130], t$95$1, If[LessEqual[a, -1.45e-12], N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2900.0], 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 -2.65 \cdot 10^{+202}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.2 \cdot 10^{+178}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;a \leq -9 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.45 \cdot 10^{-12}:\\
\;\;\;\;y \cdot z + t \cdot a\\
\mathbf{elif}\;a \leq 2900:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.64999999999999985e202 or -3.2e178 < a < -9.00000000000000078e130 or 2900 < a Initial program 89.8%
associate-+l+89.8%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in a around inf 80.8%
if -2.64999999999999985e202 < a < -3.2e178Initial program 81.7%
associate-+l+81.7%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 74.0%
+-commutative74.0%
Simplified74.0%
if -9.00000000000000078e130 < a < -1.4500000000000001e-12Initial program 92.3%
associate-+l+92.3%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in b around 0 89.4%
Taylor expanded in x around 0 78.2%
if -1.4500000000000001e-12 < a < 2900Initial program 98.1%
associate-+l+98.1%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in a around 0 77.4%
Final simplification78.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))) (t_2 (* a (* z b))))
(if (<= a -3.8e+202)
(* z (* a b))
(if (<= a 2800.0)
t_1
(if (<= a 9.5e+74)
t_2
(if (<= a 1.6e+110) t_1 (if (<= a 7e+262) (* t a) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = a * (z * b);
double tmp;
if (a <= -3.8e+202) {
tmp = z * (a * b);
} else if (a <= 2800.0) {
tmp = t_1;
} else if (a <= 9.5e+74) {
tmp = t_2;
} else if (a <= 1.6e+110) {
tmp = t_1;
} else if (a <= 7e+262) {
tmp = t * a;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y * z)
t_2 = a * (z * b)
if (a <= (-3.8d+202)) then
tmp = z * (a * b)
else if (a <= 2800.0d0) then
tmp = t_1
else if (a <= 9.5d+74) then
tmp = t_2
else if (a <= 1.6d+110) then
tmp = t_1
else if (a <= 7d+262) then
tmp = t * a
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = a * (z * b);
double tmp;
if (a <= -3.8e+202) {
tmp = z * (a * b);
} else if (a <= 2800.0) {
tmp = t_1;
} else if (a <= 9.5e+74) {
tmp = t_2;
} else if (a <= 1.6e+110) {
tmp = t_1;
} else if (a <= 7e+262) {
tmp = t * a;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) t_2 = a * (z * b) tmp = 0 if a <= -3.8e+202: tmp = z * (a * b) elif a <= 2800.0: tmp = t_1 elif a <= 9.5e+74: tmp = t_2 elif a <= 1.6e+110: tmp = t_1 elif a <= 7e+262: tmp = t * a else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) t_2 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -3.8e+202) tmp = Float64(z * Float64(a * b)); elseif (a <= 2800.0) tmp = t_1; elseif (a <= 9.5e+74) tmp = t_2; elseif (a <= 1.6e+110) tmp = t_1; elseif (a <= 7e+262) tmp = Float64(t * a); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); t_2 = a * (z * b); tmp = 0.0; if (a <= -3.8e+202) tmp = z * (a * b); elseif (a <= 2800.0) tmp = t_1; elseif (a <= 9.5e+74) tmp = t_2; elseif (a <= 1.6e+110) tmp = t_1; elseif (a <= 7e+262) tmp = t * a; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.8e+202], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2800.0], t$95$1, If[LessEqual[a, 9.5e+74], t$95$2, If[LessEqual[a, 1.6e+110], t$95$1, If[LessEqual[a, 7e+262], N[(t * a), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{+202}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 2800:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{+74}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+262}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -3.8000000000000001e202Initial program 94.8%
associate-+l+94.8%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in a around inf 94.9%
Taylor expanded in b around inf 42.9%
associate-*r*52.6%
Simplified52.6%
if -3.8000000000000001e202 < a < 2800 or 9.5000000000000006e74 < a < 1.59999999999999997e110Initial program 95.9%
associate-+l+95.9%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in a around 0 68.8%
if 2800 < a < 9.5000000000000006e74 or 6.9999999999999994e262 < a Initial program 86.9%
associate-+l+86.9%
associate-*l*89.7%
Simplified89.7%
Taylor expanded in a around inf 96.4%
Taylor expanded in b around inf 62.2%
if 1.59999999999999997e110 < a < 6.9999999999999994e262Initial program 85.5%
associate-+l+85.5%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in t around inf 62.7%
Final simplification66.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -2.65e+202)
t_1
(if (<= a -3e+178)
(+ x (* t a))
(if (or (<= a -6.2e+21) (not (<= a 1350.0))) t_1 (+ x (* y z)))))))
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 <= -2.65e+202) {
tmp = t_1;
} else if (a <= -3e+178) {
tmp = x + (t * a);
} else if ((a <= -6.2e+21) || !(a <= 1350.0)) {
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 = a * (t + (z * b))
if (a <= (-2.65d+202)) then
tmp = t_1
else if (a <= (-3d+178)) then
tmp = x + (t * a)
else if ((a <= (-6.2d+21)) .or. (.not. (a <= 1350.0d0))) 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 = a * (t + (z * b));
double tmp;
if (a <= -2.65e+202) {
tmp = t_1;
} else if (a <= -3e+178) {
tmp = x + (t * a);
} else if ((a <= -6.2e+21) || !(a <= 1350.0)) {
tmp = t_1;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -2.65e+202: tmp = t_1 elif a <= -3e+178: tmp = x + (t * a) elif (a <= -6.2e+21) or not (a <= 1350.0): tmp = t_1 else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -2.65e+202) tmp = t_1; elseif (a <= -3e+178) tmp = Float64(x + Float64(t * a)); elseif ((a <= -6.2e+21) || !(a <= 1350.0)) 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 = a * (t + (z * b)); tmp = 0.0; if (a <= -2.65e+202) tmp = t_1; elseif (a <= -3e+178) tmp = x + (t * a); elseif ((a <= -6.2e+21) || ~((a <= 1350.0))) 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[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.65e+202], t$95$1, If[LessEqual[a, -3e+178], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -6.2e+21], N[Not[LessEqual[a, 1350.0]], $MachinePrecision]], t$95$1, N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -2.65 \cdot 10^{+202}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3 \cdot 10^{+178}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;a \leq -6.2 \cdot 10^{+21} \lor \neg \left(a \leq 1350\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -2.64999999999999985e202 or -3.00000000000000016e178 < a < -6.2e21 or 1350 < a Initial program 89.6%
associate-+l+89.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in a around inf 77.9%
if -2.64999999999999985e202 < a < -3.00000000000000016e178Initial program 81.7%
associate-+l+81.7%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 74.0%
+-commutative74.0%
Simplified74.0%
if -6.2e21 < a < 1350Initial program 98.2%
associate-+l+98.2%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in a around 0 76.0%
Final simplification76.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (+ x (* y z))))
(if (<= y -2.6e+39)
t_2
(if (<= y -1.4e-280)
t_1
(if (<= y 9.6e-301) (* a (* z b)) (if (<= y 1.42e+71) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = x + (y * z);
double tmp;
if (y <= -2.6e+39) {
tmp = t_2;
} else if (y <= -1.4e-280) {
tmp = t_1;
} else if (y <= 9.6e-301) {
tmp = a * (z * b);
} else if (y <= 1.42e+71) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (t * a)
t_2 = x + (y * z)
if (y <= (-2.6d+39)) then
tmp = t_2
else if (y <= (-1.4d-280)) then
tmp = t_1
else if (y <= 9.6d-301) then
tmp = a * (z * b)
else if (y <= 1.42d+71) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = x + (y * z);
double tmp;
if (y <= -2.6e+39) {
tmp = t_2;
} else if (y <= -1.4e-280) {
tmp = t_1;
} else if (y <= 9.6e-301) {
tmp = a * (z * b);
} else if (y <= 1.42e+71) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = x + (y * z) tmp = 0 if y <= -2.6e+39: tmp = t_2 elif y <= -1.4e-280: tmp = t_1 elif y <= 9.6e-301: tmp = a * (z * b) elif y <= 1.42e+71: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(x + Float64(y * z)) tmp = 0.0 if (y <= -2.6e+39) tmp = t_2; elseif (y <= -1.4e-280) tmp = t_1; elseif (y <= 9.6e-301) tmp = Float64(a * Float64(z * b)); elseif (y <= 1.42e+71) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = x + (y * z); tmp = 0.0; if (y <= -2.6e+39) tmp = t_2; elseif (y <= -1.4e-280) tmp = t_1; elseif (y <= 9.6e-301) tmp = a * (z * b); elseif (y <= 1.42e+71) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.6e+39], t$95$2, If[LessEqual[y, -1.4e-280], t$95$1, If[LessEqual[y, 9.6e-301], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.42e+71], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := x + y \cdot z\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+39}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-280}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-301}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;y \leq 1.42 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.6e39 or 1.42000000000000012e71 < y Initial program 92.4%
associate-+l+92.4%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around 0 67.6%
if -2.6e39 < y < -1.40000000000000009e-280 or 9.59999999999999964e-301 < y < 1.42000000000000012e71Initial program 95.3%
associate-+l+95.3%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in z around 0 69.4%
+-commutative69.4%
Simplified69.4%
if -1.40000000000000009e-280 < y < 9.59999999999999964e-301Initial program 88.5%
associate-+l+88.5%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in a around inf 89.5%
Taylor expanded in b around inf 78.1%
Final simplification68.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.5) (not (<= z 2.45e-88))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ x (+ (* y z) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.5) || !(z <= 2.45e-88)) {
tmp = z * (y + ((x / z) + (a * (b + (t / 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 <= (-6.5d0)) .or. (.not. (z <= 2.45d-88))) then
tmp = z * (y + ((x / z) + (a * (b + (t / 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 <= -6.5) || !(z <= 2.45e-88)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + ((y * z) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.5) or not (z <= 2.45e-88): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = x + ((y * z) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.5) || !(z <= 2.45e-88)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(x + Float64(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 <= -6.5) || ~((z <= 2.45e-88))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = x + ((y * z) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.5], N[Not[LessEqual[z, 2.45e-88]], $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[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \lor \neg \left(z \leq 2.45 \cdot 10^{-88}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\end{array}
\end{array}
if z < -6.5 or 2.45000000000000014e-88 < z Initial program 89.3%
associate-+l+89.3%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in z around inf 96.4%
+-commutative96.4%
associate-+l+96.4%
+-commutative96.4%
associate-/l*97.2%
distribute-lft-out97.9%
Simplified97.9%
if -6.5 < z < 2.45000000000000014e-88Initial program 98.9%
associate-+l+98.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in b around 0 90.6%
Final simplification94.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.55e+34)
(* y z)
(if (<= y -2.25e-267)
x
(if (<= y 9e-132) (* t a) (if (<= y 1.5e+71) x (* y z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.55e+34) {
tmp = y * z;
} else if (y <= -2.25e-267) {
tmp = x;
} else if (y <= 9e-132) {
tmp = t * a;
} else if (y <= 1.5e+71) {
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 <= (-1.55d+34)) then
tmp = y * z
else if (y <= (-2.25d-267)) then
tmp = x
else if (y <= 9d-132) then
tmp = t * a
else if (y <= 1.5d+71) 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 <= -1.55e+34) {
tmp = y * z;
} else if (y <= -2.25e-267) {
tmp = x;
} else if (y <= 9e-132) {
tmp = t * a;
} else if (y <= 1.5e+71) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.55e+34: tmp = y * z elif y <= -2.25e-267: tmp = x elif y <= 9e-132: tmp = t * a elif y <= 1.5e+71: tmp = x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.55e+34) tmp = Float64(y * z); elseif (y <= -2.25e-267) tmp = x; elseif (y <= 9e-132) tmp = Float64(t * a); elseif (y <= 1.5e+71) 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 <= -1.55e+34) tmp = y * z; elseif (y <= -2.25e-267) tmp = x; elseif (y <= 9e-132) tmp = t * a; elseif (y <= 1.5e+71) tmp = x; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.55e+34], N[(y * z), $MachinePrecision], If[LessEqual[y, -2.25e-267], x, If[LessEqual[y, 9e-132], N[(t * a), $MachinePrecision], If[LessEqual[y, 1.5e+71], x, N[(y * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+34}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{-267}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-132}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+71}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -1.54999999999999989e34 or 1.50000000000000006e71 < y Initial program 92.4%
associate-+l+92.4%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in y around inf 56.1%
*-commutative56.1%
Simplified56.1%
if -1.54999999999999989e34 < y < -2.25e-267 or 8.9999999999999999e-132 < y < 1.50000000000000006e71Initial program 94.7%
associate-+l+94.7%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in x around inf 41.3%
if -2.25e-267 < y < 8.9999999999999999e-132Initial program 95.2%
associate-+l+95.2%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in t around inf 40.1%
Final simplification47.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y z) (* t a))))
(if (<= y -1.25e+38)
t_1
(if (<= y 3e+89)
(+ x (* a (+ t (* z b))))
(if (<= y 3.2e+226) t_1 (+ x (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * z) + (t * a);
double tmp;
if (y <= -1.25e+38) {
tmp = t_1;
} else if (y <= 3e+89) {
tmp = x + (a * (t + (z * b)));
} else if (y <= 3.2e+226) {
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 = (y * z) + (t * a)
if (y <= (-1.25d+38)) then
tmp = t_1
else if (y <= 3d+89) then
tmp = x + (a * (t + (z * b)))
else if (y <= 3.2d+226) 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 = (y * z) + (t * a);
double tmp;
if (y <= -1.25e+38) {
tmp = t_1;
} else if (y <= 3e+89) {
tmp = x + (a * (t + (z * b)));
} else if (y <= 3.2e+226) {
tmp = t_1;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * z) + (t * a) tmp = 0 if y <= -1.25e+38: tmp = t_1 elif y <= 3e+89: tmp = x + (a * (t + (z * b))) elif y <= 3.2e+226: tmp = t_1 else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * z) + Float64(t * a)) tmp = 0.0 if (y <= -1.25e+38) tmp = t_1; elseif (y <= 3e+89) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (y <= 3.2e+226) 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 = (y * z) + (t * a); tmp = 0.0; if (y <= -1.25e+38) tmp = t_1; elseif (y <= 3e+89) tmp = x + (a * (t + (z * b))); elseif (y <= 3.2e+226) 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[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+38], t$95$1, If[LessEqual[y, 3e+89], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+226], t$95$1, N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z + t \cdot a\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+89}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if y < -1.24999999999999992e38 or 3.00000000000000013e89 < y < 3.19999999999999977e226Initial program 94.6%
associate-+l+94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in b around 0 92.7%
Taylor expanded in x around 0 84.3%
if -1.24999999999999992e38 < y < 3.00000000000000013e89Initial program 93.7%
associate-+l+93.7%
+-commutative93.7%
fma-define93.7%
associate-*l*95.3%
*-commutative95.3%
*-commutative95.3%
distribute-rgt-out96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in y around 0 91.3%
if 3.19999999999999977e226 < y Initial program 90.1%
associate-+l+90.1%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in a around 0 65.9%
Final simplification86.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.3e+35) (not (<= y 2.25e-86))) (+ x (+ (* y z) (* t a))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.3e+35) || !(y <= 2.25e-86)) {
tmp = x + ((y * z) + (t * a));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.3d+35)) .or. (.not. (y <= 2.25d-86))) then
tmp = x + ((y * z) + (t * a))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.3e+35) || !(y <= 2.25e-86)) {
tmp = x + ((y * z) + (t * a));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.3e+35) or not (y <= 2.25e-86): tmp = x + ((y * z) + (t * a)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.3e+35) || !(y <= 2.25e-86)) tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.3e+35) || ~((y <= 2.25e-86))) tmp = x + ((y * z) + (t * a)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.3e+35], N[Not[LessEqual[y, 2.25e-86]], $MachinePrecision]], N[(x + N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+35} \lor \neg \left(y \leq 2.25 \cdot 10^{-86}\right):\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if y < -1.30000000000000003e35 or 2.2499999999999999e-86 < y Initial program 93.0%
associate-+l+93.0%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in b around 0 87.1%
if -1.30000000000000003e35 < y < 2.2499999999999999e-86Initial program 94.6%
associate-+l+94.6%
+-commutative94.6%
fma-define94.6%
associate-*l*95.8%
*-commutative95.8%
*-commutative95.8%
distribute-rgt-out96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in y around 0 95.0%
Final simplification90.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.8e+68) x (if (<= x 3.4e+79) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.8e+68) {
tmp = x;
} else if (x <= 3.4e+79) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-3.8d+68)) then
tmp = x
else if (x <= 3.4d+79) then
tmp = t * a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.8e+68) {
tmp = x;
} else if (x <= 3.4e+79) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.8e+68: tmp = x elif x <= 3.4e+79: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.8e+68) tmp = x; elseif (x <= 3.4e+79) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -3.8e+68) tmp = x; elseif (x <= 3.4e+79) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.8e+68], x, If[LessEqual[x, 3.4e+79], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+68}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+79}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.8000000000000001e68 or 3.40000000000000032e79 < x Initial program 94.7%
associate-+l+94.7%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in x around inf 53.9%
if -3.8000000000000001e68 < x < 3.40000000000000032e79Initial program 93.1%
associate-+l+93.1%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in t around inf 35.6%
Final simplification42.4%
(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.7%
associate-+l+93.7%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around inf 26.2%
Final simplification26.2%
(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 2024071
(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)))