
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 1e+282) t_1 (+ (fma y z x) (* 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 <= 1e+282) {
tmp = t_1;
} else {
tmp = fma(y, z, x) + (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 <= 1e+282) tmp = t_1; else tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+282], t$95$1, N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq 10^{+282}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + 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)) < 1.00000000000000003e282Initial program 99.0%
if 1.00000000000000003e282 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 74.1%
associate-+l+74.1%
+-commutative74.1%
fma-define74.1%
associate-*l*83.6%
*-commutative83.6%
*-commutative83.6%
distribute-rgt-out91.8%
remove-double-neg91.8%
*-commutative91.8%
distribute-lft-neg-out91.8%
sub-neg91.8%
sub-neg91.8%
distribute-lft-neg-out91.8%
*-commutative91.8%
remove-double-neg91.8%
*-commutative91.8%
Simplified91.8%
Final simplification97.6%
(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 97.7%
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%
fma-define0.0%
associate-*l*22.2%
*-commutative22.2%
*-commutative22.2%
distribute-rgt-out66.7%
remove-double-neg66.7%
*-commutative66.7%
distribute-lft-neg-out66.7%
sub-neg66.7%
sub-neg66.7%
distribute-lft-neg-out66.7%
*-commutative66.7%
remove-double-neg66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in y around 0 78.5%
Taylor expanded in x around 0 78.5%
Final simplification97.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= x -1e+112)
(+ x (* z (+ y (* a b))))
(if (<= x 4.65e+139) (+ t_1 (* z (+ y (/ x z)))) (+ x t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (x <= -1e+112) {
tmp = x + (z * (y + (a * b)));
} else if (x <= 4.65e+139) {
tmp = t_1 + (z * (y + (x / z)));
} else {
tmp = x + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if (x <= (-1d+112)) then
tmp = x + (z * (y + (a * b)))
else if (x <= 4.65d+139) then
tmp = t_1 + (z * (y + (x / z)))
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (x <= -1e+112) {
tmp = x + (z * (y + (a * b)));
} else if (x <= 4.65e+139) {
tmp = t_1 + (z * (y + (x / z)));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if x <= -1e+112: tmp = x + (z * (y + (a * b))) elif x <= 4.65e+139: tmp = t_1 + (z * (y + (x / z))) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (x <= -1e+112) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); elseif (x <= 4.65e+139) tmp = Float64(t_1 + Float64(z * Float64(y + Float64(x / z)))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (x <= -1e+112) tmp = x + (z * (y + (a * b))); elseif (x <= 4.65e+139) tmp = t_1 + (z * (y + (x / z))); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e+112], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.65e+139], N[(t$95$1 + N[(z * N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;x \leq -1 \cdot 10^{+112}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;x \leq 4.65 \cdot 10^{+139}:\\
\;\;\;\;t\_1 + z \cdot \left(y + \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if x < -9.9999999999999993e111Initial program 90.2%
associate-+l+90.2%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in t around 0 86.1%
associate-*r*88.6%
distribute-rgt-in91.1%
+-commutative91.1%
Simplified91.1%
if -9.9999999999999993e111 < x < 4.6500000000000001e139Initial program 95.0%
associate-+l+95.0%
+-commutative95.0%
fma-define95.0%
associate-*l*94.4%
*-commutative94.4%
*-commutative94.4%
distribute-rgt-out95.6%
remove-double-neg95.6%
*-commutative95.6%
distribute-lft-neg-out95.6%
sub-neg95.6%
sub-neg95.6%
distribute-lft-neg-out95.6%
*-commutative95.6%
remove-double-neg95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in z around inf 93.8%
if 4.6500000000000001e139 < x Initial program 95.0%
associate-+l+95.0%
+-commutative95.0%
fma-define95.0%
associate-*l*92.5%
*-commutative92.5%
*-commutative92.5%
distribute-rgt-out95.0%
remove-double-neg95.0%
*-commutative95.0%
distribute-lft-neg-out95.0%
sub-neg95.0%
sub-neg95.0%
distribute-lft-neg-out95.0%
*-commutative95.0%
remove-double-neg95.0%
*-commutative95.0%
Simplified95.0%
Taylor expanded in y around 0 90.4%
Final simplification92.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.2e-80) (* y z) (if (<= z 1.9e-85) x (if (<= z 1.75e+106) (* t a) (* z (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.2e-80) {
tmp = y * z;
} else if (z <= 1.9e-85) {
tmp = x;
} else if (z <= 1.75e+106) {
tmp = t * a;
} else {
tmp = z * (a * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3.2d-80)) then
tmp = y * z
else if (z <= 1.9d-85) then
tmp = x
else if (z <= 1.75d+106) then
tmp = t * a
else
tmp = z * (a * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.2e-80) {
tmp = y * z;
} else if (z <= 1.9e-85) {
tmp = x;
} else if (z <= 1.75e+106) {
tmp = t * a;
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.2e-80: tmp = y * z elif z <= 1.9e-85: tmp = x elif z <= 1.75e+106: tmp = t * a else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.2e-80) tmp = Float64(y * z); elseif (z <= 1.9e-85) tmp = x; elseif (z <= 1.75e+106) tmp = Float64(t * a); else tmp = Float64(z * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.2e-80) tmp = y * z; elseif (z <= 1.9e-85) tmp = x; elseif (z <= 1.75e+106) tmp = t * a; else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.2e-80], N[(y * z), $MachinePrecision], If[LessEqual[z, 1.9e-85], x, If[LessEqual[z, 1.75e+106], N[(t * a), $MachinePrecision], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-80}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-85}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+106}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -3.1999999999999999e-80Initial program 94.2%
associate-+l+94.2%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in z around inf 68.6%
*-commutative68.6%
flip3-+22.3%
associate-*l/18.3%
pow318.3%
+-commutative18.3%
pow318.3%
fma-define18.3%
distribute-rgt-out--18.3%
Applied egg-rr18.3%
Taylor expanded in a around 0 44.8%
*-commutative44.8%
Simplified44.8%
if -3.1999999999999999e-80 < z < 1.8999999999999999e-85Initial program 98.1%
associate-+l+98.1%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in t around 0 70.1%
associate-*r*74.9%
distribute-rgt-in74.9%
+-commutative74.9%
Simplified74.9%
Taylor expanded in y around 0 60.1%
associate-*r*14.5%
*-commutative14.5%
Simplified64.9%
Taylor expanded in x around inf 53.3%
if 1.8999999999999999e-85 < z < 1.7499999999999999e106Initial program 97.5%
associate-+l+97.5%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 70.8%
Taylor expanded in x around 0 42.3%
if 1.7499999999999999e106 < z Initial program 82.6%
associate-+l+82.6%
associate-*l*82.5%
Simplified82.5%
Taylor expanded in z around inf 83.9%
Taylor expanded in y around 0 42.9%
associate-*r*49.1%
*-commutative49.1%
Simplified49.1%
Final simplification48.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z 1.1e+81) (+ (+ (* a (* z b)) (* t a)) (+ x (* y z))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.1e+81) {
tmp = ((a * (z * b)) + (t * a)) + (x + (y * z));
} else {
tmp = x + (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.1d+81) then
tmp = ((a * (z * b)) + (t * a)) + (x + (y * z))
else
tmp = x + (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.1e+81) {
tmp = ((a * (z * b)) + (t * a)) + (x + (y * z));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 1.1e+81: tmp = ((a * (z * b)) + (t * a)) + (x + (y * z)) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.1e+81) tmp = Float64(Float64(Float64(a * Float64(z * b)) + Float64(t * a)) + Float64(x + Float64(y * z))); else tmp = Float64(x + 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.1e+81) tmp = ((a * (z * b)) + (t * a)) + (x + (y * z)); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.1e+81], N[(N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.1 \cdot 10^{+81}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + t \cdot a\right) + \left(x + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 1.09999999999999993e81Initial program 96.7%
associate-+l+96.7%
associate-*l*96.6%
Simplified96.6%
if 1.09999999999999993e81 < z Initial program 84.0%
associate-+l+84.0%
associate-*l*84.0%
Simplified84.0%
Taylor expanded in t around 0 83.0%
associate-*r*88.7%
distribute-rgt-in94.9%
+-commutative94.9%
Simplified94.9%
Final simplification96.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.8e-83) (not (<= z 5.8e+16))) (+ 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 <= -5.8e-83) || !(z <= 5.8e+16)) {
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 <= (-5.8d-83)) .or. (.not. (z <= 5.8d+16))) 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 <= -5.8e-83) || !(z <= 5.8e+16)) {
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 <= -5.8e-83) or not (z <= 5.8e+16): 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 <= -5.8e-83) || !(z <= 5.8e+16)) 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 <= -5.8e-83) || ~((z <= 5.8e+16))) 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, -5.8e-83], N[Not[LessEqual[z, 5.8e+16]], $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 -5.8 \cdot 10^{-83} \lor \neg \left(z \leq 5.8 \cdot 10^{+16}\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 < -5.7999999999999998e-83 or 5.8e16 < z Initial program 90.2%
associate-+l+90.2%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in t around 0 80.4%
associate-*r*86.3%
distribute-rgt-in88.6%
+-commutative88.6%
Simplified88.6%
if -5.7999999999999998e-83 < z < 5.8e16Initial program 98.5%
associate-+l+98.5%
+-commutative98.5%
fma-define98.5%
associate-*l*99.2%
*-commutative99.2%
*-commutative99.2%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
remove-double-neg100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 91.1%
Final simplification89.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.6e+151) (not (<= y 5.2e+142))) (+ x (* y z)) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.6e+151) || !(y <= 5.2e+142)) {
tmp = x + (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 ((y <= (-2.6d+151)) .or. (.not. (y <= 5.2d+142))) then
tmp = x + (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 ((y <= -2.6e+151) || !(y <= 5.2e+142)) {
tmp = x + (y * z);
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.6e+151) or not (y <= 5.2e+142): tmp = x + (y * z) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.6e+151) || !(y <= 5.2e+142)) tmp = Float64(x + 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 ((y <= -2.6e+151) || ~((y <= 5.2e+142))) tmp = x + (y * z); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.6e+151], N[Not[LessEqual[y, 5.2e+142]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+151} \lor \neg \left(y \leq 5.2 \cdot 10^{+142}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if y < -2.60000000000000013e151 or 5.20000000000000043e142 < y Initial program 94.0%
associate-+l+94.0%
+-commutative94.0%
fma-define94.0%
associate-*l*92.5%
*-commutative92.5%
*-commutative92.5%
distribute-rgt-out95.5%
remove-double-neg95.5%
*-commutative95.5%
distribute-lft-neg-out95.5%
sub-neg95.5%
sub-neg95.5%
distribute-lft-neg-out95.5%
*-commutative95.5%
remove-double-neg95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in z around inf 82.7%
Taylor expanded in a around 0 76.9%
Taylor expanded in z around 0 86.8%
*-commutative86.8%
Simplified86.8%
if -2.60000000000000013e151 < y < 5.20000000000000043e142Initial program 94.3%
associate-+l+94.3%
+-commutative94.3%
fma-define94.3%
associate-*l*94.8%
*-commutative94.8%
*-commutative94.8%
distribute-rgt-out95.9%
remove-double-neg95.9%
*-commutative95.9%
distribute-lft-neg-out95.9%
sub-neg95.9%
sub-neg95.9%
distribute-lft-neg-out95.9%
*-commutative95.9%
remove-double-neg95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in y around 0 86.6%
Final simplification86.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -7.4e+124) (* t a) (if (<= t 3.9e-156) x (if (<= t 4.5e+27) (* y z) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.4e+124) {
tmp = t * a;
} else if (t <= 3.9e-156) {
tmp = x;
} else if (t <= 4.5e+27) {
tmp = y * z;
} else {
tmp = t * a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-7.4d+124)) then
tmp = t * a
else if (t <= 3.9d-156) then
tmp = x
else if (t <= 4.5d+27) then
tmp = y * z
else
tmp = t * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.4e+124) {
tmp = t * a;
} else if (t <= 3.9e-156) {
tmp = x;
} else if (t <= 4.5e+27) {
tmp = y * z;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7.4e+124: tmp = t * a elif t <= 3.9e-156: tmp = x elif t <= 4.5e+27: tmp = y * z else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7.4e+124) tmp = Float64(t * a); elseif (t <= 3.9e-156) tmp = x; elseif (t <= 4.5e+27) tmp = Float64(y * z); else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7.4e+124) tmp = t * a; elseif (t <= 3.9e-156) tmp = x; elseif (t <= 4.5e+27) tmp = y * z; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7.4e+124], N[(t * a), $MachinePrecision], If[LessEqual[t, 3.9e-156], x, If[LessEqual[t, 4.5e+27], N[(y * z), $MachinePrecision], N[(t * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{+124}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-156}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+27}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -7.40000000000000016e124 or 4.4999999999999999e27 < t Initial program 94.3%
associate-+l+94.3%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in z around 0 74.4%
Taylor expanded in x around 0 52.4%
if -7.40000000000000016e124 < t < 3.9000000000000001e-156Initial program 94.2%
associate-+l+94.2%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in t around 0 88.3%
associate-*r*92.4%
distribute-rgt-in93.3%
+-commutative93.3%
Simplified93.3%
Taylor expanded in y around 0 66.0%
associate-*r*26.5%
*-commutative26.5%
Simplified69.3%
Taylor expanded in x around inf 45.6%
if 3.9000000000000001e-156 < t < 4.4999999999999999e27Initial program 94.5%
associate-+l+94.5%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in z around inf 77.2%
*-commutative77.2%
flip3-+27.0%
associate-*l/21.5%
pow321.5%
+-commutative21.5%
pow321.5%
fma-define21.5%
distribute-rgt-out--21.5%
Applied egg-rr21.5%
Taylor expanded in a around 0 44.3%
*-commutative44.3%
Simplified44.3%
Final simplification48.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -35000000000.0) (not (<= z 1.7e+106))) (* 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 <= -35000000000.0) || !(z <= 1.7e+106)) {
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 <= (-35000000000.0d0)) .or. (.not. (z <= 1.7d+106))) 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 <= -35000000000.0) || !(z <= 1.7e+106)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -35000000000.0) or not (z <= 1.7e+106): 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 <= -35000000000.0) || !(z <= 1.7e+106)) 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 <= -35000000000.0) || ~((z <= 1.7e+106))) 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, -35000000000.0], N[Not[LessEqual[z, 1.7e+106]], $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 -35000000000 \lor \neg \left(z \leq 1.7 \cdot 10^{+106}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -3.5e10 or 1.69999999999999997e106 < z Initial program 88.1%
associate-+l+88.1%
associate-*l*85.9%
Simplified85.9%
Taylor expanded in z around inf 82.3%
if -3.5e10 < z < 1.69999999999999997e106Initial program 97.6%
associate-+l+97.6%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in z around 0 76.3%
Final simplification78.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.95e-7) (not (<= y 8.6e+104))) (+ x (* y z)) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.95e-7) || !(y <= 8.6e+104)) {
tmp = x + (y * z);
} 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 ((y <= (-1.95d-7)) .or. (.not. (y <= 8.6d+104))) then
tmp = x + (y * z)
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 ((y <= -1.95e-7) || !(y <= 8.6e+104)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.95e-7) or not (y <= 8.6e+104): tmp = x + (y * z) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.95e-7) || !(y <= 8.6e+104)) tmp = Float64(x + Float64(y * z)); 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 ((y <= -1.95e-7) || ~((y <= 8.6e+104))) tmp = x + (y * z); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.95e-7], N[Not[LessEqual[y, 8.6e+104]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{-7} \lor \neg \left(y \leq 8.6 \cdot 10^{+104}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if y < -1.95000000000000012e-7 or 8.6000000000000003e104 < y Initial program 94.3%
associate-+l+94.3%
+-commutative94.3%
fma-define94.3%
associate-*l*92.4%
*-commutative92.4%
*-commutative92.4%
distribute-rgt-out95.2%
remove-double-neg95.2%
*-commutative95.2%
distribute-lft-neg-out95.2%
sub-neg95.2%
sub-neg95.2%
distribute-lft-neg-out95.2%
*-commutative95.2%
remove-double-neg95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in z around inf 81.8%
Taylor expanded in a around 0 66.9%
Taylor expanded in z around 0 77.6%
*-commutative77.6%
Simplified77.6%
if -1.95000000000000012e-7 < y < 8.6000000000000003e104Initial program 94.2%
associate-+l+94.2%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in z around 0 68.6%
Final simplification72.3%
(FPCore (x y z t a b) :precision binary64 (if (<= z -5500000000000.0) (* y z) (if (<= z 4.2e+106) (+ x (* t a)) (* z (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5500000000000.0) {
tmp = y * z;
} else if (z <= 4.2e+106) {
tmp = x + (t * a);
} else {
tmp = z * (a * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5500000000000.0d0)) then
tmp = y * z
else if (z <= 4.2d+106) then
tmp = x + (t * a)
else
tmp = z * (a * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5500000000000.0) {
tmp = y * z;
} else if (z <= 4.2e+106) {
tmp = x + (t * a);
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -5500000000000.0: tmp = y * z elif z <= 4.2e+106: tmp = x + (t * a) else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5500000000000.0) tmp = Float64(y * z); elseif (z <= 4.2e+106) tmp = Float64(x + Float64(t * a)); else tmp = Float64(z * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -5500000000000.0) tmp = y * z; elseif (z <= 4.2e+106) tmp = x + (t * a); else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5500000000000.0], N[(y * z), $MachinePrecision], If[LessEqual[z, 4.2e+106], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5500000000000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+106}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -5.5e12Initial program 93.4%
associate-+l+93.4%
associate-*l*89.0%
Simplified89.0%
Taylor expanded in z around inf 80.3%
*-commutative80.3%
flip3-+33.6%
associate-*l/27.5%
pow327.5%
+-commutative27.5%
pow327.5%
fma-define27.5%
distribute-rgt-out--27.5%
Applied egg-rr27.5%
Taylor expanded in a around 0 50.1%
*-commutative50.1%
Simplified50.1%
if -5.5e12 < z < 4.2000000000000001e106Initial program 97.6%
associate-+l+97.6%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in z around 0 75.9%
if 4.2000000000000001e106 < z Initial program 82.6%
associate-+l+82.6%
associate-*l*82.5%
Simplified82.5%
Taylor expanded in z around inf 83.9%
Taylor expanded in y around 0 42.9%
associate-*r*49.1%
*-commutative49.1%
Simplified49.1%
Final simplification66.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.2e+121) (not (<= t 5.8e+114))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.2e+121) || !(t <= 5.8e+114)) {
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.2d+121)) .or. (.not. (t <= 5.8d+114))) 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.2e+121) || !(t <= 5.8e+114)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.2e+121) or not (t <= 5.8e+114): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.2e+121) || !(t <= 5.8e+114)) 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.2e+121) || ~((t <= 5.8e+114))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.2e+121], N[Not[LessEqual[t, 5.8e+114]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+121} \lor \neg \left(t \leq 5.8 \cdot 10^{+114}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -3.1999999999999999e121 or 5.8000000000000001e114 < t Initial program 92.8%
associate-+l+92.8%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in z around 0 72.7%
Taylor expanded in x around 0 56.7%
if -3.1999999999999999e121 < t < 5.8000000000000001e114Initial program 94.9%
associate-+l+94.9%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in t around 0 86.0%
associate-*r*89.5%
distribute-rgt-in90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in y around 0 62.7%
associate-*r*27.0%
*-commutative27.0%
Simplified65.0%
Taylor expanded in x around inf 40.7%
Final simplification46.0%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.3%
associate-+l+94.3%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in t around 0 73.3%
associate-*r*78.2%
distribute-rgt-in79.3%
+-commutative79.3%
Simplified79.3%
Taylor expanded in y around 0 52.7%
associate-*r*25.8%
*-commutative25.8%
Simplified56.5%
Taylor expanded in x around inf 33.1%
(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 2024176
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))