
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (<= z 1.26e+215) (+ (fma y z 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.26e+215) {
tmp = fma(y, z, 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.26e+215) tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.26e+215], N[(N[(y * z + x), $MachinePrecision] + 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.26 \cdot 10^{+215}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + 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.26e215Initial program 94.0%
associate-+l+94.0%
+-commutative94.0%
fma-define94.0%
associate-*l*96.2%
*-commutative96.2%
*-commutative96.2%
distribute-rgt-out97.9%
*-commutative97.9%
Simplified97.9%
if 1.26e215 < z Initial program 78.1%
associate-+l+78.1%
associate-*l*73.1%
Simplified73.1%
Taylor expanded in z around inf 95.6%
Final simplification97.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* z y)) (* a t)) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(z * y)) + Float64(a * t)) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + z \cdot y\right) + a \cdot t\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 97.6%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*38.5%
Simplified38.5%
Taylor expanded in z around inf 77.0%
Final simplification96.5%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -8.8e+39)
(not (or (<= a -0.00046) (and (not (<= a -3e-92)) (<= a 1.5e-106)))))
(+ x (* a (+ t (* z b))))
(+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.8e+39) || !((a <= -0.00046) || (!(a <= -3e-92) && (a <= 1.5e-106)))) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((a * t) + (z * y));
}
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 <= (-8.8d+39)) .or. (.not. (a <= (-0.00046d0)) .or. (.not. (a <= (-3d-92))) .and. (a <= 1.5d-106))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((a * t) + (z * y))
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 <= -8.8e+39) || !((a <= -0.00046) || (!(a <= -3e-92) && (a <= 1.5e-106)))) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.8e+39) or not ((a <= -0.00046) or (not (a <= -3e-92) and (a <= 1.5e-106))): tmp = x + (a * (t + (z * b))) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8.8e+39) || !((a <= -0.00046) || (!(a <= -3e-92) && (a <= 1.5e-106)))) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -8.8e+39) || ~(((a <= -0.00046) || (~((a <= -3e-92)) && (a <= 1.5e-106))))) tmp = x + (a * (t + (z * b))); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8.8e+39], N[Not[Or[LessEqual[a, -0.00046], And[N[Not[LessEqual[a, -3e-92]], $MachinePrecision], LessEqual[a, 1.5e-106]]]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.8 \cdot 10^{+39} \lor \neg \left(a \leq -0.00046 \lor \neg \left(a \leq -3 \cdot 10^{-92}\right) \land a \leq 1.5 \cdot 10^{-106}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if a < -8.8000000000000006e39 or -4.6000000000000001e-4 < a < -3.00000000000000013e-92 or 1.50000000000000009e-106 < a Initial program 88.6%
associate-+l+88.6%
+-commutative88.6%
fma-define88.6%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
distribute-rgt-out97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in y around 0 92.0%
if -8.8000000000000006e39 < a < -4.6000000000000001e-4 or -3.00000000000000013e-92 < a < 1.50000000000000009e-106Initial program 100.0%
associate-+l+100.0%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in b around 0 97.2%
Final simplification93.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))) (t_2 (+ x (* a t))))
(if (<= x -4.5e+61)
t_2
(if (<= x 8.5e-300)
t_1
(if (<= x 6.2e-280) (* z y) (if (<= x 4.3e+86) t_1 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 + (a * t);
double tmp;
if (x <= -4.5e+61) {
tmp = t_2;
} else if (x <= 8.5e-300) {
tmp = t_1;
} else if (x <= 6.2e-280) {
tmp = z * y;
} else if (x <= 4.3e+86) {
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 = a * (t + (z * b))
t_2 = x + (a * t)
if (x <= (-4.5d+61)) then
tmp = t_2
else if (x <= 8.5d-300) then
tmp = t_1
else if (x <= 6.2d-280) then
tmp = z * y
else if (x <= 4.3d+86) 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 = a * (t + (z * b));
double t_2 = x + (a * t);
double tmp;
if (x <= -4.5e+61) {
tmp = t_2;
} else if (x <= 8.5e-300) {
tmp = t_1;
} else if (x <= 6.2e-280) {
tmp = z * y;
} else if (x <= 4.3e+86) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) t_2 = x + (a * t) tmp = 0 if x <= -4.5e+61: tmp = t_2 elif x <= 8.5e-300: tmp = t_1 elif x <= 6.2e-280: tmp = z * y elif x <= 4.3e+86: tmp = t_1 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 + Float64(a * t)) tmp = 0.0 if (x <= -4.5e+61) tmp = t_2; elseif (x <= 8.5e-300) tmp = t_1; elseif (x <= 6.2e-280) tmp = Float64(z * y); elseif (x <= 4.3e+86) tmp = t_1; 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 + (a * t); tmp = 0.0; if (x <= -4.5e+61) tmp = t_2; elseif (x <= 8.5e-300) tmp = t_1; elseif (x <= 6.2e-280) tmp = z * y; elseif (x <= 4.3e+86) tmp = t_1; 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 + N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.5e+61], t$95$2, If[LessEqual[x, 8.5e-300], t$95$1, If[LessEqual[x, 6.2e-280], N[(z * y), $MachinePrecision], If[LessEqual[x, 4.3e+86], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
t_2 := x + a \cdot t\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{+61}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-300}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-280}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -4.5e61 or 4.3000000000000002e86 < x Initial program 92.3%
associate-+l+92.3%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in z around 0 71.0%
+-commutative71.0%
Simplified71.0%
if -4.5e61 < x < 8.4999999999999995e-300 or 6.20000000000000042e-280 < x < 4.3000000000000002e86Initial program 92.4%
associate-+l+92.4%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in a around inf 72.3%
if 8.4999999999999995e-300 < x < 6.20000000000000042e-280Initial program 100.0%
associate-+l+100.0%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in y around inf 78.1%
*-commutative78.1%
Simplified78.1%
Final simplification72.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<= z -2.6e+40)
t_1
(if (<= z 1.2e-38)
(+ x (* a t))
(if (<= z 1.45e+56)
(* a (+ t (* z b)))
(if (<= z 5.6e+85) (+ (* a t) (* z y)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -2.6e+40) {
tmp = t_1;
} else if (z <= 1.2e-38) {
tmp = x + (a * t);
} else if (z <= 1.45e+56) {
tmp = a * (t + (z * b));
} else if (z <= 5.6e+85) {
tmp = (a * t) + (z * y);
} 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 * (y + (a * b))
if (z <= (-2.6d+40)) then
tmp = t_1
else if (z <= 1.2d-38) then
tmp = x + (a * t)
else if (z <= 1.45d+56) then
tmp = a * (t + (z * b))
else if (z <= 5.6d+85) then
tmp = (a * t) + (z * y)
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 * (y + (a * b));
double tmp;
if (z <= -2.6e+40) {
tmp = t_1;
} else if (z <= 1.2e-38) {
tmp = x + (a * t);
} else if (z <= 1.45e+56) {
tmp = a * (t + (z * b));
} else if (z <= 5.6e+85) {
tmp = (a * t) + (z * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (y + (a * b)) tmp = 0 if z <= -2.6e+40: tmp = t_1 elif z <= 1.2e-38: tmp = x + (a * t) elif z <= 1.45e+56: tmp = a * (t + (z * b)) elif z <= 5.6e+85: tmp = (a * t) + (z * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -2.6e+40) tmp = t_1; elseif (z <= 1.2e-38) tmp = Float64(x + Float64(a * t)); elseif (z <= 1.45e+56) tmp = Float64(a * Float64(t + Float64(z * b))); elseif (z <= 5.6e+85) tmp = Float64(Float64(a * t) + Float64(z * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (y + (a * b)); tmp = 0.0; if (z <= -2.6e+40) tmp = t_1; elseif (z <= 1.2e-38) tmp = x + (a * t); elseif (z <= 1.45e+56) tmp = a * (t + (z * b)); elseif (z <= 5.6e+85) tmp = (a * t) + (z * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+40], t$95$1, If[LessEqual[z, 1.2e-38], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+56], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+85], N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-38}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+56}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+85}:\\
\;\;\;\;a \cdot t + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.6000000000000001e40 or 5.5999999999999998e85 < z Initial program 85.4%
associate-+l+85.4%
associate-*l*86.4%
Simplified86.4%
Taylor expanded in z around inf 79.8%
if -2.6000000000000001e40 < z < 1.20000000000000011e-38Initial program 99.1%
associate-+l+99.1%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 78.0%
+-commutative78.0%
Simplified78.0%
if 1.20000000000000011e-38 < z < 1.45000000000000004e56Initial program 100.0%
associate-+l+100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 82.3%
if 1.45000000000000004e56 < z < 5.5999999999999998e85Initial program 77.8%
associate-+l+77.8%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around 0 100.0%
Taylor expanded in x around 0 89.0%
Final simplification79.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -6.2e+72)
x
(if (<= x 4.2e-301)
(* a t)
(if (<= x 7.2e-157) (* z y) (if (<= x 1.02e+52) (* a t) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.2e+72) {
tmp = x;
} else if (x <= 4.2e-301) {
tmp = a * t;
} else if (x <= 7.2e-157) {
tmp = z * y;
} else if (x <= 1.02e+52) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-6.2d+72)) then
tmp = x
else if (x <= 4.2d-301) then
tmp = a * t
else if (x <= 7.2d-157) then
tmp = z * y
else if (x <= 1.02d+52) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.2e+72) {
tmp = x;
} else if (x <= 4.2e-301) {
tmp = a * t;
} else if (x <= 7.2e-157) {
tmp = z * y;
} else if (x <= 1.02e+52) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6.2e+72: tmp = x elif x <= 4.2e-301: tmp = a * t elif x <= 7.2e-157: tmp = z * y elif x <= 1.02e+52: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6.2e+72) tmp = x; elseif (x <= 4.2e-301) tmp = Float64(a * t); elseif (x <= 7.2e-157) tmp = Float64(z * y); elseif (x <= 1.02e+52) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6.2e+72) tmp = x; elseif (x <= 4.2e-301) tmp = a * t; elseif (x <= 7.2e-157) tmp = z * y; elseif (x <= 1.02e+52) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.2e+72], x, If[LessEqual[x, 4.2e-301], N[(a * t), $MachinePrecision], If[LessEqual[x, 7.2e-157], N[(z * y), $MachinePrecision], If[LessEqual[x, 1.02e+52], N[(a * t), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+72}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-301}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-157}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{+52}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.19999999999999977e72 or 1.02000000000000002e52 < x Initial program 91.6%
associate-+l+91.6%
associate-*l*97.9%
Simplified97.9%
Taylor expanded in x around inf 56.8%
if -6.19999999999999977e72 < x < 4.1999999999999997e-301 or 7.2e-157 < x < 1.02000000000000002e52Initial program 92.4%
associate-+l+92.4%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in t around inf 43.0%
if 4.1999999999999997e-301 < x < 7.2e-157Initial program 96.9%
associate-+l+96.9%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in y around inf 54.4%
*-commutative54.4%
Simplified54.4%
Final simplification49.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -9e+50)
x
(if (<= x 3.2e-301)
(* a (* z b))
(if (<= x 9.5e-157) (* z y) (if (<= x 7e+50) (* a t) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9e+50) {
tmp = x;
} else if (x <= 3.2e-301) {
tmp = a * (z * b);
} else if (x <= 9.5e-157) {
tmp = z * y;
} else if (x <= 7e+50) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-9d+50)) then
tmp = x
else if (x <= 3.2d-301) then
tmp = a * (z * b)
else if (x <= 9.5d-157) then
tmp = z * y
else if (x <= 7d+50) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9e+50) {
tmp = x;
} else if (x <= 3.2e-301) {
tmp = a * (z * b);
} else if (x <= 9.5e-157) {
tmp = z * y;
} else if (x <= 7e+50) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -9e+50: tmp = x elif x <= 3.2e-301: tmp = a * (z * b) elif x <= 9.5e-157: tmp = z * y elif x <= 7e+50: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -9e+50) tmp = x; elseif (x <= 3.2e-301) tmp = Float64(a * Float64(z * b)); elseif (x <= 9.5e-157) tmp = Float64(z * y); elseif (x <= 7e+50) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -9e+50) tmp = x; elseif (x <= 3.2e-301) tmp = a * (z * b); elseif (x <= 9.5e-157) tmp = z * y; elseif (x <= 7e+50) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9e+50], x, If[LessEqual[x, 3.2e-301], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-157], N[(z * y), $MachinePrecision], If[LessEqual[x, 7e+50], N[(a * t), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-301}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-157}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+50}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.00000000000000027e50 or 7.00000000000000012e50 < x Initial program 92.0%
associate-+l+92.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 55.2%
if -9.00000000000000027e50 < x < 3.1999999999999999e-301Initial program 91.5%
associate-+l+91.5%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in a around inf 76.6%
Taylor expanded in t around 0 42.4%
if 3.1999999999999999e-301 < x < 9.50000000000000019e-157Initial program 96.9%
associate-+l+96.9%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in y around inf 54.4%
*-commutative54.4%
Simplified54.4%
if 9.50000000000000019e-157 < x < 7.00000000000000012e50Initial program 93.3%
associate-+l+93.3%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in t around inf 50.4%
Final simplification50.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= z -2.9e+40)
t_1
(if (<= z 7.8e+158) (+ x (* a t)) (if (<= z 8.2e+278) t_1 (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (z <= -2.9e+40) {
tmp = t_1;
} else if (z <= 7.8e+158) {
tmp = x + (a * t);
} else if (z <= 8.2e+278) {
tmp = t_1;
} else {
tmp = z * y;
}
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 <= (-2.9d+40)) then
tmp = t_1
else if (z <= 7.8d+158) then
tmp = x + (a * t)
else if (z <= 8.2d+278) then
tmp = t_1
else
tmp = z * y
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 <= -2.9e+40) {
tmp = t_1;
} else if (z <= 7.8e+158) {
tmp = x + (a * t);
} else if (z <= 8.2e+278) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if z <= -2.9e+40: tmp = t_1 elif z <= 7.8e+158: tmp = x + (a * t) elif z <= 8.2e+278: tmp = t_1 else: tmp = z * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (z <= -2.9e+40) tmp = t_1; elseif (z <= 7.8e+158) tmp = Float64(x + Float64(a * t)); elseif (z <= 8.2e+278) tmp = t_1; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (z <= -2.9e+40) tmp = t_1; elseif (z <= 7.8e+158) tmp = x + (a * t); elseif (z <= 8.2e+278) tmp = t_1; else tmp = z * y; 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, -2.9e+40], t$95$1, If[LessEqual[z, 7.8e+158], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+278], t$95$1, N[(z * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+158}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+278}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -2.90000000000000017e40 or 7.8e158 < z < 8.2000000000000003e278Initial program 86.9%
associate-+l+86.9%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in a around inf 60.2%
Taylor expanded in t around 0 51.4%
if -2.90000000000000017e40 < z < 7.8e158Initial program 96.3%
associate-+l+96.3%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in z around 0 70.9%
+-commutative70.9%
Simplified70.9%
if 8.2000000000000003e278 < z Initial program 78.6%
associate-+l+78.6%
associate-*l*77.8%
Simplified77.8%
Taylor expanded in y around inf 89.5%
*-commutative89.5%
Simplified89.5%
Final simplification65.3%
(FPCore (x y z t a b) :precision binary64 (if (<= z 9.5e+214) (+ (+ x (* z y)) (+ (* a t) (* a (* z b)))) (* z (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 9.5e+214) {
tmp = (x + (z * y)) + ((a * t) + (a * (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 <= 9.5d+214) then
tmp = (x + (z * y)) + ((a * t) + (a * (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 <= 9.5e+214) {
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 9.5e+214: tmp = (x + (z * y)) + ((a * t) + (a * (z * b))) else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 9.5e+214) tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * t) + Float64(a * 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 <= 9.5e+214) tmp = (x + (z * y)) + ((a * t) + (a * (z * b))); else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 9.5e+214], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] + N[(a * 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 9.5 \cdot 10^{+214}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 9.49999999999999921e214Initial program 94.0%
associate-+l+94.0%
associate-*l*96.2%
Simplified96.2%
if 9.49999999999999921e214 < z Initial program 78.1%
associate-+l+78.1%
associate-*l*73.1%
Simplified73.1%
Taylor expanded in z around inf 95.6%
Final simplification96.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.35e+98) (not (<= z 1.05e+174))) (* 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.35e+98) || !(z <= 1.05e+174)) {
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 <= (-2.35d+98)) .or. (.not. (z <= 1.05d+174))) 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 <= -2.35e+98) || !(z <= 1.05e+174)) {
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 <= -2.35e+98) or not (z <= 1.05e+174): 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 <= -2.35e+98) || !(z <= 1.05e+174)) 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 <= -2.35e+98) || ~((z <= 1.05e+174))) 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, -2.35e+98], N[Not[LessEqual[z, 1.05e+174]], $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 -2.35 \cdot 10^{+98} \lor \neg \left(z \leq 1.05 \cdot 10^{+174}\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 < -2.34999999999999985e98 or 1.05000000000000008e174 < z Initial program 84.0%
associate-+l+84.0%
associate-*l*86.4%
Simplified86.4%
Taylor expanded in z around inf 86.5%
if -2.34999999999999985e98 < z < 1.05000000000000008e174Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
fma-define96.6%
associate-*l*97.7%
*-commutative97.7%
*-commutative97.7%
distribute-rgt-out98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in y around 0 88.2%
Final simplification87.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.85e+40) (not (<= z 5.4e+26))) (* z (+ y (* a b))) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.85e+40) || !(z <= 5.4e+26)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
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.85d+40)) .or. (.not. (z <= 5.4d+26))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * t)
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.85e+40) || !(z <= 5.4e+26)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.85e+40) or not (z <= 5.4e+26): tmp = z * (y + (a * b)) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.85e+40) || !(z <= 5.4e+26)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.85e+40) || ~((z <= 5.4e+26))) tmp = z * (y + (a * b)); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.85e+40], N[Not[LessEqual[z, 5.4e+26]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+40} \lor \neg \left(z \leq 5.4 \cdot 10^{+26}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -1.85e40 or 5.4e26 < z Initial program 85.4%
associate-+l+85.4%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in z around inf 76.9%
if -1.85e40 < z < 5.4e26Initial program 99.2%
associate-+l+99.2%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 77.3%
+-commutative77.3%
Simplified77.3%
Final simplification77.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -4.5e+72) x (if (<= x 6e+49) (* a t) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.5e+72) {
tmp = x;
} else if (x <= 6e+49) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-4.5d+72)) then
tmp = x
else if (x <= 6d+49) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.5e+72) {
tmp = x;
} else if (x <= 6e+49) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4.5e+72: tmp = x elif x <= 6e+49: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.5e+72) tmp = x; elseif (x <= 6e+49) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -4.5e+72) tmp = x; elseif (x <= 6e+49) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.5e+72], x, If[LessEqual[x, 6e+49], N[(a * t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+72}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+49}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.4999999999999998e72 or 6.0000000000000005e49 < x Initial program 91.6%
associate-+l+91.6%
associate-*l*97.9%
Simplified97.9%
Taylor expanded in x around inf 56.8%
if -4.4999999999999998e72 < x < 6.0000000000000005e49Initial program 93.2%
associate-+l+93.2%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in t around inf 38.5%
Final simplification45.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.6%
associate-+l+92.6%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in x around inf 25.9%
Final simplification25.9%
(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 2024047
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))