
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 INFINITY) t_1 (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(t + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 98.1%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
add-cube-cbrt0.0%
pow30.0%
+-commutative0.0%
*-commutative0.0%
fma-def0.0%
Applied egg-rr0.0%
Taylor expanded in z around inf 35.7%
distribute-lft-in92.9%
*-commutative92.9%
Simplified92.9%
Final simplification97.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -30000.0)
(* y z)
(if (<= z -2.95e-133)
x
(if (<= z -1.5e-180)
(* t a)
(if (<= z 1.7e-279)
x
(if (<= z 5.9e-21)
(* t a)
(if (<= z 5.7e+41)
x
(if (or (<= z 7.5e+62)
(and (not (<= z 1.56e+100)) (<= z 2.5e+216)))
(* y z)
(* a (* z b))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -30000.0) {
tmp = y * z;
} else if (z <= -2.95e-133) {
tmp = x;
} else if (z <= -1.5e-180) {
tmp = t * a;
} else if (z <= 1.7e-279) {
tmp = x;
} else if (z <= 5.9e-21) {
tmp = t * a;
} else if (z <= 5.7e+41) {
tmp = x;
} else if ((z <= 7.5e+62) || (!(z <= 1.56e+100) && (z <= 2.5e+216))) {
tmp = y * z;
} else {
tmp = a * (z * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-30000.0d0)) then
tmp = y * z
else if (z <= (-2.95d-133)) then
tmp = x
else if (z <= (-1.5d-180)) then
tmp = t * a
else if (z <= 1.7d-279) then
tmp = x
else if (z <= 5.9d-21) then
tmp = t * a
else if (z <= 5.7d+41) then
tmp = x
else if ((z <= 7.5d+62) .or. (.not. (z <= 1.56d+100)) .and. (z <= 2.5d+216)) then
tmp = y * z
else
tmp = a * (z * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -30000.0) {
tmp = y * z;
} else if (z <= -2.95e-133) {
tmp = x;
} else if (z <= -1.5e-180) {
tmp = t * a;
} else if (z <= 1.7e-279) {
tmp = x;
} else if (z <= 5.9e-21) {
tmp = t * a;
} else if (z <= 5.7e+41) {
tmp = x;
} else if ((z <= 7.5e+62) || (!(z <= 1.56e+100) && (z <= 2.5e+216))) {
tmp = y * z;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -30000.0: tmp = y * z elif z <= -2.95e-133: tmp = x elif z <= -1.5e-180: tmp = t * a elif z <= 1.7e-279: tmp = x elif z <= 5.9e-21: tmp = t * a elif z <= 5.7e+41: tmp = x elif (z <= 7.5e+62) or (not (z <= 1.56e+100) and (z <= 2.5e+216)): tmp = y * z else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -30000.0) tmp = Float64(y * z); elseif (z <= -2.95e-133) tmp = x; elseif (z <= -1.5e-180) tmp = Float64(t * a); elseif (z <= 1.7e-279) tmp = x; elseif (z <= 5.9e-21) tmp = Float64(t * a); elseif (z <= 5.7e+41) tmp = x; elseif ((z <= 7.5e+62) || (!(z <= 1.56e+100) && (z <= 2.5e+216))) tmp = Float64(y * z); else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -30000.0) tmp = y * z; elseif (z <= -2.95e-133) tmp = x; elseif (z <= -1.5e-180) tmp = t * a; elseif (z <= 1.7e-279) tmp = x; elseif (z <= 5.9e-21) tmp = t * a; elseif (z <= 5.7e+41) tmp = x; elseif ((z <= 7.5e+62) || (~((z <= 1.56e+100)) && (z <= 2.5e+216))) tmp = y * z; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -30000.0], N[(y * z), $MachinePrecision], If[LessEqual[z, -2.95e-133], x, If[LessEqual[z, -1.5e-180], N[(t * a), $MachinePrecision], If[LessEqual[z, 1.7e-279], x, If[LessEqual[z, 5.9e-21], N[(t * a), $MachinePrecision], If[LessEqual[z, 5.7e+41], x, If[Or[LessEqual[z, 7.5e+62], And[N[Not[LessEqual[z, 1.56e+100]], $MachinePrecision], LessEqual[z, 2.5e+216]]], N[(y * z), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -30000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -2.95 \cdot 10^{-133}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-180}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-279}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{-21}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 5.7 \cdot 10^{+41}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+62} \lor \neg \left(z \leq 1.56 \cdot 10^{+100}\right) \land z \leq 2.5 \cdot 10^{+216}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if z < -3e4 or 5.70000000000000021e41 < z < 7.49999999999999998e62 or 1.55999999999999998e100 < z < 2.4999999999999999e216Initial program 92.1%
associate-+l+92.1%
*-commutative92.1%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in y around inf 51.3%
*-commutative51.3%
Simplified51.3%
if -3e4 < z < -2.94999999999999982e-133 or -1.5e-180 < z < 1.70000000000000007e-279 or 5.9000000000000003e-21 < z < 5.70000000000000021e41Initial program 98.7%
associate-+l+98.7%
*-commutative98.7%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in x around inf 53.3%
if -2.94999999999999982e-133 < z < -1.5e-180 or 1.70000000000000007e-279 < z < 5.9000000000000003e-21Initial program 97.1%
associate-+l+97.1%
*-commutative97.1%
associate-*l*89.8%
Simplified89.8%
add-cube-cbrt89.1%
pow389.2%
+-commutative89.2%
*-commutative89.2%
fma-def89.2%
Applied egg-rr89.2%
Taylor expanded in t around inf 54.0%
if 7.49999999999999998e62 < z < 1.55999999999999998e100 or 2.4999999999999999e216 < z Initial program 60.4%
associate-+l+60.4%
*-commutative60.4%
associate-*l*68.2%
Simplified68.2%
add-cube-cbrt67.9%
pow367.9%
+-commutative67.9%
*-commutative67.9%
fma-def67.9%
Applied egg-rr67.9%
Taylor expanded in z around inf 81.4%
Final simplification55.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2300000.0)
(* y z)
(if (<= z -1.02e-141)
x
(if (<= z -1.15e-181)
(* t a)
(if (<= z 4.6e-279)
x
(if (<= z 5.6e-21)
(* t a)
(if (<= z 3.6e+43)
x
(if (<= z 5.5e+62)
(* y z)
(if (<= z 1.1e+205)
(* z (* a b))
(if (<= z 2.4e+217) (* y z) (* a (* z b))))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2300000.0) {
tmp = y * z;
} else if (z <= -1.02e-141) {
tmp = x;
} else if (z <= -1.15e-181) {
tmp = t * a;
} else if (z <= 4.6e-279) {
tmp = x;
} else if (z <= 5.6e-21) {
tmp = t * a;
} else if (z <= 3.6e+43) {
tmp = x;
} else if (z <= 5.5e+62) {
tmp = y * z;
} else if (z <= 1.1e+205) {
tmp = z * (a * b);
} else if (z <= 2.4e+217) {
tmp = y * z;
} else {
tmp = a * (z * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2300000.0d0)) then
tmp = y * z
else if (z <= (-1.02d-141)) then
tmp = x
else if (z <= (-1.15d-181)) then
tmp = t * a
else if (z <= 4.6d-279) then
tmp = x
else if (z <= 5.6d-21) then
tmp = t * a
else if (z <= 3.6d+43) then
tmp = x
else if (z <= 5.5d+62) then
tmp = y * z
else if (z <= 1.1d+205) then
tmp = z * (a * b)
else if (z <= 2.4d+217) then
tmp = y * z
else
tmp = a * (z * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2300000.0) {
tmp = y * z;
} else if (z <= -1.02e-141) {
tmp = x;
} else if (z <= -1.15e-181) {
tmp = t * a;
} else if (z <= 4.6e-279) {
tmp = x;
} else if (z <= 5.6e-21) {
tmp = t * a;
} else if (z <= 3.6e+43) {
tmp = x;
} else if (z <= 5.5e+62) {
tmp = y * z;
} else if (z <= 1.1e+205) {
tmp = z * (a * b);
} else if (z <= 2.4e+217) {
tmp = y * z;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2300000.0: tmp = y * z elif z <= -1.02e-141: tmp = x elif z <= -1.15e-181: tmp = t * a elif z <= 4.6e-279: tmp = x elif z <= 5.6e-21: tmp = t * a elif z <= 3.6e+43: tmp = x elif z <= 5.5e+62: tmp = y * z elif z <= 1.1e+205: tmp = z * (a * b) elif z <= 2.4e+217: tmp = y * z else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2300000.0) tmp = Float64(y * z); elseif (z <= -1.02e-141) tmp = x; elseif (z <= -1.15e-181) tmp = Float64(t * a); elseif (z <= 4.6e-279) tmp = x; elseif (z <= 5.6e-21) tmp = Float64(t * a); elseif (z <= 3.6e+43) tmp = x; elseif (z <= 5.5e+62) tmp = Float64(y * z); elseif (z <= 1.1e+205) tmp = Float64(z * Float64(a * b)); elseif (z <= 2.4e+217) tmp = Float64(y * z); else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2300000.0) tmp = y * z; elseif (z <= -1.02e-141) tmp = x; elseif (z <= -1.15e-181) tmp = t * a; elseif (z <= 4.6e-279) tmp = x; elseif (z <= 5.6e-21) tmp = t * a; elseif (z <= 3.6e+43) tmp = x; elseif (z <= 5.5e+62) tmp = y * z; elseif (z <= 1.1e+205) tmp = z * (a * b); elseif (z <= 2.4e+217) tmp = y * z; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2300000.0], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.02e-141], x, If[LessEqual[z, -1.15e-181], N[(t * a), $MachinePrecision], If[LessEqual[z, 4.6e-279], x, If[LessEqual[z, 5.6e-21], N[(t * a), $MachinePrecision], If[LessEqual[z, 3.6e+43], x, If[LessEqual[z, 5.5e+62], N[(y * z), $MachinePrecision], If[LessEqual[z, 1.1e+205], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+217], N[(y * z), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2300000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-141}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-181}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-279}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-21}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+43}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+62}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+205}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+217}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if z < -2.3e6 or 3.6000000000000001e43 < z < 5.4999999999999997e62 or 1.0999999999999999e205 < z < 2.3999999999999998e217Initial program 91.7%
associate-+l+91.7%
*-commutative91.7%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in y around inf 56.8%
*-commutative56.8%
Simplified56.8%
if -2.3e6 < z < -1.02e-141 or -1.14999999999999995e-181 < z < 4.5999999999999999e-279 or 5.60000000000000008e-21 < z < 3.6000000000000001e43Initial program 98.7%
associate-+l+98.7%
*-commutative98.7%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in x around inf 53.3%
if -1.02e-141 < z < -1.14999999999999995e-181 or 4.5999999999999999e-279 < z < 5.60000000000000008e-21Initial program 97.1%
associate-+l+97.1%
*-commutative97.1%
associate-*l*89.8%
Simplified89.8%
add-cube-cbrt89.1%
pow389.2%
+-commutative89.2%
*-commutative89.2%
fma-def89.2%
Applied egg-rr89.2%
Taylor expanded in t around inf 54.0%
if 5.4999999999999997e62 < z < 1.0999999999999999e205Initial program 92.2%
associate-+l+92.2%
*-commutative92.2%
associate-*l*95.6%
Simplified95.6%
add-cube-cbrt95.1%
pow395.1%
+-commutative95.1%
*-commutative95.1%
fma-def95.1%
Applied egg-rr95.1%
Taylor expanded in z around inf 31.4%
*-commutative31.4%
*-commutative31.4%
associate-*l*39.5%
*-commutative39.5%
Simplified39.5%
if 2.3999999999999998e217 < z Initial program 50.4%
associate-+l+50.4%
*-commutative50.4%
associate-*l*56.3%
Simplified56.3%
add-cube-cbrt56.1%
pow356.1%
+-commutative56.1%
*-commutative56.1%
fma-def56.1%
Applied egg-rr56.1%
Taylor expanded in z around inf 88.1%
Final simplification55.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.08e+63) (not (<= a 9e+127))) (+ x (* a (+ t (* z b)))) (+ (+ x (* y z)) (+ (* z (* a b)) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.08e+63) || !(a <= 9e+127)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (t * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.08d+63)) .or. (.not. (a <= 9d+127))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (y * z)) + ((z * (a * b)) + (t * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.08e+63) || !(a <= 9e+127)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.08e+63) or not (a <= 9e+127): tmp = x + (a * (t + (z * b))) else: tmp = (x + (y * z)) + ((z * (a * b)) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.08e+63) || !(a <= 9e+127)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(z * Float64(a * b)) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.08e+63) || ~((a <= 9e+127))) tmp = x + (a * (t + (z * b))); else tmp = (x + (y * z)) + ((z * (a * b)) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.08e+63], N[Not[LessEqual[a, 9e+127]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.08 \cdot 10^{+63} \lor \neg \left(a \leq 9 \cdot 10^{+127}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(z \cdot \left(a \cdot b\right) + t \cdot a\right)\\
\end{array}
\end{array}
if a < -1.08e63 or 9.00000000000000068e127 < a Initial program 74.8%
associate-+l+74.8%
+-commutative74.8%
fma-def74.8%
associate-*l*79.9%
*-commutative79.9%
*-commutative79.9%
distribute-rgt-out89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in y around 0 93.0%
if -1.08e63 < a < 9.00000000000000068e127Initial program 99.5%
associate-+l+99.5%
*-commutative99.5%
associate-*l*98.9%
Simplified98.9%
Final simplification97.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.15e+18)
(* t a)
(if (<= a 1.08e-17)
(+ x (* y z))
(if (or (<= a 2.5e+97) (and (not (<= a 1.35e+239)) (<= a 4.3e+306)))
(* a (* z b))
(* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.15e+18) {
tmp = t * a;
} else if (a <= 1.08e-17) {
tmp = x + (y * z);
} else if ((a <= 2.5e+97) || (!(a <= 1.35e+239) && (a <= 4.3e+306))) {
tmp = a * (z * 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.15d+18)) then
tmp = t * a
else if (a <= 1.08d-17) then
tmp = x + (y * z)
else if ((a <= 2.5d+97) .or. (.not. (a <= 1.35d+239)) .and. (a <= 4.3d+306)) then
tmp = a * (z * 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.15e+18) {
tmp = t * a;
} else if (a <= 1.08e-17) {
tmp = x + (y * z);
} else if ((a <= 2.5e+97) || (!(a <= 1.35e+239) && (a <= 4.3e+306))) {
tmp = a * (z * b);
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.15e+18: tmp = t * a elif a <= 1.08e-17: tmp = x + (y * z) elif (a <= 2.5e+97) or (not (a <= 1.35e+239) and (a <= 4.3e+306)): tmp = a * (z * b) else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.15e+18) tmp = Float64(t * a); elseif (a <= 1.08e-17) tmp = Float64(x + Float64(y * z)); elseif ((a <= 2.5e+97) || (!(a <= 1.35e+239) && (a <= 4.3e+306))) tmp = Float64(a * Float64(z * 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.15e+18) tmp = t * a; elseif (a <= 1.08e-17) tmp = x + (y * z); elseif ((a <= 2.5e+97) || (~((a <= 1.35e+239)) && (a <= 4.3e+306))) tmp = a * (z * b); else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.15e+18], N[(t * a), $MachinePrecision], If[LessEqual[a, 1.08e-17], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 2.5e+97], And[N[Not[LessEqual[a, 1.35e+239]], $MachinePrecision], LessEqual[a, 4.3e+306]]], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], N[(t * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.15 \cdot 10^{+18}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq 1.08 \cdot 10^{-17}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{+97} \lor \neg \left(a \leq 1.35 \cdot 10^{+239}\right) \land a \leq 4.3 \cdot 10^{+306}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -2.15e18 or 2.49999999999999999e97 < a < 1.3499999999999999e239 or 4.2999999999999998e306 < a Initial program 82.3%
associate-+l+82.3%
*-commutative82.3%
associate-*l*73.1%
Simplified73.1%
add-cube-cbrt72.7%
pow372.7%
+-commutative72.7%
*-commutative72.7%
fma-def72.7%
Applied egg-rr72.7%
Taylor expanded in t around inf 52.1%
if -2.15e18 < a < 1.07999999999999995e-17Initial program 99.3%
associate-+l+99.3%
*-commutative99.3%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around 0 73.9%
if 1.07999999999999995e-17 < a < 2.49999999999999999e97 or 1.3499999999999999e239 < a < 4.2999999999999998e306Initial program 86.8%
associate-+l+86.8%
*-commutative86.8%
associate-*l*86.2%
Simplified86.2%
add-cube-cbrt86.0%
pow386.0%
+-commutative86.0%
*-commutative86.0%
fma-def86.0%
Applied egg-rr86.0%
Taylor expanded in z around inf 59.8%
Final simplification65.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))) (t_2 (+ x t_1)))
(if (<= a -2.7e+181)
t_2
(if (<= a -4.4e-36)
(+ t_1 (* y z))
(if (<= a 3.5e-19) (+ (+ x (* y z)) (* t a)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double t_2 = x + t_1;
double tmp;
if (a <= -2.7e+181) {
tmp = t_2;
} else if (a <= -4.4e-36) {
tmp = t_1 + (y * z);
} else if (a <= 3.5e-19) {
tmp = (x + (y * z)) + (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 = a * (t + (z * b))
t_2 = x + t_1
if (a <= (-2.7d+181)) then
tmp = t_2
else if (a <= (-4.4d-36)) then
tmp = t_1 + (y * z)
else if (a <= 3.5d-19) then
tmp = (x + (y * z)) + (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 = a * (t + (z * b));
double t_2 = x + t_1;
double tmp;
if (a <= -2.7e+181) {
tmp = t_2;
} else if (a <= -4.4e-36) {
tmp = t_1 + (y * z);
} else if (a <= 3.5e-19) {
tmp = (x + (y * z)) + (t * a);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) t_2 = x + t_1 tmp = 0 if a <= -2.7e+181: tmp = t_2 elif a <= -4.4e-36: tmp = t_1 + (y * z) elif a <= 3.5e-19: tmp = (x + (y * z)) + (t * a) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) t_2 = Float64(x + t_1) tmp = 0.0 if (a <= -2.7e+181) tmp = t_2; elseif (a <= -4.4e-36) tmp = Float64(t_1 + Float64(y * z)); elseif (a <= 3.5e-19) tmp = Float64(Float64(x + Float64(y * z)) + Float64(t * a)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); t_2 = x + t_1; tmp = 0.0; if (a <= -2.7e+181) tmp = t_2; elseif (a <= -4.4e-36) tmp = t_1 + (y * z); elseif (a <= 3.5e-19) tmp = (x + (y * z)) + (t * a); else tmp = t_2; 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]}, Block[{t$95$2 = N[(x + t$95$1), $MachinePrecision]}, If[LessEqual[a, -2.7e+181], t$95$2, If[LessEqual[a, -4.4e-36], N[(t$95$1 + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e-19], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
t_2 := x + t_1\\
\mathbf{if}\;a \leq -2.7 \cdot 10^{+181}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -4.4 \cdot 10^{-36}:\\
\;\;\;\;t_1 + y \cdot z\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-19}:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -2.70000000000000007e181 or 3.50000000000000015e-19 < a Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
fma-def84.8%
associate-*l*87.0%
*-commutative87.0%
*-commutative87.0%
distribute-rgt-out94.7%
*-commutative94.7%
Simplified94.7%
Taylor expanded in y around 0 95.0%
if -2.70000000000000007e181 < a < -4.3999999999999999e-36Initial program 89.2%
associate-+l+89.2%
+-commutative89.2%
fma-def89.2%
associate-*l*92.6%
*-commutative92.6%
*-commutative92.6%
distribute-rgt-out94.4%
*-commutative94.4%
Simplified94.4%
Taylor expanded in x around 0 89.4%
if -4.3999999999999999e-36 < a < 3.50000000000000015e-19Initial program 99.2%
associate-+l+99.2%
*-commutative99.2%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around inf 92.3%
Final simplification92.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -100000.0)
(* y z)
(if (<= z -3e-136)
x
(if (<= z -3.65e-183)
(* t a)
(if (<= z 2.6e-279) x (if (<= z 6600000000.0) (* t a) (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -100000.0) {
tmp = y * z;
} else if (z <= -3e-136) {
tmp = x;
} else if (z <= -3.65e-183) {
tmp = t * a;
} else if (z <= 2.6e-279) {
tmp = x;
} else if (z <= 6600000000.0) {
tmp = t * a;
} 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 (z <= (-100000.0d0)) then
tmp = y * z
else if (z <= (-3d-136)) then
tmp = x
else if (z <= (-3.65d-183)) then
tmp = t * a
else if (z <= 2.6d-279) then
tmp = x
else if (z <= 6600000000.0d0) then
tmp = t * a
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 (z <= -100000.0) {
tmp = y * z;
} else if (z <= -3e-136) {
tmp = x;
} else if (z <= -3.65e-183) {
tmp = t * a;
} else if (z <= 2.6e-279) {
tmp = x;
} else if (z <= 6600000000.0) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -100000.0: tmp = y * z elif z <= -3e-136: tmp = x elif z <= -3.65e-183: tmp = t * a elif z <= 2.6e-279: tmp = x elif z <= 6600000000.0: tmp = t * a else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -100000.0) tmp = Float64(y * z); elseif (z <= -3e-136) tmp = x; elseif (z <= -3.65e-183) tmp = Float64(t * a); elseif (z <= 2.6e-279) tmp = x; elseif (z <= 6600000000.0) tmp = Float64(t * a); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -100000.0) tmp = y * z; elseif (z <= -3e-136) tmp = x; elseif (z <= -3.65e-183) tmp = t * a; elseif (z <= 2.6e-279) tmp = x; elseif (z <= 6600000000.0) tmp = t * a; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -100000.0], N[(y * z), $MachinePrecision], If[LessEqual[z, -3e-136], x, If[LessEqual[z, -3.65e-183], N[(t * a), $MachinePrecision], If[LessEqual[z, 2.6e-279], x, If[LessEqual[z, 6600000000.0], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -100000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-136}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -3.65 \cdot 10^{-183}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-279}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6600000000:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -1e5 or 6.6e9 < z Initial program 86.4%
associate-+l+86.4%
*-commutative86.4%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in y around inf 46.0%
*-commutative46.0%
Simplified46.0%
if -1e5 < z < -2.9999999999999998e-136 or -3.64999999999999999e-183 < z < 2.6000000000000002e-279Initial program 98.4%
associate-+l+98.4%
*-commutative98.4%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around inf 52.8%
if -2.9999999999999998e-136 < z < -3.64999999999999999e-183 or 2.6000000000000002e-279 < z < 6.6e9Initial program 97.3%
associate-+l+97.3%
*-commutative97.3%
associate-*l*90.6%
Simplified90.6%
add-cube-cbrt89.9%
pow389.9%
+-commutative89.9%
*-commutative89.9%
fma-def89.9%
Applied egg-rr89.9%
Taylor expanded in t around inf 51.1%
Final simplification49.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.4e+49) (not (<= z 8.5e+18))) (* 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 <= -4.4e+49) || !(z <= 8.5e+18)) {
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 <= (-4.4d+49)) .or. (.not. (z <= 8.5d+18))) 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 <= -4.4e+49) || !(z <= 8.5e+18)) {
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 <= -4.4e+49) or not (z <= 8.5e+18): 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 <= -4.4e+49) || !(z <= 8.5e+18)) 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 <= -4.4e+49) || ~((z <= 8.5e+18))) 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, -4.4e+49], N[Not[LessEqual[z, 8.5e+18]], $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 -4.4 \cdot 10^{+49} \lor \neg \left(z \leq 8.5 \cdot 10^{+18}\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 < -4.4000000000000001e49 or 8.5e18 < z Initial program 85.5%
associate-+l+85.5%
*-commutative85.5%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in z around inf 80.9%
if -4.4000000000000001e49 < z < 8.5e18Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
fma-def98.0%
associate-*l*98.6%
*-commutative98.6%
*-commutative98.6%
distribute-rgt-out99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 88.9%
Final simplification85.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -240000000000.0) (not (<= z 1.15e-7))) (+ x (* 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 <= -240000000000.0) || !(z <= 1.15e-7)) {
tmp = x + (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 <= (-240000000000.0d0)) .or. (.not. (z <= 1.15d-7))) then
tmp = x + (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 <= -240000000000.0) || !(z <= 1.15e-7)) {
tmp = x + (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 <= -240000000000.0) or not (z <= 1.15e-7): tmp = x + (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 <= -240000000000.0) || !(z <= 1.15e-7)) tmp = Float64(x + 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 <= -240000000000.0) || ~((z <= 1.15e-7))) tmp = x + (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, -240000000000.0], N[Not[LessEqual[z, 1.15e-7]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $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 -240000000000 \lor \neg \left(z \leq 1.15 \cdot 10^{-7}\right):\\
\;\;\;\;x + 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 < -2.4e11 or 1.14999999999999997e-7 < z Initial program 86.5%
associate-+l+86.5%
*-commutative86.5%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in t around 0 78.2%
+-commutative78.2%
+-commutative78.2%
associate-*r*87.3%
distribute-rgt-in91.6%
Simplified91.6%
if -2.4e11 < z < 1.14999999999999997e-7Initial program 97.8%
associate-+l+97.8%
+-commutative97.8%
fma-def97.8%
associate-*l*98.5%
*-commutative98.5%
*-commutative98.5%
distribute-rgt-out99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 89.6%
Final simplification90.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.08e+54) (+ (* (* z a) b) (* y z)) (if (<= z 3e+18) (+ 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.08e+54) {
tmp = ((z * a) * b) + (y * z);
} else if (z <= 3e+18) {
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.08d+54)) then
tmp = ((z * a) * b) + (y * z)
else if (z <= 3d+18) 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.08e+54) {
tmp = ((z * a) * b) + (y * z);
} else if (z <= 3e+18) {
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.08e+54: tmp = ((z * a) * b) + (y * z) elif z <= 3e+18: 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.08e+54) tmp = Float64(Float64(Float64(z * a) * b) + Float64(y * z)); elseif (z <= 3e+18) 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.08e+54) tmp = ((z * a) * b) + (y * z); elseif (z <= 3e+18) 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.08e+54], N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+18], 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.08 \cdot 10^{+54}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b + y \cdot z\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+18}:\\
\;\;\;\;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.08000000000000008e54Initial program 91.8%
associate-+l+91.8%
*-commutative91.8%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in z around inf 84.3%
+-commutative84.3%
distribute-lft-in84.3%
*-commutative84.3%
associate-*r*76.4%
Applied egg-rr76.4%
Taylor expanded in z around 0 76.4%
associate-*r*84.3%
*-commutative84.3%
associate-*l*84.3%
Simplified84.3%
if -1.08000000000000008e54 < z < 3e18Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
fma-def98.0%
associate-*l*98.6%
*-commutative98.6%
*-commutative98.6%
distribute-rgt-out99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 88.9%
if 3e18 < z Initial program 77.6%
associate-+l+77.6%
*-commutative77.6%
associate-*l*81.2%
Simplified81.2%
Taylor expanded in z around inf 76.6%
Final simplification85.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= z -2.2e+15)
t_1
(if (<= z 5.6) (+ x (* t a)) (if (<= z 2.8e+217) t_1 (* a (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (z <= -2.2e+15) {
tmp = t_1;
} else if (z <= 5.6) {
tmp = x + (t * a);
} else if (z <= 2.8e+217) {
tmp = t_1;
} else {
tmp = a * (z * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * z)
if (z <= (-2.2d+15)) then
tmp = t_1
else if (z <= 5.6d0) then
tmp = x + (t * a)
else if (z <= 2.8d+217) then
tmp = t_1
else
tmp = a * (z * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (z <= -2.2e+15) {
tmp = t_1;
} else if (z <= 5.6) {
tmp = x + (t * a);
} else if (z <= 2.8e+217) {
tmp = t_1;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if z <= -2.2e+15: tmp = t_1 elif z <= 5.6: tmp = x + (t * a) elif z <= 2.8e+217: tmp = t_1 else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (z <= -2.2e+15) tmp = t_1; elseif (z <= 5.6) tmp = Float64(x + Float64(t * a)); elseif (z <= 2.8e+217) tmp = t_1; else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (z <= -2.2e+15) tmp = t_1; elseif (z <= 5.6) tmp = x + (t * a); elseif (z <= 2.8e+217) tmp = t_1; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+15], t$95$1, If[LessEqual[z, 5.6], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+217], t$95$1, N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.6:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+217}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if z < -2.2e15 or 5.5999999999999996 < z < 2.79999999999999994e217Initial program 92.3%
associate-+l+92.3%
*-commutative92.3%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in a around 0 65.5%
if -2.2e15 < z < 5.5999999999999996Initial program 97.8%
associate-+l+97.8%
*-commutative97.8%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in z around 0 76.6%
+-commutative76.6%
Simplified76.6%
if 2.79999999999999994e217 < z Initial program 50.4%
associate-+l+50.4%
*-commutative50.4%
associate-*l*56.3%
Simplified56.3%
add-cube-cbrt56.1%
pow356.1%
+-commutative56.1%
*-commutative56.1%
fma-def56.1%
Applied egg-rr56.1%
Taylor expanded in z around inf 88.1%
Final simplification73.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3e-28) (not (<= a 1.7e-25))) (* a (+ t (* z b))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3e-28) || !(a <= 1.7e-25)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-3d-28)) .or. (.not. (a <= 1.7d-25))) then
tmp = a * (t + (z * b))
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3e-28) || !(a <= 1.7e-25)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3e-28) or not (a <= 1.7e-25): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3e-28) || !(a <= 1.7e-25)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3e-28) || ~((a <= 1.7e-25))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3e-28], N[Not[LessEqual[a, 1.7e-25]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{-28} \lor \neg \left(a \leq 1.7 \cdot 10^{-25}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -3.00000000000000003e-28 or 1.70000000000000001e-25 < a Initial program 86.2%
associate-+l+86.2%
*-commutative86.2%
associate-*l*80.7%
Simplified80.7%
add-cube-cbrt80.5%
pow380.5%
+-commutative80.5%
*-commutative80.5%
fma-def80.5%
Applied egg-rr80.5%
Taylor expanded in z around inf 72.4%
distribute-lft-in78.6%
*-commutative78.6%
Simplified78.6%
if -3.00000000000000003e-28 < a < 1.70000000000000001e-25Initial program 99.2%
associate-+l+99.2%
*-commutative99.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 79.6%
Final simplification79.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.45e+14) (not (<= z 1800000000000.0))) (* z (+ y (* a b))) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.45e+14) || !(z <= 1800000000000.0)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.45d+14)) .or. (.not. (z <= 1800000000000.0d0))) then
tmp = z * (y + (a * b))
else
tmp = x + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.45e+14) || !(z <= 1800000000000.0)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.45e+14) or not (z <= 1800000000000.0): tmp = z * (y + (a * b)) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.45e+14) || !(z <= 1800000000000.0)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.45e+14) || ~((z <= 1800000000000.0))) tmp = z * (y + (a * b)); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.45e+14], N[Not[LessEqual[z, 1800000000000.0]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{+14} \lor \neg \left(z \leq 1800000000000\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -2.45e14 or 1.8e12 < z Initial program 86.0%
associate-+l+86.0%
*-commutative86.0%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in z around inf 79.9%
if -2.45e14 < z < 1.8e12Initial program 97.9%
associate-+l+97.9%
*-commutative97.9%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in z around 0 76.6%
+-commutative76.6%
Simplified76.6%
Final simplification78.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.8e-45) (not (<= t 2.75e+26))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.8e-45) || !(t <= 2.75e+26)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-3.8d-45)) .or. (.not. (t <= 2.75d+26))) then
tmp = t * a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.8e-45) || !(t <= 2.75e+26)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.8e-45) or not (t <= 2.75e+26): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.8e-45) || !(t <= 2.75e+26)) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.8e-45) || ~((t <= 2.75e+26))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.8e-45], N[Not[LessEqual[t, 2.75e+26]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-45} \lor \neg \left(t \leq 2.75 \cdot 10^{+26}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -3.79999999999999997e-45 or 2.7499999999999998e26 < t Initial program 91.0%
associate-+l+91.0%
*-commutative91.0%
associate-*l*87.0%
Simplified87.0%
add-cube-cbrt86.4%
pow386.5%
+-commutative86.5%
*-commutative86.5%
fma-def86.5%
Applied egg-rr86.5%
Taylor expanded in t around inf 45.6%
if -3.79999999999999997e-45 < t < 2.7499999999999998e26Initial program 94.9%
associate-+l+94.9%
*-commutative94.9%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in x around inf 40.2%
Final simplification43.3%
(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 92.7%
associate-+l+92.7%
*-commutative92.7%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in x around inf 26.6%
Final simplification26.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 2023305
(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)))