
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* t a) (+ x (* y z))) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (x + (y * z))) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (x + (y * z))) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t * a) + (x + (y * z))) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t * a) + (x + (y * z))) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot a + \left(x + y \cdot z\right)\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 99.6%
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.9%
Simplified5.9%
Taylor expanded in z around inf 82.4%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -3.6e+84)
x
(if (<= x -1.38e-74)
(* y z)
(if (<= x -1.9e-95)
(* t a)
(if (<= x -1.65e-208)
(* y z)
(if (<= x -2.1e-294)
(* t a)
(if (<= x 4.7e-306)
(* y z)
(if (<= x 1.12e-35) (* t a) (if (<= x 8.8e+77) (* y z) x)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.6e+84) {
tmp = x;
} else if (x <= -1.38e-74) {
tmp = y * z;
} else if (x <= -1.9e-95) {
tmp = t * a;
} else if (x <= -1.65e-208) {
tmp = y * z;
} else if (x <= -2.1e-294) {
tmp = t * a;
} else if (x <= 4.7e-306) {
tmp = y * z;
} else if (x <= 1.12e-35) {
tmp = t * a;
} else if (x <= 8.8e+77) {
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 <= (-3.6d+84)) then
tmp = x
else if (x <= (-1.38d-74)) then
tmp = y * z
else if (x <= (-1.9d-95)) then
tmp = t * a
else if (x <= (-1.65d-208)) then
tmp = y * z
else if (x <= (-2.1d-294)) then
tmp = t * a
else if (x <= 4.7d-306) then
tmp = y * z
else if (x <= 1.12d-35) then
tmp = t * a
else if (x <= 8.8d+77) 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 <= -3.6e+84) {
tmp = x;
} else if (x <= -1.38e-74) {
tmp = y * z;
} else if (x <= -1.9e-95) {
tmp = t * a;
} else if (x <= -1.65e-208) {
tmp = y * z;
} else if (x <= -2.1e-294) {
tmp = t * a;
} else if (x <= 4.7e-306) {
tmp = y * z;
} else if (x <= 1.12e-35) {
tmp = t * a;
} else if (x <= 8.8e+77) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.6e+84: tmp = x elif x <= -1.38e-74: tmp = y * z elif x <= -1.9e-95: tmp = t * a elif x <= -1.65e-208: tmp = y * z elif x <= -2.1e-294: tmp = t * a elif x <= 4.7e-306: tmp = y * z elif x <= 1.12e-35: tmp = t * a elif x <= 8.8e+77: tmp = y * z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.6e+84) tmp = x; elseif (x <= -1.38e-74) tmp = Float64(y * z); elseif (x <= -1.9e-95) tmp = Float64(t * a); elseif (x <= -1.65e-208) tmp = Float64(y * z); elseif (x <= -2.1e-294) tmp = Float64(t * a); elseif (x <= 4.7e-306) tmp = Float64(y * z); elseif (x <= 1.12e-35) tmp = Float64(t * a); elseif (x <= 8.8e+77) 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 <= -3.6e+84) tmp = x; elseif (x <= -1.38e-74) tmp = y * z; elseif (x <= -1.9e-95) tmp = t * a; elseif (x <= -1.65e-208) tmp = y * z; elseif (x <= -2.1e-294) tmp = t * a; elseif (x <= 4.7e-306) tmp = y * z; elseif (x <= 1.12e-35) tmp = t * a; elseif (x <= 8.8e+77) tmp = y * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.6e+84], x, If[LessEqual[x, -1.38e-74], N[(y * z), $MachinePrecision], If[LessEqual[x, -1.9e-95], N[(t * a), $MachinePrecision], If[LessEqual[x, -1.65e-208], N[(y * z), $MachinePrecision], If[LessEqual[x, -2.1e-294], N[(t * a), $MachinePrecision], If[LessEqual[x, 4.7e-306], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.12e-35], N[(t * a), $MachinePrecision], If[LessEqual[x, 8.8e+77], N[(y * z), $MachinePrecision], x]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+84}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.38 \cdot 10^{-74}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-95}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-208}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-294}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{-306}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{-35}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{+77}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.5999999999999999e84 or 8.8000000000000002e77 < x Initial program 91.5%
associate-+l+91.5%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in x around inf 65.3%
if -3.5999999999999999e84 < x < -1.38e-74 or -1.8999999999999999e-95 < x < -1.65000000000000003e-208 or -2.09999999999999984e-294 < x < 4.7000000000000001e-306 or 1.12e-35 < x < 8.8000000000000002e77Initial program 95.1%
associate-+l+95.1%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in y around inf 51.8%
*-commutative51.8%
Simplified51.8%
if -1.38e-74 < x < -1.8999999999999999e-95 or -1.65000000000000003e-208 < x < -2.09999999999999984e-294 or 4.7000000000000001e-306 < x < 1.12e-35Initial program 92.4%
associate-+l+92.4%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in t around inf 50.1%
Final simplification55.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (* z (+ y (* a b)))))
(if (<= z -6.8e-35)
t_2
(if (<= z 6.6e-22)
t_1
(if (<= z 410000000.0)
t_2
(if (<= z 6.5e+59)
t_1
(if (or (<= z 9.5e+128) (not (<= z 2.6e+154)))
t_2
(+ x (* y z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -6.8e-35) {
tmp = t_2;
} else if (z <= 6.6e-22) {
tmp = t_1;
} else if (z <= 410000000.0) {
tmp = t_2;
} else if (z <= 6.5e+59) {
tmp = t_1;
} else if ((z <= 9.5e+128) || !(z <= 2.6e+154)) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x + (t * a)
t_2 = z * (y + (a * b))
if (z <= (-6.8d-35)) then
tmp = t_2
else if (z <= 6.6d-22) then
tmp = t_1
else if (z <= 410000000.0d0) then
tmp = t_2
else if (z <= 6.5d+59) then
tmp = t_1
else if ((z <= 9.5d+128) .or. (.not. (z <= 2.6d+154))) then
tmp = t_2
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 t_2 = z * (y + (a * b));
double tmp;
if (z <= -6.8e-35) {
tmp = t_2;
} else if (z <= 6.6e-22) {
tmp = t_1;
} else if (z <= 410000000.0) {
tmp = t_2;
} else if (z <= 6.5e+59) {
tmp = t_1;
} else if ((z <= 9.5e+128) || !(z <= 2.6e+154)) {
tmp = t_2;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = z * (y + (a * b)) tmp = 0 if z <= -6.8e-35: tmp = t_2 elif z <= 6.6e-22: tmp = t_1 elif z <= 410000000.0: tmp = t_2 elif z <= 6.5e+59: tmp = t_1 elif (z <= 9.5e+128) or not (z <= 2.6e+154): tmp = t_2 else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -6.8e-35) tmp = t_2; elseif (z <= 6.6e-22) tmp = t_1; elseif (z <= 410000000.0) tmp = t_2; elseif (z <= 6.5e+59) tmp = t_1; elseif ((z <= 9.5e+128) || !(z <= 2.6e+154)) tmp = t_2; 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); t_2 = z * (y + (a * b)); tmp = 0.0; if (z <= -6.8e-35) tmp = t_2; elseif (z <= 6.6e-22) tmp = t_1; elseif (z <= 410000000.0) tmp = t_2; elseif (z <= 6.5e+59) tmp = t_1; elseif ((z <= 9.5e+128) || ~((z <= 2.6e+154))) tmp = t_2; 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]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e-35], t$95$2, If[LessEqual[z, 6.6e-22], t$95$1, If[LessEqual[z, 410000000.0], t$95$2, If[LessEqual[z, 6.5e+59], t$95$1, If[Or[LessEqual[z, 9.5e+128], N[Not[LessEqual[z, 2.6e+154]], $MachinePrecision]], t$95$2, N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{-35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 410000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+128} \lor \neg \left(z \leq 2.6 \cdot 10^{+154}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if z < -6.8000000000000005e-35 or 6.6000000000000002e-22 < z < 4.1e8 or 6.50000000000000021e59 < z < 9.50000000000000014e128 or 2.59999999999999989e154 < z Initial program 87.2%
associate-+l+87.2%
associate-*l*81.5%
Simplified81.5%
Taylor expanded in z around inf 81.7%
if -6.8000000000000005e-35 < z < 6.6000000000000002e-22 or 4.1e8 < z < 6.50000000000000021e59Initial program 98.5%
associate-+l+98.5%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in z around 0 79.6%
if 9.50000000000000014e128 < z < 2.59999999999999989e154Initial program 88.9%
associate-+l+88.9%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in a around 0 88.9%
Final simplification80.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= a -1.75e+99)
t_1
(if (<= a -4.4e-6)
(* t a)
(if (<= a -4.8e-123)
(* y z)
(if (<= a 9.5e-293)
x
(if (<= a 1.1e-36) (* y z) (if (<= a 7e+78) t_1 (* t a)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (a <= -1.75e+99) {
tmp = t_1;
} else if (a <= -4.4e-6) {
tmp = t * a;
} else if (a <= -4.8e-123) {
tmp = y * z;
} else if (a <= 9.5e-293) {
tmp = x;
} else if (a <= 1.1e-36) {
tmp = y * z;
} else if (a <= 7e+78) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = z * (a * b)
if (a <= (-1.75d+99)) then
tmp = t_1
else if (a <= (-4.4d-6)) then
tmp = t * a
else if (a <= (-4.8d-123)) then
tmp = y * z
else if (a <= 9.5d-293) then
tmp = x
else if (a <= 1.1d-36) then
tmp = y * z
else if (a <= 7d+78) then
tmp = t_1
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 t_1 = z * (a * b);
double tmp;
if (a <= -1.75e+99) {
tmp = t_1;
} else if (a <= -4.4e-6) {
tmp = t * a;
} else if (a <= -4.8e-123) {
tmp = y * z;
} else if (a <= 9.5e-293) {
tmp = x;
} else if (a <= 1.1e-36) {
tmp = y * z;
} else if (a <= 7e+78) {
tmp = t_1;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if a <= -1.75e+99: tmp = t_1 elif a <= -4.4e-6: tmp = t * a elif a <= -4.8e-123: tmp = y * z elif a <= 9.5e-293: tmp = x elif a <= 1.1e-36: tmp = y * z elif a <= 7e+78: tmp = t_1 else: tmp = t * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (a <= -1.75e+99) tmp = t_1; elseif (a <= -4.4e-6) tmp = Float64(t * a); elseif (a <= -4.8e-123) tmp = Float64(y * z); elseif (a <= 9.5e-293) tmp = x; elseif (a <= 1.1e-36) tmp = Float64(y * z); elseif (a <= 7e+78) tmp = t_1; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (a <= -1.75e+99) tmp = t_1; elseif (a <= -4.4e-6) tmp = t * a; elseif (a <= -4.8e-123) tmp = y * z; elseif (a <= 9.5e-293) tmp = x; elseif (a <= 1.1e-36) tmp = y * z; elseif (a <= 7e+78) tmp = t_1; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.75e+99], t$95$1, If[LessEqual[a, -4.4e-6], N[(t * a), $MachinePrecision], If[LessEqual[a, -4.8e-123], N[(y * z), $MachinePrecision], If[LessEqual[a, 9.5e-293], x, If[LessEqual[a, 1.1e-36], N[(y * z), $MachinePrecision], If[LessEqual[a, 7e+78], t$95$1, N[(t * a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;a \leq -1.75 \cdot 10^{+99}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -4.4 \cdot 10^{-6}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -4.8 \cdot 10^{-123}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-293}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-36}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -1.7499999999999999e99 or 1.1e-36 < a < 7.0000000000000003e78Initial program 88.4%
associate-+l+88.4%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in z around inf 61.0%
Taylor expanded in a around inf 49.5%
*-commutative49.5%
Simplified49.5%
if -1.7499999999999999e99 < a < -4.4000000000000002e-6 or 7.0000000000000003e78 < a Initial program 89.1%
associate-+l+89.1%
associate-*l*89.1%
Simplified89.1%
Taylor expanded in t around inf 54.6%
if -4.4000000000000002e-6 < a < -4.8e-123 or 9.50000000000000049e-293 < a < 1.1e-36Initial program 98.5%
associate-+l+98.5%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in y around inf 51.3%
*-commutative51.3%
Simplified51.3%
if -4.8e-123 < a < 9.50000000000000049e-293Initial program 96.3%
associate-+l+96.3%
associate-*l*90.9%
Simplified90.9%
Taylor expanded in x around inf 57.3%
Final simplification52.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.3e+99)
(* a (* z b))
(if (<= a -0.0016)
(* t a)
(if (<= a -1.85e-124)
(* y z)
(if (<= a 9.2e-299)
x
(if (<= a 3.3e-37)
(* y z)
(if (<= a 9.6e+85) (* z (* a b)) (* t a))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.3e+99) {
tmp = a * (z * b);
} else if (a <= -0.0016) {
tmp = t * a;
} else if (a <= -1.85e-124) {
tmp = y * z;
} else if (a <= 9.2e-299) {
tmp = x;
} else if (a <= 3.3e-37) {
tmp = y * z;
} else if (a <= 9.6e+85) {
tmp = z * (a * b);
} 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.3d+99)) then
tmp = a * (z * b)
else if (a <= (-0.0016d0)) then
tmp = t * a
else if (a <= (-1.85d-124)) then
tmp = y * z
else if (a <= 9.2d-299) then
tmp = x
else if (a <= 3.3d-37) then
tmp = y * z
else if (a <= 9.6d+85) then
tmp = z * (a * b)
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.3e+99) {
tmp = a * (z * b);
} else if (a <= -0.0016) {
tmp = t * a;
} else if (a <= -1.85e-124) {
tmp = y * z;
} else if (a <= 9.2e-299) {
tmp = x;
} else if (a <= 3.3e-37) {
tmp = y * z;
} else if (a <= 9.6e+85) {
tmp = z * (a * b);
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.3e+99: tmp = a * (z * b) elif a <= -0.0016: tmp = t * a elif a <= -1.85e-124: tmp = y * z elif a <= 9.2e-299: tmp = x elif a <= 3.3e-37: tmp = y * z elif a <= 9.6e+85: tmp = z * (a * b) else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.3e+99) tmp = Float64(a * Float64(z * b)); elseif (a <= -0.0016) tmp = Float64(t * a); elseif (a <= -1.85e-124) tmp = Float64(y * z); elseif (a <= 9.2e-299) tmp = x; elseif (a <= 3.3e-37) tmp = Float64(y * z); elseif (a <= 9.6e+85) tmp = Float64(z * Float64(a * b)); 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.3e+99) tmp = a * (z * b); elseif (a <= -0.0016) tmp = t * a; elseif (a <= -1.85e-124) tmp = y * z; elseif (a <= 9.2e-299) tmp = x; elseif (a <= 3.3e-37) tmp = y * z; elseif (a <= 9.6e+85) tmp = z * (a * b); else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.3e+99], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -0.0016], N[(t * a), $MachinePrecision], If[LessEqual[a, -1.85e-124], N[(y * z), $MachinePrecision], If[LessEqual[a, 9.2e-299], x, If[LessEqual[a, 3.3e-37], N[(y * z), $MachinePrecision], If[LessEqual[a, 9.6e+85], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(t * a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+99}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -0.0016:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -1.85 \cdot 10^{-124}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 9.2 \cdot 10^{-299}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{-37}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 9.6 \cdot 10^{+85}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -2.30000000000000019e99Initial program 82.2%
associate-+l+82.2%
associate-*l*84.3%
Simplified84.3%
Taylor expanded in a around inf 71.1%
Taylor expanded in t around 0 52.6%
if -2.30000000000000019e99 < a < -0.00160000000000000008 or 9.59999999999999986e85 < a Initial program 89.1%
associate-+l+89.1%
associate-*l*89.1%
Simplified89.1%
Taylor expanded in t around inf 54.6%
if -0.00160000000000000008 < a < -1.84999999999999995e-124 or 9.2000000000000003e-299 < a < 3.29999999999999982e-37Initial program 98.5%
associate-+l+98.5%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in y around inf 51.3%
*-commutative51.3%
Simplified51.3%
if -1.84999999999999995e-124 < a < 9.2000000000000003e-299Initial program 96.3%
associate-+l+96.3%
associate-*l*90.9%
Simplified90.9%
Taylor expanded in x around inf 57.3%
if 3.29999999999999982e-37 < a < 9.59999999999999986e85Initial program 99.9%
associate-+l+99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around inf 63.0%
Taylor expanded in a around inf 51.2%
*-commutative51.2%
Simplified51.2%
Final simplification53.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (* z (+ y (* a b)))))
(if (<= z -8e-35)
t_2
(if (<= z 5.5e-26)
t_1
(if (<= z 245000000.0)
t_2
(if (<= z 1.9e+42)
t_1
(if (<= z 8e+153) (+ x (* b (* z a))) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -8e-35) {
tmp = t_2;
} else if (z <= 5.5e-26) {
tmp = t_1;
} else if (z <= 245000000.0) {
tmp = t_2;
} else if (z <= 1.9e+42) {
tmp = t_1;
} else if (z <= 8e+153) {
tmp = x + (b * (z * 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 + (t * a)
t_2 = z * (y + (a * b))
if (z <= (-8d-35)) then
tmp = t_2
else if (z <= 5.5d-26) then
tmp = t_1
else if (z <= 245000000.0d0) then
tmp = t_2
else if (z <= 1.9d+42) then
tmp = t_1
else if (z <= 8d+153) then
tmp = x + (b * (z * 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 + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -8e-35) {
tmp = t_2;
} else if (z <= 5.5e-26) {
tmp = t_1;
} else if (z <= 245000000.0) {
tmp = t_2;
} else if (z <= 1.9e+42) {
tmp = t_1;
} else if (z <= 8e+153) {
tmp = x + (b * (z * a));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = z * (y + (a * b)) tmp = 0 if z <= -8e-35: tmp = t_2 elif z <= 5.5e-26: tmp = t_1 elif z <= 245000000.0: tmp = t_2 elif z <= 1.9e+42: tmp = t_1 elif z <= 8e+153: tmp = x + (b * (z * a)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -8e-35) tmp = t_2; elseif (z <= 5.5e-26) tmp = t_1; elseif (z <= 245000000.0) tmp = t_2; elseif (z <= 1.9e+42) tmp = t_1; elseif (z <= 8e+153) tmp = Float64(x + Float64(b * Float64(z * a))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = z * (y + (a * b)); tmp = 0.0; if (z <= -8e-35) tmp = t_2; elseif (z <= 5.5e-26) tmp = t_1; elseif (z <= 245000000.0) tmp = t_2; elseif (z <= 1.9e+42) tmp = t_1; elseif (z <= 8e+153) tmp = x + (b * (z * a)); 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[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e-35], t$95$2, If[LessEqual[z, 5.5e-26], t$95$1, If[LessEqual[z, 245000000.0], t$95$2, If[LessEqual[z, 1.9e+42], t$95$1, If[LessEqual[z, 8e+153], N[(x + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{-35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 245000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+153}:\\
\;\;\;\;x + b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -8.00000000000000006e-35 or 5.5000000000000005e-26 < z < 2.45e8 or 8e153 < z Initial program 86.4%
associate-+l+86.4%
associate-*l*80.8%
Simplified80.8%
Taylor expanded in z around inf 83.3%
if -8.00000000000000006e-35 < z < 5.5000000000000005e-26 or 2.45e8 < z < 1.8999999999999999e42Initial program 98.4%
associate-+l+98.4%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in z around 0 79.9%
if 1.8999999999999999e42 < z < 8e153Initial program 92.2%
associate-+l+92.2%
+-commutative92.2%
*-commutative92.2%
associate-*l*84.9%
distribute-lft-out88.7%
fma-def88.7%
+-commutative88.7%
fma-def88.8%
Simplified88.8%
Taylor expanded in y around 0 73.2%
Taylor expanded in z around inf 58.5%
*-commutative58.5%
*-commutative58.5%
associate-*l*73.1%
Simplified73.1%
Final simplification80.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.25e-80)
(+ (* a (* z b)) (+ x (* y z)))
(if (<= x 1.6e+16)
(+ (* b (* z a)) (+ (* t a) (* y z)))
(+ x (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.25e-80) {
tmp = (a * (z * b)) + (x + (y * z));
} else if (x <= 1.6e+16) {
tmp = (b * (z * a)) + ((t * a) + (y * z));
} 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 (x <= (-1.25d-80)) then
tmp = (a * (z * b)) + (x + (y * z))
else if (x <= 1.6d+16) then
tmp = (b * (z * a)) + ((t * a) + (y * z))
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 (x <= -1.25e-80) {
tmp = (a * (z * b)) + (x + (y * z));
} else if (x <= 1.6e+16) {
tmp = (b * (z * a)) + ((t * a) + (y * z));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.25e-80: tmp = (a * (z * b)) + (x + (y * z)) elif x <= 1.6e+16: tmp = (b * (z * a)) + ((t * a) + (y * z)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.25e-80) tmp = Float64(Float64(a * Float64(z * b)) + Float64(x + Float64(y * z))); elseif (x <= 1.6e+16) tmp = Float64(Float64(b * Float64(z * a)) + Float64(Float64(t * a) + Float64(y * z))); 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 (x <= -1.25e-80) tmp = (a * (z * b)) + (x + (y * z)); elseif (x <= 1.6e+16) tmp = (b * (z * a)) + ((t * a) + (y * z)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.25e-80], N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e+16], N[(N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-80}:\\
\;\;\;\;a \cdot \left(z \cdot b\right) + \left(x + y \cdot z\right)\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+16}:\\
\;\;\;\;b \cdot \left(z \cdot a\right) + \left(t \cdot a + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if x < -1.25e-80Initial program 94.7%
associate-+l+94.7%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in t around 0 83.6%
if -1.25e-80 < x < 1.6e16Initial program 93.3%
Taylor expanded in x around 0 89.3%
if 1.6e16 < x Initial program 90.2%
associate-+l+90.2%
+-commutative90.2%
*-commutative90.2%
associate-*l*85.5%
distribute-lft-out85.5%
fma-def87.1%
+-commutative87.1%
fma-def87.1%
Simplified87.1%
Taylor expanded in y around 0 80.8%
Final simplification85.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z 7.6e+154) (+ (+ (* a (* z b)) (* t a)) (+ x (* y z))) (* z (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 7.6e+154) {
tmp = ((a * (z * b)) + (t * a)) + (x + (y * z));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 7.6d+154) then
tmp = ((a * (z * b)) + (t * a)) + (x + (y * z))
else
tmp = z * (y + (a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 7.6e+154) {
tmp = ((a * (z * b)) + (t * a)) + (x + (y * z));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 7.6e+154: tmp = ((a * (z * b)) + (t * a)) + (x + (y * z)) else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 7.6e+154) tmp = Float64(Float64(Float64(a * Float64(z * b)) + Float64(t * a)) + Float64(x + Float64(y * z))); else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 7.6e+154) tmp = ((a * (z * b)) + (t * a)) + (x + (y * z)); else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 7.6e+154], N[(N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.6 \cdot 10^{+154}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + t \cdot a\right) + \left(x + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 7.5999999999999996e154Initial program 95.2%
associate-+l+95.2%
associate-*l*93.1%
Simplified93.1%
if 7.5999999999999996e154 < z Initial program 75.0%
associate-+l+75.0%
associate-*l*67.9%
Simplified67.9%
Taylor expanded in z around inf 100.0%
Final simplification93.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))))
(if (<= a -1.25e+265)
t_1
(if (<= a -1.35e+167)
(* a (* z b))
(if (<= a -0.00085)
t_1
(if (<= a 1.2e+50)
(+ x (* y z))
(if (<= a 3.8e+78) (* z (* a b)) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double tmp;
if (a <= -1.25e+265) {
tmp = t_1;
} else if (a <= -1.35e+167) {
tmp = a * (z * b);
} else if (a <= -0.00085) {
tmp = t_1;
} else if (a <= 1.2e+50) {
tmp = x + (y * z);
} else if (a <= 3.8e+78) {
tmp = z * (a * b);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (t * a)
if (a <= (-1.25d+265)) then
tmp = t_1
else if (a <= (-1.35d+167)) then
tmp = a * (z * b)
else if (a <= (-0.00085d0)) then
tmp = t_1
else if (a <= 1.2d+50) then
tmp = x + (y * z)
else if (a <= 3.8d+78) then
tmp = z * (a * b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double tmp;
if (a <= -1.25e+265) {
tmp = t_1;
} else if (a <= -1.35e+167) {
tmp = a * (z * b);
} else if (a <= -0.00085) {
tmp = t_1;
} else if (a <= 1.2e+50) {
tmp = x + (y * z);
} else if (a <= 3.8e+78) {
tmp = z * (a * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) tmp = 0 if a <= -1.25e+265: tmp = t_1 elif a <= -1.35e+167: tmp = a * (z * b) elif a <= -0.00085: tmp = t_1 elif a <= 1.2e+50: tmp = x + (y * z) elif a <= 3.8e+78: tmp = z * (a * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) tmp = 0.0 if (a <= -1.25e+265) tmp = t_1; elseif (a <= -1.35e+167) tmp = Float64(a * Float64(z * b)); elseif (a <= -0.00085) tmp = t_1; elseif (a <= 1.2e+50) tmp = Float64(x + Float64(y * z)); elseif (a <= 3.8e+78) tmp = Float64(z * Float64(a * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); tmp = 0.0; if (a <= -1.25e+265) tmp = t_1; elseif (a <= -1.35e+167) tmp = a * (z * b); elseif (a <= -0.00085) tmp = t_1; elseif (a <= 1.2e+50) tmp = x + (y * z); elseif (a <= 3.8e+78) tmp = z * (a * b); else tmp = t_1; 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, -1.25e+265], t$95$1, If[LessEqual[a, -1.35e+167], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -0.00085], t$95$1, If[LessEqual[a, 1.2e+50], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.8e+78], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -1.25 \cdot 10^{+265}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.35 \cdot 10^{+167}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -0.00085:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{+50}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{+78}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.25e265 or -1.35000000000000003e167 < a < -8.49999999999999953e-4 or 3.7999999999999999e78 < a Initial program 85.9%
associate-+l+85.9%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in z around 0 68.5%
if -1.25e265 < a < -1.35000000000000003e167Initial program 87.4%
associate-+l+87.4%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in a around inf 78.6%
Taylor expanded in t around 0 67.5%
if -8.49999999999999953e-4 < a < 1.2000000000000001e50Initial program 97.9%
associate-+l+97.9%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in a around 0 79.4%
if 1.2000000000000001e50 < a < 3.7999999999999999e78Initial program 99.8%
associate-+l+99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in z around inf 87.9%
Taylor expanded in a around inf 87.9%
*-commutative87.9%
Simplified87.9%
Final simplification74.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= z -2.7e+89)
(* y z)
(if (<= z -6.2e+34)
t_1
(if (<= z -8e-35) (* y z) (if (<= z 2.8e+154) (+ x (* t a)) 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 (z <= -2.7e+89) {
tmp = y * z;
} else if (z <= -6.2e+34) {
tmp = t_1;
} else if (z <= -8e-35) {
tmp = y * z;
} else if (z <= 2.8e+154) {
tmp = x + (t * a);
} 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 (z <= (-2.7d+89)) then
tmp = y * z
else if (z <= (-6.2d+34)) then
tmp = t_1
else if (z <= (-8d-35)) then
tmp = y * z
else if (z <= 2.8d+154) then
tmp = x + (t * a)
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 (z <= -2.7e+89) {
tmp = y * z;
} else if (z <= -6.2e+34) {
tmp = t_1;
} else if (z <= -8e-35) {
tmp = y * z;
} else if (z <= 2.8e+154) {
tmp = x + (t * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if z <= -2.7e+89: tmp = y * z elif z <= -6.2e+34: tmp = t_1 elif z <= -8e-35: tmp = y * z elif z <= 2.8e+154: tmp = x + (t * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (z <= -2.7e+89) tmp = Float64(y * z); elseif (z <= -6.2e+34) tmp = t_1; elseif (z <= -8e-35) tmp = Float64(y * z); elseif (z <= 2.8e+154) tmp = Float64(x + Float64(t * a)); 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 (z <= -2.7e+89) tmp = y * z; elseif (z <= -6.2e+34) tmp = t_1; elseif (z <= -8e-35) tmp = y * z; elseif (z <= 2.8e+154) tmp = x + (t * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+89], N[(y * z), $MachinePrecision], If[LessEqual[z, -6.2e+34], t$95$1, If[LessEqual[z, -8e-35], N[(y * z), $MachinePrecision], If[LessEqual[z, 2.8e+154], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+89}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-35}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+154}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.7e89 or -6.19999999999999955e34 < z < -8.00000000000000006e-35Initial program 92.6%
associate-+l+92.6%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in y around inf 60.4%
*-commutative60.4%
Simplified60.4%
if -2.7e89 < z < -6.19999999999999955e34 or 2.7999999999999999e154 < z Initial program 78.0%
associate-+l+78.0%
associate-*l*71.0%
Simplified71.0%
Taylor expanded in z around inf 90.6%
Taylor expanded in a around inf 57.3%
*-commutative57.3%
Simplified57.3%
if -8.00000000000000006e-35 < z < 2.7999999999999999e154Initial program 96.9%
associate-+l+96.9%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in z around 0 72.6%
Final simplification67.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8e-35) (not (<= z 8e+153))) (* z (+ y (* a b))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8e-35) || !(z <= 8e+153)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-8d-35)) .or. (.not. (z <= 8d+153))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8e-35) || !(z <= 8e+153)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8e-35) or not (z <= 8e+153): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8e-35) || !(z <= 8e+153)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8e-35) || ~((z <= 8e+153))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8e-35], N[Not[LessEqual[z, 8e+153]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-35} \lor \neg \left(z \leq 8 \cdot 10^{+153}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -8.00000000000000006e-35 or 8e153 < z Initial program 86.3%
associate-+l+86.3%
associate-*l*80.3%
Simplified80.3%
Taylor expanded in z around inf 83.6%
if -8.00000000000000006e-35 < z < 8e153Initial program 96.9%
associate-+l+96.9%
+-commutative96.9%
*-commutative96.9%
associate-*l*96.3%
distribute-lft-out98.1%
fma-def98.1%
+-commutative98.1%
fma-def98.1%
Simplified98.1%
Taylor expanded in y around 0 84.7%
Final simplification84.3%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.25e-37) (+ (* a (* z b)) (+ x (* y z))) (if (<= z 8e+153) (+ x (* a (+ t (* z b)))) (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.25e-37) {
tmp = (a * (z * b)) + (x + (y * z));
} else if (z <= 8e+153) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.25d-37)) then
tmp = (a * (z * b)) + (x + (y * z))
else if (z <= 8d+153) then
tmp = x + (a * (t + (z * b)))
else
tmp = z * (y + (a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.25e-37) {
tmp = (a * (z * b)) + (x + (y * z));
} else if (z <= 8e+153) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.25e-37: tmp = (a * (z * b)) + (x + (y * z)) elif z <= 8e+153: tmp = x + (a * (t + (z * b))) else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.25e-37) tmp = Float64(Float64(a * Float64(z * b)) + Float64(x + Float64(y * z))); elseif (z <= 8e+153) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.25e-37) tmp = (a * (z * b)) + (x + (y * z)); elseif (z <= 8e+153) tmp = x + (a * (t + (z * b))); else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.25e-37], N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+153], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-37}:\\
\;\;\;\;a \cdot \left(z \cdot b\right) + \left(x + y \cdot z\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+153}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < -1.2499999999999999e-37Initial program 91.0%
associate-+l+91.0%
associate-*l*85.5%
Simplified85.5%
Taylor expanded in t around 0 80.0%
if -1.2499999999999999e-37 < z < 8e153Initial program 96.9%
associate-+l+96.9%
+-commutative96.9%
*-commutative96.9%
associate-*l*96.3%
distribute-lft-out98.1%
fma-def98.1%
+-commutative98.1%
fma-def98.1%
Simplified98.1%
Taylor expanded in y around 0 84.7%
if 8e153 < z Initial program 75.0%
associate-+l+75.0%
associate-*l*67.9%
Simplified67.9%
Taylor expanded in z around inf 100.0%
Final simplification85.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3e-74) x (if (<= x 3.6e+14) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3e-74) {
tmp = x;
} else if (x <= 3.6e+14) {
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 <= (-3d-74)) then
tmp = x
else if (x <= 3.6d+14) 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 <= -3e-74) {
tmp = x;
} else if (x <= 3.6e+14) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3e-74: tmp = x elif x <= 3.6e+14: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3e-74) tmp = x; elseif (x <= 3.6e+14) 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 <= -3e-74) tmp = x; elseif (x <= 3.6e+14) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3e-74], x, If[LessEqual[x, 3.6e+14], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-74}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+14}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.00000000000000007e-74 or 3.6e14 < x Initial program 93.4%
associate-+l+93.4%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in x around inf 50.1%
if -3.00000000000000007e-74 < x < 3.6e14Initial program 92.5%
associate-+l+92.5%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in t around inf 40.2%
Final simplification45.5%
(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*90.3%
Simplified90.3%
Taylor expanded in x around inf 29.6%
Final simplification29.6%
(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 2023224
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:herbie-target
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))