
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (* t (+ a (/ (+ x (* z (+ y (* a b)))) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = t * (a + ((x + (z * (y + (a * b)))) / t));
}
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)) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = t * (a + ((x + (z * (y + (a * b)))) / t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = t * (a + ((x + (z * (y + (a * b)))) / t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(t * Float64(a + Float64(Float64(x + Float64(z * Float64(y + Float64(a * b)))) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = t * (a + ((x + (z * (y + (a * b)))) / t)); 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[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(t * N[(a + N[(N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(a + \frac{x + z \cdot \left(y + a \cdot b\right)}{t}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 99.2%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
Taylor expanded in t around -inf 50.0%
associate-*r*50.0%
mul-1-neg50.0%
distribute-lft-out50.0%
+-commutative50.0%
associate-*r*50.0%
distribute-rgt-in81.3%
Simplified81.3%
Final simplification98.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (+ x (* 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)) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x + (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)) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x + (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(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; 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) t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = x + (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[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 99.2%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
Taylor expanded in t around 0 44.3%
+-commutative44.3%
associate-*r*44.3%
distribute-rgt-in75.5%
Simplified75.5%
Final simplification97.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.2e+108)
(* a (* z b))
(if (<= z 1.7e-45)
(+ x (* t a))
(if (or (<= z 1.9e+159) (not (<= z 1.5e+256)))
(+ x (* y z))
(* z (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e+108) {
tmp = a * (z * b);
} else if (z <= 1.7e-45) {
tmp = x + (t * a);
} else if ((z <= 1.9e+159) || !(z <= 1.5e+256)) {
tmp = x + (y * z);
} 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 <= (-4.2d+108)) then
tmp = a * (z * b)
else if (z <= 1.7d-45) then
tmp = x + (t * a)
else if ((z <= 1.9d+159) .or. (.not. (z <= 1.5d+256))) then
tmp = x + (y * z)
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 <= -4.2e+108) {
tmp = a * (z * b);
} else if (z <= 1.7e-45) {
tmp = x + (t * a);
} else if ((z <= 1.9e+159) || !(z <= 1.5e+256)) {
tmp = x + (y * z);
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.2e+108: tmp = a * (z * b) elif z <= 1.7e-45: tmp = x + (t * a) elif (z <= 1.9e+159) or not (z <= 1.5e+256): tmp = x + (y * z) else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.2e+108) tmp = Float64(a * Float64(z * b)); elseif (z <= 1.7e-45) tmp = Float64(x + Float64(t * a)); elseif ((z <= 1.9e+159) || !(z <= 1.5e+256)) tmp = Float64(x + Float64(y * z)); 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 <= -4.2e+108) tmp = a * (z * b); elseif (z <= 1.7e-45) tmp = x + (t * a); elseif ((z <= 1.9e+159) || ~((z <= 1.5e+256))) tmp = x + (y * z); else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.2e+108], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-45], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.9e+159], N[Not[LessEqual[z, 1.5e+256]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+108}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-45}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+159} \lor \neg \left(z \leq 1.5 \cdot 10^{+256}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -4.20000000000000019e108Initial program 84.9%
Taylor expanded in z around inf 78.4%
+-commutative78.4%
Simplified78.4%
Taylor expanded in a around inf 59.1%
if -4.20000000000000019e108 < z < 1.70000000000000002e-45Initial program 99.4%
Taylor expanded in z around 0 75.2%
+-commutative75.2%
Simplified75.2%
if 1.70000000000000002e-45 < z < 1.89999999999999983e159 or 1.5e256 < z Initial program 88.6%
Taylor expanded in a around 0 62.7%
if 1.89999999999999983e159 < z < 1.5e256Initial program 67.0%
Taylor expanded in z around inf 83.4%
+-commutative83.4%
Simplified83.4%
Taylor expanded in a around inf 56.8%
associate-*r*61.9%
*-commutative61.9%
Simplified61.9%
Final simplification69.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= t -6.7e+173)
(* t a)
(if (<= t -1.32e+94)
t_1
(if (<= t -3.8e+67) (* a (* z b)) (if (<= t 1.7e+134) t_1 (* t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (t <= -6.7e+173) {
tmp = t * a;
} else if (t <= -1.32e+94) {
tmp = t_1;
} else if (t <= -3.8e+67) {
tmp = a * (z * b);
} else if (t <= 1.7e+134) {
tmp = t_1;
} else {
tmp = t * a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * z)
if (t <= (-6.7d+173)) then
tmp = t * a
else if (t <= (-1.32d+94)) then
tmp = t_1
else if (t <= (-3.8d+67)) then
tmp = a * (z * b)
else if (t <= 1.7d+134) then
tmp = t_1
else
tmp = t * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (t <= -6.7e+173) {
tmp = t * a;
} else if (t <= -1.32e+94) {
tmp = t_1;
} else if (t <= -3.8e+67) {
tmp = a * (z * b);
} else if (t <= 1.7e+134) {
tmp = t_1;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if t <= -6.7e+173: tmp = t * a elif t <= -1.32e+94: tmp = t_1 elif t <= -3.8e+67: tmp = a * (z * b) elif t <= 1.7e+134: tmp = t_1 else: tmp = t * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (t <= -6.7e+173) tmp = Float64(t * a); elseif (t <= -1.32e+94) tmp = t_1; elseif (t <= -3.8e+67) tmp = Float64(a * Float64(z * b)); elseif (t <= 1.7e+134) tmp = t_1; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (t <= -6.7e+173) tmp = t * a; elseif (t <= -1.32e+94) tmp = t_1; elseif (t <= -3.8e+67) tmp = a * (z * b); elseif (t <= 1.7e+134) tmp = t_1; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.7e+173], N[(t * a), $MachinePrecision], If[LessEqual[t, -1.32e+94], t$95$1, If[LessEqual[t, -3.8e+67], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e+134], t$95$1, N[(t * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;t \leq -6.7 \cdot 10^{+173}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq -1.32 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{+67}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -6.7000000000000002e173 or 1.70000000000000009e134 < t Initial program 92.8%
Taylor expanded in t around -inf 93.0%
associate-*r*93.0%
mul-1-neg93.0%
distribute-lft-out93.0%
+-commutative93.0%
associate-*r*88.8%
distribute-rgt-in88.8%
Simplified88.8%
Taylor expanded in t around inf 68.2%
if -6.7000000000000002e173 < t < -1.32000000000000003e94 or -3.8000000000000002e67 < t < 1.70000000000000009e134Initial program 93.3%
Taylor expanded in a around 0 61.9%
if -1.32000000000000003e94 < t < -3.8000000000000002e67Initial program 86.5%
Taylor expanded in z around inf 71.6%
+-commutative71.6%
Simplified71.6%
Taylor expanded in a around inf 71.8%
Final simplification63.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -3.4e+44)
(* b (* z a))
(if (<= b -1.76e-43)
(* y z)
(if (<= b 1.42e-188) x (if (<= b 5e-8) (* t a) (* a (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.4e+44) {
tmp = b * (z * a);
} else if (b <= -1.76e-43) {
tmp = y * z;
} else if (b <= 1.42e-188) {
tmp = x;
} else if (b <= 5e-8) {
tmp = t * a;
} 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 (b <= (-3.4d+44)) then
tmp = b * (z * a)
else if (b <= (-1.76d-43)) then
tmp = y * z
else if (b <= 1.42d-188) then
tmp = x
else if (b <= 5d-8) then
tmp = t * a
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 (b <= -3.4e+44) {
tmp = b * (z * a);
} else if (b <= -1.76e-43) {
tmp = y * z;
} else if (b <= 1.42e-188) {
tmp = x;
} else if (b <= 5e-8) {
tmp = t * a;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -3.4e+44: tmp = b * (z * a) elif b <= -1.76e-43: tmp = y * z elif b <= 1.42e-188: tmp = x elif b <= 5e-8: tmp = t * a else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.4e+44) tmp = Float64(b * Float64(z * a)); elseif (b <= -1.76e-43) tmp = Float64(y * z); elseif (b <= 1.42e-188) tmp = x; elseif (b <= 5e-8) tmp = Float64(t * a); 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 (b <= -3.4e+44) tmp = b * (z * a); elseif (b <= -1.76e-43) tmp = y * z; elseif (b <= 1.42e-188) tmp = x; elseif (b <= 5e-8) tmp = t * a; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.4e+44], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.76e-43], N[(y * z), $MachinePrecision], If[LessEqual[b, 1.42e-188], x, If[LessEqual[b, 5e-8], N[(t * a), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.4 \cdot 10^{+44}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;b \leq -1.76 \cdot 10^{-43}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 1.42 \cdot 10^{-188}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-8}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if b < -3.4e44Initial program 88.4%
Taylor expanded in z around inf 63.6%
+-commutative63.6%
Simplified63.6%
Taylor expanded in a around inf 52.8%
*-commutative52.8%
associate-*r*54.0%
Simplified54.0%
if -3.4e44 < b < -1.7600000000000001e-43Initial program 90.0%
Taylor expanded in y around inf 61.2%
*-commutative61.2%
Simplified61.2%
if -1.7600000000000001e-43 < b < 1.4200000000000001e-188Initial program 95.9%
Taylor expanded in x around inf 46.3%
if 1.4200000000000001e-188 < b < 4.9999999999999998e-8Initial program 91.1%
Taylor expanded in t around -inf 84.9%
associate-*r*84.9%
mul-1-neg84.9%
distribute-lft-out84.9%
+-commutative84.9%
associate-*r*84.9%
distribute-rgt-in84.9%
Simplified84.9%
Taylor expanded in t around inf 49.2%
if 4.9999999999999998e-8 < b Initial program 96.5%
Taylor expanded in z around inf 50.3%
+-commutative50.3%
Simplified50.3%
Taylor expanded in a around inf 45.4%
Final simplification49.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= b -9.2e+44)
t_1
(if (<= b -1.15e-40)
(* y z)
(if (<= b 2.65e-188) x (if (<= b 1.35e-8) (* t a) 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 (b <= -9.2e+44) {
tmp = t_1;
} else if (b <= -1.15e-40) {
tmp = y * z;
} else if (b <= 2.65e-188) {
tmp = x;
} else if (b <= 1.35e-8) {
tmp = t * a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (b <= (-9.2d+44)) then
tmp = t_1
else if (b <= (-1.15d-40)) then
tmp = y * z
else if (b <= 2.65d-188) then
tmp = x
else if (b <= 1.35d-8) then
tmp = t * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (b <= -9.2e+44) {
tmp = t_1;
} else if (b <= -1.15e-40) {
tmp = y * z;
} else if (b <= 2.65e-188) {
tmp = x;
} else if (b <= 1.35e-8) {
tmp = t * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if b <= -9.2e+44: tmp = t_1 elif b <= -1.15e-40: tmp = y * z elif b <= 2.65e-188: tmp = x elif b <= 1.35e-8: tmp = t * a 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 (b <= -9.2e+44) tmp = t_1; elseif (b <= -1.15e-40) tmp = Float64(y * z); elseif (b <= 2.65e-188) tmp = x; elseif (b <= 1.35e-8) tmp = Float64(t * a); 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 (b <= -9.2e+44) tmp = t_1; elseif (b <= -1.15e-40) tmp = y * z; elseif (b <= 2.65e-188) tmp = x; elseif (b <= 1.35e-8) tmp = t * a; 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[b, -9.2e+44], t$95$1, If[LessEqual[b, -1.15e-40], N[(y * z), $MachinePrecision], If[LessEqual[b, 2.65e-188], x, If[LessEqual[b, 1.35e-8], N[(t * a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;b \leq -9.2 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.15 \cdot 10^{-40}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 2.65 \cdot 10^{-188}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 1.35 \cdot 10^{-8}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.20000000000000018e44 or 1.35000000000000001e-8 < b Initial program 92.4%
Taylor expanded in z around inf 57.1%
+-commutative57.1%
Simplified57.1%
Taylor expanded in a around inf 49.2%
if -9.20000000000000018e44 < b < -1.15e-40Initial program 90.0%
Taylor expanded in y around inf 61.2%
*-commutative61.2%
Simplified61.2%
if -1.15e-40 < b < 2.65000000000000007e-188Initial program 95.9%
Taylor expanded in x around inf 46.3%
if 2.65000000000000007e-188 < b < 1.35000000000000001e-8Initial program 91.1%
Taylor expanded in t around -inf 84.9%
associate-*r*84.9%
mul-1-neg84.9%
distribute-lft-out84.9%
+-commutative84.9%
associate-*r*84.9%
distribute-rgt-in84.9%
Simplified84.9%
Taylor expanded in t around inf 49.2%
Final simplification49.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.1e+171)
(+ x (* z (+ y (* a b))))
(if (or (<= b -1.25e+46) (not (<= b 0.0035)))
(+ x (* a (+ t (* z b))))
(+ x (+ (* y z) (* t a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.1e+171) {
tmp = x + (z * (y + (a * b)));
} else if ((b <= -1.25e+46) || !(b <= 0.0035)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((y * z) + (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 (b <= (-1.1d+171)) then
tmp = x + (z * (y + (a * b)))
else if ((b <= (-1.25d+46)) .or. (.not. (b <= 0.0035d0))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((y * z) + (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 (b <= -1.1e+171) {
tmp = x + (z * (y + (a * b)));
} else if ((b <= -1.25e+46) || !(b <= 0.0035)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((y * z) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.1e+171: tmp = x + (z * (y + (a * b))) elif (b <= -1.25e+46) or not (b <= 0.0035): tmp = x + (a * (t + (z * b))) else: tmp = x + ((y * z) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.1e+171) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); elseif ((b <= -1.25e+46) || !(b <= 0.0035)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.1e+171) tmp = x + (z * (y + (a * b))); elseif ((b <= -1.25e+46) || ~((b <= 0.0035))) tmp = x + (a * (t + (z * b))); else tmp = x + ((y * z) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.1e+171], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, -1.25e+46], N[Not[LessEqual[b, 0.0035]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{+171}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;b \leq -1.25 \cdot 10^{+46} \lor \neg \left(b \leq 0.0035\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\end{array}
\end{array}
if b < -1.1e171Initial program 94.2%
Taylor expanded in t around 0 61.7%
+-commutative61.7%
associate-*r*80.4%
distribute-rgt-in86.1%
Simplified86.1%
if -1.1e171 < b < -1.2500000000000001e46 or 0.00350000000000000007 < b Initial program 91.2%
Taylor expanded in a around 0 93.8%
Taylor expanded in a around inf 92.7%
if -1.2500000000000001e46 < b < 0.00350000000000000007Initial program 93.7%
Taylor expanded in b around 0 93.6%
Final simplification92.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -8.5e+45) (not (<= b 0.003))) (+ x (* a (+ t (* z b)))) (+ x (+ (* y z) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -8.5e+45) || !(b <= 0.003)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((y * z) + (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 ((b <= (-8.5d+45)) .or. (.not. (b <= 0.003d0))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((y * z) + (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 ((b <= -8.5e+45) || !(b <= 0.003)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((y * z) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -8.5e+45) or not (b <= 0.003): tmp = x + (a * (t + (z * b))) else: tmp = x + ((y * z) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -8.5e+45) || !(b <= 0.003)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -8.5e+45) || ~((b <= 0.003))) tmp = x + (a * (t + (z * b))); else tmp = x + ((y * z) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -8.5e+45], N[Not[LessEqual[b, 0.003]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.5 \cdot 10^{+45} \lor \neg \left(b \leq 0.003\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\end{array}
\end{array}
if b < -8.4999999999999996e45 or 0.0030000000000000001 < b Initial program 92.1%
Taylor expanded in a around 0 87.5%
Taylor expanded in a around inf 85.9%
if -8.4999999999999996e45 < b < 0.0030000000000000001Initial program 93.7%
Taylor expanded in b around 0 93.6%
Final simplification90.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.3e-201) (not (<= a 5e-201))) (+ x (* 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 <= -4.3e-201) || !(a <= 5e-201)) {
tmp = x + (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 <= (-4.3d-201)) .or. (.not. (a <= 5d-201))) then
tmp = x + (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 <= -4.3e-201) || !(a <= 5e-201)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.3e-201) or not (a <= 5e-201): tmp = x + (a * (t + (z * b))) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.3e-201) || !(a <= 5e-201)) tmp = Float64(x + 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 <= -4.3e-201) || ~((a <= 5e-201))) tmp = x + (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, -4.3e-201], N[Not[LessEqual[a, 5e-201]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{-201} \lor \neg \left(a \leq 5 \cdot 10^{-201}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -4.2999999999999997e-201 or 4.9999999999999999e-201 < a Initial program 91.3%
Taylor expanded in a around 0 96.1%
Taylor expanded in a around inf 86.0%
if -4.2999999999999997e-201 < a < 4.9999999999999999e-201Initial program 99.9%
Taylor expanded in a around 0 90.3%
Final simplification86.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b -3.5e+92) (+ x (* b (* z (+ a (/ y b))))) (if (<= b 0.0032) (+ x (+ (* y z) (* t a))) (+ x (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.5e+92) {
tmp = x + (b * (z * (a + (y / b))));
} else if (b <= 0.0032) {
tmp = x + ((y * z) + (t * a));
} 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 (b <= (-3.5d+92)) then
tmp = x + (b * (z * (a + (y / b))))
else if (b <= 0.0032d0) then
tmp = x + ((y * z) + (t * a))
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 (b <= -3.5e+92) {
tmp = x + (b * (z * (a + (y / b))));
} else if (b <= 0.0032) {
tmp = x + ((y * z) + (t * a));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -3.5e+92: tmp = x + (b * (z * (a + (y / b)))) elif b <= 0.0032: tmp = x + ((y * z) + (t * a)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.5e+92) tmp = Float64(x + Float64(b * Float64(z * Float64(a + Float64(y / b))))); elseif (b <= 0.0032) tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a))); 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 (b <= -3.5e+92) tmp = x + (b * (z * (a + (y / b)))); elseif (b <= 0.0032) tmp = x + ((y * z) + (t * a)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.5e+92], N[(x + N[(b * N[(z * N[(a + N[(y / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.0032], N[(x + N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.5 \cdot 10^{+92}:\\
\;\;\;\;x + b \cdot \left(z \cdot \left(a + \frac{y}{b}\right)\right)\\
\mathbf{elif}\;b \leq 0.0032:\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if b < -3.49999999999999986e92Initial program 90.1%
Taylor expanded in a around 0 79.4%
Taylor expanded in b around inf 92.1%
associate-+r+92.1%
+-commutative92.1%
*-commutative92.1%
associate-/l*96.0%
associate-/l*99.8%
distribute-lft-out99.8%
Simplified99.8%
Taylor expanded in z around inf 90.4%
if -3.49999999999999986e92 < b < 0.00320000000000000015Initial program 92.7%
Taylor expanded in b around 0 92.1%
if 0.00320000000000000015 < b Initial program 96.2%
Taylor expanded in a around 0 94.6%
Taylor expanded in a around inf 89.4%
Final simplification91.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z 1.76e+129) (+ x (+ (* y z) (* a (+ t (* z b))))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.76e+129) {
tmp = x + ((y * z) + (a * (t + (z * b))));
} 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.76d+129) then
tmp = x + ((y * z) + (a * (t + (z * b))))
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.76e+129) {
tmp = x + ((y * z) + (a * (t + (z * b))));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 1.76e+129: tmp = x + ((y * z) + (a * (t + (z * b)))) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.76e+129) tmp = Float64(x + Float64(Float64(y * z) + Float64(a * Float64(t + Float64(z * b))))); 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.76e+129) tmp = x + ((y * z) + (a * (t + (z * b)))); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.76e+129], N[(x + N[(N[(y * z), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $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.76 \cdot 10^{+129}:\\
\;\;\;\;x + \left(y \cdot z + a \cdot \left(t + z \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 1.76000000000000013e129Initial program 96.4%
Taylor expanded in a around 0 97.3%
if 1.76000000000000013e129 < z Initial program 71.5%
Taylor expanded in t around 0 70.0%
+-commutative70.0%
associate-*r*85.9%
distribute-rgt-in94.5%
Simplified94.5%
Final simplification96.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.8e+29) (not (<= z 2.4e-42))) (* 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 <= -8.8e+29) || !(z <= 2.4e-42)) {
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 <= (-8.8d+29)) .or. (.not. (z <= 2.4d-42))) 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 <= -8.8e+29) || !(z <= 2.4e-42)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.8e+29) or not (z <= 2.4e-42): 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 <= -8.8e+29) || !(z <= 2.4e-42)) 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 <= -8.8e+29) || ~((z <= 2.4e-42))) 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, -8.8e+29], N[Not[LessEqual[z, 2.4e-42]], $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 -8.8 \cdot 10^{+29} \lor \neg \left(z \leq 2.4 \cdot 10^{-42}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -8.8000000000000005e29 or 2.40000000000000003e-42 < z Initial program 84.5%
Taylor expanded in z around inf 77.6%
+-commutative77.6%
Simplified77.6%
if -8.8000000000000005e29 < z < 2.40000000000000003e-42Initial program 100.0%
Taylor expanded in z around 0 79.6%
+-commutative79.6%
Simplified79.6%
Final simplification78.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.6e+37) (not (<= t 1900000000000.0))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.6e+37) || !(t <= 1900000000000.0)) {
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 <= (-2.6d+37)) .or. (.not. (t <= 1900000000000.0d0))) 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 <= -2.6e+37) || !(t <= 1900000000000.0)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.6e+37) or not (t <= 1900000000000.0): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.6e+37) || !(t <= 1900000000000.0)) 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 <= -2.6e+37) || ~((t <= 1900000000000.0))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.6e+37], N[Not[LessEqual[t, 1900000000000.0]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+37} \lor \neg \left(t \leq 1900000000000\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.5999999999999999e37 or 1.9e12 < t Initial program 91.7%
Taylor expanded in t around -inf 92.1%
associate-*r*92.1%
mul-1-neg92.1%
distribute-lft-out92.1%
+-commutative92.1%
associate-*r*91.8%
distribute-rgt-in93.3%
Simplified93.3%
Taylor expanded in t around inf 51.3%
if -2.5999999999999999e37 < t < 1.9e12Initial program 94.3%
Taylor expanded in x around inf 41.0%
Final simplification46.4%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.0%
Taylor expanded in x around inf 28.4%
(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 2024111
(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)))