
(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 INFINITY) t_1 (* z (+ y (* a 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 = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * 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 = z * (y + (a * 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[(z * N[(y + N[(a * 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}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 98.4%
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%
*-commutative0.0%
*-commutative0.0%
associate-*l*8.3%
distribute-rgt-out50.0%
fma-def58.3%
+-commutative58.3%
remove-double-neg58.3%
sub-neg58.3%
*-commutative58.3%
fma-neg58.3%
remove-double-neg58.3%
+-commutative58.3%
fma-def58.3%
Simplified58.3%
Taylor expanded in z around inf 91.7%
Final simplification98.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.8e+163) (not (<= a 3.5e+86))) (+ x (* a (+ t (* z b)))) (+ (+ (+ x (* y z)) (* t a)) (* z (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.8e+163) || !(a <= 3.5e+86)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = ((x + (y * z)) + (t * a)) + (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 ((a <= (-3.8d+163)) .or. (.not. (a <= 3.5d+86))) then
tmp = x + (a * (t + (z * b)))
else
tmp = ((x + (y * z)) + (t * a)) + (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 ((a <= -3.8e+163) || !(a <= 3.5e+86)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = ((x + (y * z)) + (t * a)) + (z * (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.8e+163) or not (a <= 3.5e+86): tmp = x + (a * (t + (z * b))) else: tmp = ((x + (y * z)) + (t * a)) + (z * (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.8e+163) || !(a <= 3.5e+86)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(z * Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.8e+163) || ~((a <= 3.5e+86))) tmp = x + (a * (t + (z * b))); else tmp = ((x + (y * z)) + (t * a)) + (z * (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.8e+163], N[Not[LessEqual[a, 3.5e+86]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+163} \lor \neg \left(a \leq 3.5 \cdot 10^{+86}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -3.80000000000000008e163 or 3.50000000000000019e86 < a Initial program 85.4%
associate-+l+85.4%
+-commutative85.4%
*-commutative85.4%
*-commutative85.4%
associate-*l*90.9%
distribute-rgt-out98.4%
fma-def98.4%
+-commutative98.4%
remove-double-neg98.4%
sub-neg98.4%
*-commutative98.4%
fma-neg98.4%
remove-double-neg98.4%
+-commutative98.4%
fma-def98.4%
Simplified98.4%
Taylor expanded in y around 0 99.9%
if -3.80000000000000008e163 < a < 3.50000000000000019e86Initial program 96.8%
*-commutative96.8%
associate-*l*96.8%
Simplified96.8%
Final simplification97.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (* z (+ y (* a b)))))
(if (<= z -170000.0)
t_2
(if (<= z -3.4e-12)
t_1
(if (<= z -2.5e-33)
(* (* z a) b)
(if (<= z -1.25e-148) (+ x (* y z)) (if (<= z 6.6e-61) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -170000.0) {
tmp = t_2;
} else if (z <= -3.4e-12) {
tmp = t_1;
} else if (z <= -2.5e-33) {
tmp = (z * a) * b;
} else if (z <= -1.25e-148) {
tmp = x + (y * z);
} else if (z <= 6.6e-61) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (t * a)
t_2 = z * (y + (a * b))
if (z <= (-170000.0d0)) then
tmp = t_2
else if (z <= (-3.4d-12)) then
tmp = t_1
else if (z <= (-2.5d-33)) then
tmp = (z * a) * b
else if (z <= (-1.25d-148)) then
tmp = x + (y * z)
else if (z <= 6.6d-61) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -170000.0) {
tmp = t_2;
} else if (z <= -3.4e-12) {
tmp = t_1;
} else if (z <= -2.5e-33) {
tmp = (z * a) * b;
} else if (z <= -1.25e-148) {
tmp = x + (y * z);
} else if (z <= 6.6e-61) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = z * (y + (a * b)) tmp = 0 if z <= -170000.0: tmp = t_2 elif z <= -3.4e-12: tmp = t_1 elif z <= -2.5e-33: tmp = (z * a) * b elif z <= -1.25e-148: tmp = x + (y * z) elif z <= 6.6e-61: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -170000.0) tmp = t_2; elseif (z <= -3.4e-12) tmp = t_1; elseif (z <= -2.5e-33) tmp = Float64(Float64(z * a) * b); elseif (z <= -1.25e-148) tmp = Float64(x + Float64(y * z)); elseif (z <= 6.6e-61) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = z * (y + (a * b)); tmp = 0.0; if (z <= -170000.0) tmp = t_2; elseif (z <= -3.4e-12) tmp = t_1; elseif (z <= -2.5e-33) tmp = (z * a) * b; elseif (z <= -1.25e-148) tmp = x + (y * z); elseif (z <= 6.6e-61) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -170000.0], t$95$2, If[LessEqual[z, -3.4e-12], t$95$1, If[LessEqual[z, -2.5e-33], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[z, -1.25e-148], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e-61], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -170000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-33}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-148}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-61}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.7e5 or 6.59999999999999992e-61 < z Initial program 89.7%
associate-+l+89.7%
+-commutative89.7%
*-commutative89.7%
*-commutative89.7%
associate-*l*87.7%
distribute-rgt-out90.4%
fma-def91.1%
+-commutative91.1%
remove-double-neg91.1%
sub-neg91.1%
*-commutative91.1%
fma-neg91.1%
remove-double-neg91.1%
+-commutative91.1%
fma-def91.1%
Simplified91.1%
Taylor expanded in z around inf 80.0%
if -1.7e5 < z < -3.4000000000000001e-12 or -1.25e-148 < z < 6.59999999999999992e-61Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*99.9%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around 0 83.7%
if -3.4000000000000001e-12 < z < -2.50000000000000014e-33Initial program 66.7%
associate-+l+66.7%
+-commutative66.7%
*-commutative66.7%
*-commutative66.7%
associate-*l*66.1%
distribute-rgt-out99.5%
fma-def99.5%
+-commutative99.5%
remove-double-neg99.5%
sub-neg99.5%
*-commutative99.5%
fma-neg99.5%
remove-double-neg99.5%
+-commutative99.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in b around inf 99.5%
*-commutative99.5%
Simplified99.5%
associate-*r*100.0%
*-commutative100.0%
add-log-exp68.0%
*-commutative68.0%
exp-prod68.0%
*-commutative68.0%
exp-prod2.4%
Applied egg-rr2.4%
log-pow2.4%
log-pow16.3%
rem-log-exp100.0%
Simplified100.0%
if -2.50000000000000014e-33 < z < -1.25e-148Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in a around 0 68.2%
Final simplification80.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= z -5.2e-34)
t_1
(if (<= z 1.36e-291)
x
(if (<= z 1.66e-155)
(* t a)
(if (<= z 4.4e-61) x (if (<= z 3.5e+159) (* y z) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (z <= -5.2e-34) {
tmp = t_1;
} else if (z <= 1.36e-291) {
tmp = x;
} else if (z <= 1.66e-155) {
tmp = t * a;
} else if (z <= 4.4e-61) {
tmp = x;
} else if (z <= 3.5e+159) {
tmp = y * z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (z <= (-5.2d-34)) then
tmp = t_1
else if (z <= 1.36d-291) then
tmp = x
else if (z <= 1.66d-155) then
tmp = t * a
else if (z <= 4.4d-61) then
tmp = x
else if (z <= 3.5d+159) then
tmp = y * z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (z <= -5.2e-34) {
tmp = t_1;
} else if (z <= 1.36e-291) {
tmp = x;
} else if (z <= 1.66e-155) {
tmp = t * a;
} else if (z <= 4.4e-61) {
tmp = x;
} else if (z <= 3.5e+159) {
tmp = y * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if z <= -5.2e-34: tmp = t_1 elif z <= 1.36e-291: tmp = x elif z <= 1.66e-155: tmp = t * a elif z <= 4.4e-61: tmp = x elif z <= 3.5e+159: tmp = y * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (z <= -5.2e-34) tmp = t_1; elseif (z <= 1.36e-291) tmp = x; elseif (z <= 1.66e-155) tmp = Float64(t * a); elseif (z <= 4.4e-61) tmp = x; elseif (z <= 3.5e+159) tmp = Float64(y * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (z <= -5.2e-34) tmp = t_1; elseif (z <= 1.36e-291) tmp = x; elseif (z <= 1.66e-155) tmp = t * a; elseif (z <= 4.4e-61) tmp = x; elseif (z <= 3.5e+159) tmp = y * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e-34], t$95$1, If[LessEqual[z, 1.36e-291], x, If[LessEqual[z, 1.66e-155], N[(t * a), $MachinePrecision], If[LessEqual[z, 4.4e-61], x, If[LessEqual[z, 3.5e+159], N[(y * z), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{-34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.36 \cdot 10^{-291}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.66 \cdot 10^{-155}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-61}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+159}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.1999999999999999e-34 or 3.4999999999999999e159 < z Initial program 83.2%
associate-+l+83.2%
+-commutative83.2%
*-commutative83.2%
*-commutative83.2%
associate-*l*84.1%
distribute-rgt-out89.5%
fma-def90.5%
+-commutative90.5%
remove-double-neg90.5%
sub-neg90.5%
*-commutative90.5%
fma-neg90.5%
remove-double-neg90.5%
+-commutative90.5%
fma-def90.5%
Simplified90.5%
Taylor expanded in b around inf 49.4%
*-commutative49.4%
Simplified49.4%
if -5.1999999999999999e-34 < z < 1.36000000000000007e-291 or 1.65999999999999999e-155 < z < 4.40000000000000017e-61Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around inf 52.9%
if 1.36000000000000007e-291 < z < 1.65999999999999999e-155Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*99.9%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 59.7%
if 4.40000000000000017e-61 < z < 3.4999999999999999e159Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*93.4%
distribute-rgt-out93.4%
fma-def93.4%
+-commutative93.4%
remove-double-neg93.4%
sub-neg93.4%
*-commutative93.4%
fma-neg93.4%
remove-double-neg93.4%
+-commutative93.4%
fma-def93.4%
Simplified93.4%
Taylor expanded in y around inf 48.0%
Final simplification51.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.6e-34)
(* (* z a) b)
(if (<= z 1.7e-291)
x
(if (<= z 8.8e-155)
(* t a)
(if (<= z 1.05e-60) x (if (<= z 1.4e+162) (* y z) (* a (* z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.6e-34) {
tmp = (z * a) * b;
} else if (z <= 1.7e-291) {
tmp = x;
} else if (z <= 8.8e-155) {
tmp = t * a;
} else if (z <= 1.05e-60) {
tmp = x;
} else if (z <= 1.4e+162) {
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 <= (-2.6d-34)) then
tmp = (z * a) * b
else if (z <= 1.7d-291) then
tmp = x
else if (z <= 8.8d-155) then
tmp = t * a
else if (z <= 1.05d-60) then
tmp = x
else if (z <= 1.4d+162) 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 <= -2.6e-34) {
tmp = (z * a) * b;
} else if (z <= 1.7e-291) {
tmp = x;
} else if (z <= 8.8e-155) {
tmp = t * a;
} else if (z <= 1.05e-60) {
tmp = x;
} else if (z <= 1.4e+162) {
tmp = y * z;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.6e-34: tmp = (z * a) * b elif z <= 1.7e-291: tmp = x elif z <= 8.8e-155: tmp = t * a elif z <= 1.05e-60: tmp = x elif z <= 1.4e+162: tmp = y * z else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.6e-34) tmp = Float64(Float64(z * a) * b); elseif (z <= 1.7e-291) tmp = x; elseif (z <= 8.8e-155) tmp = Float64(t * a); elseif (z <= 1.05e-60) tmp = x; elseif (z <= 1.4e+162) 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 <= -2.6e-34) tmp = (z * a) * b; elseif (z <= 1.7e-291) tmp = x; elseif (z <= 8.8e-155) tmp = t * a; elseif (z <= 1.05e-60) tmp = x; elseif (z <= 1.4e+162) tmp = y * z; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.6e-34], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[z, 1.7e-291], x, If[LessEqual[z, 8.8e-155], N[(t * a), $MachinePrecision], If[LessEqual[z, 1.05e-60], x, If[LessEqual[z, 1.4e+162], N[(y * z), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-34}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-291}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-155}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-60}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+162}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if z < -2.5999999999999999e-34Initial program 86.0%
associate-+l+86.0%
+-commutative86.0%
*-commutative86.0%
*-commutative86.0%
associate-*l*86.1%
distribute-rgt-out89.2%
fma-def90.8%
+-commutative90.8%
remove-double-neg90.8%
sub-neg90.8%
*-commutative90.8%
fma-neg90.8%
remove-double-neg90.8%
+-commutative90.8%
fma-def90.8%
Simplified90.8%
Taylor expanded in b around inf 42.8%
*-commutative42.8%
Simplified42.8%
associate-*r*45.9%
*-commutative45.9%
add-log-exp36.5%
*-commutative36.5%
exp-prod37.9%
*-commutative37.9%
exp-prod34.8%
Applied egg-rr34.8%
log-pow34.8%
log-pow35.5%
rem-log-exp45.9%
Simplified45.9%
if -2.5999999999999999e-34 < z < 1.70000000000000013e-291 or 8.7999999999999996e-155 < z < 1.04999999999999996e-60Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around inf 52.9%
if 1.70000000000000013e-291 < z < 8.7999999999999996e-155Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*99.9%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 59.7%
if 1.04999999999999996e-60 < z < 1.39999999999999995e162Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*93.4%
distribute-rgt-out93.4%
fma-def93.4%
+-commutative93.4%
remove-double-neg93.4%
sub-neg93.4%
*-commutative93.4%
fma-neg93.4%
remove-double-neg93.4%
+-commutative93.4%
fma-def93.4%
Simplified93.4%
Taylor expanded in y around inf 48.0%
if 1.39999999999999995e162 < z Initial program 77.1%
associate-+l+77.1%
+-commutative77.1%
*-commutative77.1%
*-commutative77.1%
associate-*l*79.9%
distribute-rgt-out89.9%
fma-def89.9%
+-commutative89.9%
remove-double-neg89.9%
sub-neg89.9%
*-commutative89.9%
fma-neg89.9%
remove-double-neg89.9%
+-commutative89.9%
fma-def89.9%
Simplified89.9%
Taylor expanded in b around inf 63.5%
*-commutative63.5%
Simplified63.5%
Final simplification51.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))) (t_2 (* (* z a) b)))
(if (<= b -3.8e+64)
t_2
(if (<= b 9.5e-37)
t_1
(if (<= b 3.1e+102)
(+ x (* t a))
(if (<= b 4.65e+160) (* a (* z b)) (if (<= b 4.6e+213) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = (z * a) * b;
double tmp;
if (b <= -3.8e+64) {
tmp = t_2;
} else if (b <= 9.5e-37) {
tmp = t_1;
} else if (b <= 3.1e+102) {
tmp = x + (t * a);
} else if (b <= 4.65e+160) {
tmp = a * (z * b);
} else if (b <= 4.6e+213) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y * z)
t_2 = (z * a) * b
if (b <= (-3.8d+64)) then
tmp = t_2
else if (b <= 9.5d-37) then
tmp = t_1
else if (b <= 3.1d+102) then
tmp = x + (t * a)
else if (b <= 4.65d+160) then
tmp = a * (z * b)
else if (b <= 4.6d+213) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = (z * a) * b;
double tmp;
if (b <= -3.8e+64) {
tmp = t_2;
} else if (b <= 9.5e-37) {
tmp = t_1;
} else if (b <= 3.1e+102) {
tmp = x + (t * a);
} else if (b <= 4.65e+160) {
tmp = a * (z * b);
} else if (b <= 4.6e+213) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) t_2 = (z * a) * b tmp = 0 if b <= -3.8e+64: tmp = t_2 elif b <= 9.5e-37: tmp = t_1 elif b <= 3.1e+102: tmp = x + (t * a) elif b <= 4.65e+160: tmp = a * (z * b) elif b <= 4.6e+213: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) t_2 = Float64(Float64(z * a) * b) tmp = 0.0 if (b <= -3.8e+64) tmp = t_2; elseif (b <= 9.5e-37) tmp = t_1; elseif (b <= 3.1e+102) tmp = Float64(x + Float64(t * a)); elseif (b <= 4.65e+160) tmp = Float64(a * Float64(z * b)); elseif (b <= 4.6e+213) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); t_2 = (z * a) * b; tmp = 0.0; if (b <= -3.8e+64) tmp = t_2; elseif (b <= 9.5e-37) tmp = t_1; elseif (b <= 3.1e+102) tmp = x + (t * a); elseif (b <= 4.65e+160) tmp = a * (z * b); elseif (b <= 4.6e+213) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -3.8e+64], t$95$2, If[LessEqual[b, 9.5e-37], t$95$1, If[LessEqual[b, 3.1e+102], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.65e+160], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.6e+213], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;b \leq -3.8 \cdot 10^{+64}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{+102}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;b \leq 4.65 \cdot 10^{+160}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;b \leq 4.6 \cdot 10^{+213}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -3.8000000000000001e64 or 4.59999999999999996e213 < b Initial program 87.4%
associate-+l+87.4%
+-commutative87.4%
*-commutative87.4%
*-commutative87.4%
associate-*l*76.9%
distribute-rgt-out81.6%
fma-def81.6%
+-commutative81.6%
remove-double-neg81.6%
sub-neg81.6%
*-commutative81.6%
fma-neg81.6%
remove-double-neg81.6%
+-commutative81.6%
fma-def81.6%
Simplified81.6%
Taylor expanded in b around inf 66.4%
*-commutative66.4%
Simplified66.4%
associate-*r*72.3%
*-commutative72.3%
add-log-exp41.7%
*-commutative41.7%
exp-prod39.7%
*-commutative39.7%
exp-prod37.7%
Applied egg-rr37.7%
log-pow37.7%
log-pow37.7%
rem-log-exp72.3%
Simplified72.3%
if -3.8000000000000001e64 < b < 9.49999999999999927e-37 or 4.64999999999999973e160 < b < 4.59999999999999996e213Initial program 95.9%
associate-+l+95.9%
+-commutative95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*98.6%
distribute-rgt-out98.6%
fma-def99.3%
+-commutative99.3%
remove-double-neg99.3%
sub-neg99.3%
*-commutative99.3%
fma-neg99.3%
remove-double-neg99.3%
+-commutative99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in a around 0 70.3%
if 9.49999999999999927e-37 < b < 3.09999999999999987e102Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.0%
distribute-rgt-out99.8%
fma-def99.8%
+-commutative99.8%
remove-double-neg99.8%
sub-neg99.8%
*-commutative99.8%
fma-neg99.8%
remove-double-neg99.8%
+-commutative99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in z around 0 70.5%
if 3.09999999999999987e102 < b < 4.64999999999999973e160Initial program 92.9%
associate-+l+92.9%
+-commutative92.9%
*-commutative92.9%
*-commutative92.9%
associate-*l*92.7%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in b around inf 72.3%
*-commutative72.3%
Simplified72.3%
Final simplification70.9%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -1.1)
(and (not (<= a 5e-74)) (or (<= a 6.7e+16) (not (<= a 1.7e+78)))))
(* 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 <= -1.1) || (!(a <= 5e-74) && ((a <= 6.7e+16) || !(a <= 1.7e+78)))) {
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 <= (-1.1d0)) .or. (.not. (a <= 5d-74)) .and. (a <= 6.7d+16) .or. (.not. (a <= 1.7d+78))) 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 <= -1.1) || (!(a <= 5e-74) && ((a <= 6.7e+16) || !(a <= 1.7e+78)))) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.1) or (not (a <= 5e-74) and ((a <= 6.7e+16) or not (a <= 1.7e+78))): 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 <= -1.1) || (!(a <= 5e-74) && ((a <= 6.7e+16) || !(a <= 1.7e+78)))) 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 <= -1.1) || (~((a <= 5e-74)) && ((a <= 6.7e+16) || ~((a <= 1.7e+78))))) 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, -1.1], And[N[Not[LessEqual[a, 5e-74]], $MachinePrecision], Or[LessEqual[a, 6.7e+16], N[Not[LessEqual[a, 1.7e+78]], $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 -1.1 \lor \neg \left(a \leq 5 \cdot 10^{-74}\right) \land \left(a \leq 6.7 \cdot 10^{+16} \lor \neg \left(a \leq 1.7 \cdot 10^{+78}\right)\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -1.1000000000000001 or 4.99999999999999998e-74 < a < 6.7e16 or 1.70000000000000004e78 < a Initial program 89.7%
associate-+l+89.7%
+-commutative89.7%
*-commutative89.7%
*-commutative89.7%
associate-*l*93.2%
distribute-rgt-out96.9%
fma-def97.7%
+-commutative97.7%
remove-double-neg97.7%
sub-neg97.7%
*-commutative97.7%
fma-neg97.7%
remove-double-neg97.7%
+-commutative97.7%
fma-def97.7%
Simplified97.7%
Taylor expanded in a around inf 75.3%
if -1.1000000000000001 < a < 4.99999999999999998e-74 or 6.7e16 < a < 1.70000000000000004e78Initial program 98.3%
associate-+l+98.3%
+-commutative98.3%
*-commutative98.3%
*-commutative98.3%
associate-*l*92.0%
distribute-rgt-out92.0%
fma-def92.0%
+-commutative92.0%
remove-double-neg92.0%
sub-neg92.0%
*-commutative92.0%
fma-neg92.0%
remove-double-neg92.0%
+-commutative92.0%
fma-def92.0%
Simplified92.0%
Taylor expanded in a around 0 79.4%
Final simplification77.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.5e+63) (not (<= z 2.55e-59))) (* 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 <= -8.5e+63) || !(z <= 2.55e-59)) {
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 <= (-8.5d+63)) .or. (.not. (z <= 2.55d-59))) 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 <= -8.5e+63) || !(z <= 2.55e-59)) {
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 <= -8.5e+63) or not (z <= 2.55e-59): 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 <= -8.5e+63) || !(z <= 2.55e-59)) 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 <= -8.5e+63) || ~((z <= 2.55e-59))) 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, -8.5e+63], N[Not[LessEqual[z, 2.55e-59]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+63} \lor \neg \left(z \leq 2.55 \cdot 10^{-59}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -8.5000000000000004e63 or 2.5499999999999998e-59 < z Initial program 89.1%
associate-+l+89.1%
+-commutative89.1%
*-commutative89.1%
*-commutative89.1%
associate-*l*86.9%
distribute-rgt-out89.9%
fma-def90.6%
+-commutative90.6%
remove-double-neg90.6%
sub-neg90.6%
*-commutative90.6%
fma-neg90.6%
remove-double-neg90.6%
+-commutative90.6%
fma-def90.6%
Simplified90.6%
Taylor expanded in z around inf 80.6%
if -8.5000000000000004e63 < z < 2.5499999999999998e-59Initial program 99.1%
associate-+l+99.1%
+-commutative99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.1%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around 0 91.9%
Final simplification85.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.8e+19) (not (<= z 5e-67))) (+ 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 <= -2.8e+19) || !(z <= 5e-67)) {
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 <= (-2.8d+19)) .or. (.not. (z <= 5d-67))) 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 <= -2.8e+19) || !(z <= 5e-67)) {
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 <= -2.8e+19) or not (z <= 5e-67): 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 <= -2.8e+19) || !(z <= 5e-67)) 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 <= -2.8e+19) || ~((z <= 5e-67))) 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, -2.8e+19], N[Not[LessEqual[z, 5e-67]], $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 -2.8 \cdot 10^{+19} \lor \neg \left(z \leq 5 \cdot 10^{-67}\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.8e19 or 4.9999999999999999e-67 < z Initial program 89.6%
associate-+l+89.6%
+-commutative89.6%
*-commutative89.6%
*-commutative89.6%
associate-*l*87.5%
distribute-rgt-out90.3%
fma-def91.0%
+-commutative91.0%
remove-double-neg91.0%
sub-neg91.0%
*-commutative91.0%
fma-neg91.0%
remove-double-neg91.0%
+-commutative91.0%
fma-def91.0%
Simplified91.0%
Taylor expanded in t around 0 83.1%
+-commutative83.1%
associate-*r*88.5%
distribute-rgt-in92.0%
Simplified92.0%
if -2.8e19 < z < 4.9999999999999999e-67Initial program 99.1%
associate-+l+99.1%
+-commutative99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.0%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around 0 92.4%
Final simplification92.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.45e+62)
(* y z)
(if (<= z 2.55e-291)
x
(if (<= z 1.12e-155) (* t a) (if (<= z 4.5e-62) x (* y z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.45e+62) {
tmp = y * z;
} else if (z <= 2.55e-291) {
tmp = x;
} else if (z <= 1.12e-155) {
tmp = t * a;
} else if (z <= 4.5e-62) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.45d+62)) then
tmp = y * z
else if (z <= 2.55d-291) then
tmp = x
else if (z <= 1.12d-155) then
tmp = t * a
else if (z <= 4.5d-62) then
tmp = x
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.45e+62) {
tmp = y * z;
} else if (z <= 2.55e-291) {
tmp = x;
} else if (z <= 1.12e-155) {
tmp = t * a;
} else if (z <= 4.5e-62) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.45e+62: tmp = y * z elif z <= 2.55e-291: tmp = x elif z <= 1.12e-155: tmp = t * a elif z <= 4.5e-62: tmp = x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.45e+62) tmp = Float64(y * z); elseif (z <= 2.55e-291) tmp = x; elseif (z <= 1.12e-155) tmp = Float64(t * a); elseif (z <= 4.5e-62) tmp = x; else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.45e+62) tmp = y * z; elseif (z <= 2.55e-291) tmp = x; elseif (z <= 1.12e-155) tmp = t * a; elseif (z <= 4.5e-62) tmp = x; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.45e+62], N[(y * z), $MachinePrecision], If[LessEqual[z, 2.55e-291], x, If[LessEqual[z, 1.12e-155], N[(t * a), $MachinePrecision], If[LessEqual[z, 4.5e-62], x, N[(y * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+62}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-291}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-155}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-62}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -1.44999999999999992e62 or 4.50000000000000018e-62 < z Initial program 89.1%
associate-+l+89.1%
+-commutative89.1%
*-commutative89.1%
*-commutative89.1%
associate-*l*86.9%
distribute-rgt-out89.9%
fma-def90.6%
+-commutative90.6%
remove-double-neg90.6%
sub-neg90.6%
*-commutative90.6%
fma-neg90.6%
remove-double-neg90.6%
+-commutative90.6%
fma-def90.6%
Simplified90.6%
Taylor expanded in y around inf 45.2%
if -1.44999999999999992e62 < z < 2.55e-291 or 1.1200000000000001e-155 < z < 4.50000000000000018e-62Initial program 98.9%
associate-+l+98.9%
+-commutative98.9%
*-commutative98.9%
*-commutative98.9%
associate-*l*98.8%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around inf 48.2%
if 2.55e-291 < z < 1.1200000000000001e-155Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*99.9%
distribute-rgt-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 59.7%
Final simplification47.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6.2e+101) (* y z) (if (<= y 1.3e+73) (+ x (* t a)) (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.2e+101) {
tmp = y * z;
} else if (y <= 1.3e+73) {
tmp = x + (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 (y <= (-6.2d+101)) then
tmp = y * z
else if (y <= 1.3d+73) then
tmp = x + (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 (y <= -6.2e+101) {
tmp = y * z;
} else if (y <= 1.3e+73) {
tmp = x + (t * a);
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.2e+101: tmp = y * z elif y <= 1.3e+73: tmp = x + (t * a) else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.2e+101) tmp = Float64(y * z); elseif (y <= 1.3e+73) tmp = Float64(x + 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 (y <= -6.2e+101) tmp = y * z; elseif (y <= 1.3e+73) tmp = x + (t * a); else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.2e+101], N[(y * z), $MachinePrecision], If[LessEqual[y, 1.3e+73], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(y * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+101}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+73}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -6.19999999999999998e101 or 1.3e73 < y Initial program 91.4%
associate-+l+91.4%
+-commutative91.4%
*-commutative91.4%
*-commutative91.4%
associate-*l*91.3%
distribute-rgt-out92.4%
fma-def93.5%
+-commutative93.5%
remove-double-neg93.5%
sub-neg93.5%
*-commutative93.5%
fma-neg93.5%
remove-double-neg93.5%
+-commutative93.5%
fma-def93.5%
Simplified93.5%
Taylor expanded in y around inf 60.8%
if -6.19999999999999998e101 < y < 1.3e73Initial program 95.2%
associate-+l+95.2%
+-commutative95.2%
*-commutative95.2%
*-commutative95.2%
associate-*l*93.4%
distribute-rgt-out95.8%
fma-def95.8%
+-commutative95.8%
remove-double-neg95.8%
sub-neg95.8%
*-commutative95.8%
fma-neg95.8%
remove-double-neg95.8%
+-commutative95.8%
fma-def95.8%
Simplified95.8%
Taylor expanded in z around 0 58.1%
Final simplification59.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a -6.4e+41) (* t a) (if (<= a 1.7e-57) x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6.4e+41) {
tmp = t * a;
} else if (a <= 1.7e-57) {
tmp = x;
} 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 <= (-6.4d+41)) then
tmp = t * a
else if (a <= 1.7d-57) then
tmp = x
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 <= -6.4e+41) {
tmp = t * a;
} else if (a <= 1.7e-57) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6.4e+41: tmp = t * a elif a <= 1.7e-57: tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6.4e+41) tmp = Float64(t * a); elseif (a <= 1.7e-57) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6.4e+41) tmp = t * a; elseif (a <= 1.7e-57) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.4e+41], N[(t * a), $MachinePrecision], If[LessEqual[a, 1.7e-57], x, N[(t * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.4 \cdot 10^{+41}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-57}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -6.40000000000000019e41 or 1.70000000000000008e-57 < a Initial program 89.4%
associate-+l+89.4%
+-commutative89.4%
*-commutative89.4%
*-commutative89.4%
associate-*l*93.0%
distribute-rgt-out96.8%
fma-def97.6%
+-commutative97.6%
remove-double-neg97.6%
sub-neg97.6%
*-commutative97.6%
fma-neg97.6%
remove-double-neg97.6%
+-commutative97.6%
fma-def97.6%
Simplified97.6%
Taylor expanded in t around inf 35.0%
if -6.40000000000000019e41 < a < 1.70000000000000008e-57Initial program 98.4%
associate-+l+98.4%
+-commutative98.4%
*-commutative98.4%
*-commutative98.4%
associate-*l*92.3%
distribute-rgt-out92.3%
fma-def92.3%
+-commutative92.3%
remove-double-neg92.3%
sub-neg92.3%
*-commutative92.3%
fma-neg92.3%
remove-double-neg92.3%
+-commutative92.3%
fma-def92.3%
Simplified92.3%
Taylor expanded in x around inf 40.9%
Final simplification37.9%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.8%
associate-+l+93.8%
+-commutative93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*92.6%
distribute-rgt-out94.6%
fma-def95.0%
+-commutative95.0%
remove-double-neg95.0%
sub-neg95.0%
*-commutative95.0%
fma-neg95.0%
remove-double-neg95.0%
+-commutative95.0%
fma-def95.0%
Simplified95.0%
Taylor expanded in x around inf 27.6%
Final simplification27.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 2023290
(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)))