
(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 (if (or (<= z -1.8e+76) (not (<= z 8.8e-50))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ (+ (* a (* z b)) (* t a)) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.8e+76) || !(z <= 8.8e-50)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = ((a * (z * b)) + (t * a)) + (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 ((z <= (-1.8d+76)) .or. (.not. (z <= 8.8d-50))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = ((a * (z * b)) + (t * a)) + (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 ((z <= -1.8e+76) || !(z <= 8.8e-50)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = ((a * (z * b)) + (t * a)) + (x + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.8e+76) or not (z <= 8.8e-50): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = ((a * (z * b)) + (t * a)) + (x + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.8e+76) || !(z <= 8.8e-50)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(Float64(Float64(a * Float64(z * b)) + Float64(t * a)) + Float64(x + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.8e+76) || ~((z <= 8.8e-50))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = ((a * (z * b)) + (t * a)) + (x + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.8e+76], N[Not[LessEqual[z, 8.8e-50]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+76} \lor \neg \left(z \leq 8.8 \cdot 10^{-50}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + t \cdot a\right) + \left(x + y \cdot z\right)\\
\end{array}
\end{array}
if z < -1.8000000000000001e76 or 8.7999999999999996e-50 < z Initial program 90.1%
associate-+l+90.1%
associate-*l*82.7%
Simplified82.7%
Taylor expanded in z around inf 94.9%
+-commutative94.9%
associate-+l+94.9%
+-commutative94.9%
associate-/l*97.4%
distribute-lft-out99.9%
Simplified99.9%
if -1.8000000000000001e76 < z < 8.7999999999999996e-50Initial program 98.6%
associate-+l+98.6%
associate-*l*100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* t a) (+ x (* y z))) (* (* z a) b)))) (if (<= t_1 1e+308) t_1 (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b);
double tmp;
if (t_1 <= 1e+308) {
tmp = t_1;
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / 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) :: t_1
real(8) :: tmp
t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b)
if (t_1 <= 1d+308) then
tmp = t_1
else
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
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 = ((t * a) + (x + (y * z))) + ((z * a) * b);
double tmp;
if (t_1 <= 1e+308) {
tmp = t_1;
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b) tmp = 0 if t_1 <= 1e+308: tmp = t_1 else: tmp = z * (y + ((x / z) + (a * (b + (t / z))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= 1e+308) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b); tmp = 0.0; if (t_1 <= 1e+308) tmp = t_1; else tmp = z * (y + ((x / z) + (a * (b + (t / z))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+308], t$95$1, N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq 10^{+308}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 1e308Initial program 99.5%
if 1e308 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 73.4%
associate-+l+73.4%
associate-*l*83.3%
Simplified83.3%
Taylor expanded in z around inf 85.4%
+-commutative85.4%
associate-+l+85.4%
+-commutative85.4%
associate-/l*91.7%
distribute-lft-out97.9%
Simplified97.9%
Final simplification99.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.35e-9) (not (<= z 3.8e-99))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ x (+ (* y z) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.35e-9) || !(z <= 3.8e-99)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} 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 ((z <= (-1.35d-9)) .or. (.not. (z <= 3.8d-99))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
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 ((z <= -1.35e-9) || !(z <= 3.8e-99)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + ((y * z) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.35e-9) or not (z <= 3.8e-99): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = x + ((y * z) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.35e-9) || !(z <= 3.8e-99)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); 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 ((z <= -1.35e-9) || ~((z <= 3.8e-99))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = x + ((y * z) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.35e-9], N[Not[LessEqual[z, 3.8e-99]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $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}\;z \leq -1.35 \cdot 10^{-9} \lor \neg \left(z \leq 3.8 \cdot 10^{-99}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\end{array}
\end{array}
if z < -1.3500000000000001e-9 or 3.7999999999999997e-99 < z Initial program 90.5%
associate-+l+90.5%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in z around inf 94.5%
+-commutative94.5%
associate-+l+94.5%
+-commutative94.5%
associate-/l*96.6%
distribute-lft-out98.6%
Simplified98.6%
if -1.3500000000000001e-9 < z < 3.7999999999999997e-99Initial program 99.9%
associate-+l+99.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around 0 94.3%
Final simplification96.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a (+ t (* z b))))))
(if (<= a -8.8e-12)
t_1
(if (<= a 2.8e-229)
(+ x (* z (+ y (* a b))))
(if (<= a 5.8e-35) (+ x (+ (* y z) (* t a))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * (t + (z * b)));
double tmp;
if (a <= -8.8e-12) {
tmp = t_1;
} else if (a <= 2.8e-229) {
tmp = x + (z * (y + (a * b)));
} else if (a <= 5.8e-35) {
tmp = x + ((y * z) + (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 = x + (a * (t + (z * b)))
if (a <= (-8.8d-12)) then
tmp = t_1
else if (a <= 2.8d-229) then
tmp = x + (z * (y + (a * b)))
else if (a <= 5.8d-35) then
tmp = x + ((y * z) + (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 = x + (a * (t + (z * b)));
double tmp;
if (a <= -8.8e-12) {
tmp = t_1;
} else if (a <= 2.8e-229) {
tmp = x + (z * (y + (a * b)));
} else if (a <= 5.8e-35) {
tmp = x + ((y * z) + (t * a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * (t + (z * b))) tmp = 0 if a <= -8.8e-12: tmp = t_1 elif a <= 2.8e-229: tmp = x + (z * (y + (a * b))) elif a <= 5.8e-35: tmp = x + ((y * z) + (t * a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * Float64(t + Float64(z * b)))) tmp = 0.0 if (a <= -8.8e-12) tmp = t_1; elseif (a <= 2.8e-229) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); elseif (a <= 5.8e-35) tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * (t + (z * b))); tmp = 0.0; if (a <= -8.8e-12) tmp = t_1; elseif (a <= 2.8e-229) tmp = x + (z * (y + (a * b))); elseif (a <= 5.8e-35) tmp = x + ((y * z) + (t * a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.8e-12], t$95$1, If[LessEqual[a, 2.8e-229], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.8e-35], N[(x + N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -8.8 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-229}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-35}:\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.79999999999999966e-12 or 5.8000000000000004e-35 < a Initial program 90.6%
associate-+l+90.6%
+-commutative90.6%
fma-define90.6%
associate-*l*95.2%
*-commutative95.2%
*-commutative95.2%
distribute-rgt-out99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in y around 0 92.1%
if -8.79999999999999966e-12 < a < 2.7999999999999999e-229Initial program 99.9%
associate-+l+99.9%
associate-*l*82.8%
Simplified82.8%
Taylor expanded in t around 0 76.3%
associate-*r*93.4%
distribute-rgt-in93.4%
+-commutative93.4%
Simplified93.4%
if 2.7999999999999999e-229 < a < 5.8000000000000004e-35Initial program 100.0%
associate-+l+100.0%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in b around 0 94.7%
Final simplification92.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.75e+129)
x
(if (<= x 4.4e-253)
(* t a)
(if (<= x 2.7e-126) (* z (* a b)) (if (<= x 3.9e+138) (* t a) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.75e+129) {
tmp = x;
} else if (x <= 4.4e-253) {
tmp = t * a;
} else if (x <= 2.7e-126) {
tmp = z * (a * b);
} else if (x <= 3.9e+138) {
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 (x <= (-1.75d+129)) then
tmp = x
else if (x <= 4.4d-253) then
tmp = t * a
else if (x <= 2.7d-126) then
tmp = z * (a * b)
else if (x <= 3.9d+138) 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 (x <= -1.75e+129) {
tmp = x;
} else if (x <= 4.4e-253) {
tmp = t * a;
} else if (x <= 2.7e-126) {
tmp = z * (a * b);
} else if (x <= 3.9e+138) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.75e+129: tmp = x elif x <= 4.4e-253: tmp = t * a elif x <= 2.7e-126: tmp = z * (a * b) elif x <= 3.9e+138: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.75e+129) tmp = x; elseif (x <= 4.4e-253) tmp = Float64(t * a); elseif (x <= 2.7e-126) tmp = Float64(z * Float64(a * b)); elseif (x <= 3.9e+138) 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 (x <= -1.75e+129) tmp = x; elseif (x <= 4.4e-253) tmp = t * a; elseif (x <= 2.7e-126) tmp = z * (a * b); elseif (x <= 3.9e+138) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.75e+129], x, If[LessEqual[x, 4.4e-253], N[(t * a), $MachinePrecision], If[LessEqual[x, 2.7e-126], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.9e+138], N[(t * a), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+129}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-253}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-126}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+138}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.7499999999999999e129 or 3.8999999999999998e138 < x Initial program 95.3%
associate-+l+95.3%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in b around 0 87.6%
Taylor expanded in x around inf 57.3%
if -1.7499999999999999e129 < x < 4.39999999999999992e-253 or 2.69999999999999995e-126 < x < 3.8999999999999998e138Initial program 94.4%
associate-+l+94.4%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in a around inf 88.1%
Taylor expanded in b around inf 60.9%
*-commutative60.9%
Simplified60.9%
Taylor expanded in t around inf 44.4%
if 4.39999999999999992e-253 < x < 2.69999999999999995e-126Initial program 93.0%
associate-+l+93.0%
associate-*l*82.2%
Simplified82.2%
Taylor expanded in z around inf 81.3%
Taylor expanded in y around 0 55.7%
Final simplification50.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -8.5e-7)
t_1
(if (<= a 8.5e-118)
(+ x (* y z))
(if (<= a 5.4e+174) (+ x (* t a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -8.5e-7) {
tmp = t_1;
} else if (a <= 8.5e-118) {
tmp = x + (y * z);
} else if (a <= 5.4e+174) {
tmp = x + (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 * (t + (z * b))
if (a <= (-8.5d-7)) then
tmp = t_1
else if (a <= 8.5d-118) then
tmp = x + (y * z)
else if (a <= 5.4d+174) then
tmp = x + (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 * (t + (z * b));
double tmp;
if (a <= -8.5e-7) {
tmp = t_1;
} else if (a <= 8.5e-118) {
tmp = x + (y * z);
} else if (a <= 5.4e+174) {
tmp = x + (t * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -8.5e-7: tmp = t_1 elif a <= 8.5e-118: tmp = x + (y * z) elif a <= 5.4e+174: tmp = x + (t * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -8.5e-7) tmp = t_1; elseif (a <= 8.5e-118) tmp = Float64(x + Float64(y * z)); elseif (a <= 5.4e+174) tmp = Float64(x + Float64(t * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -8.5e-7) tmp = t_1; elseif (a <= 8.5e-118) tmp = x + (y * z); elseif (a <= 5.4e+174) tmp = x + (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[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.5e-7], t$95$1, If[LessEqual[a, 8.5e-118], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.4e+174], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -8.5 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{-118}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{+174}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.50000000000000014e-7 or 5.3999999999999998e174 < a Initial program 87.2%
associate-+l+87.2%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in a around inf 98.9%
Taylor expanded in b around inf 82.1%
*-commutative82.1%
Simplified82.1%
if -8.50000000000000014e-7 < a < 8.50000000000000087e-118Initial program 99.9%
associate-+l+99.9%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in b around 0 85.6%
Taylor expanded in a around 0 76.1%
+-commutative76.1%
Simplified76.1%
if 8.50000000000000087e-118 < a < 5.3999999999999998e174Initial program 98.2%
associate-+l+98.2%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in z around 0 64.5%
Final simplification75.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.2e+202)
(* y z)
(if (<= z -1.45e+69)
(* (* z a) b)
(if (<= z 2.05e+136) (+ x (* t a)) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e+202) {
tmp = y * z;
} else if (z <= -1.45e+69) {
tmp = (z * a) * b;
} else if (z <= 2.05e+136) {
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 (z <= (-4.2d+202)) then
tmp = y * z
else if (z <= (-1.45d+69)) then
tmp = (z * a) * b
else if (z <= 2.05d+136) 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 (z <= -4.2e+202) {
tmp = y * z;
} else if (z <= -1.45e+69) {
tmp = (z * a) * b;
} else if (z <= 2.05e+136) {
tmp = x + (t * a);
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.2e+202: tmp = y * z elif z <= -1.45e+69: tmp = (z * a) * b elif z <= 2.05e+136: tmp = x + (t * a) else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.2e+202) tmp = Float64(y * z); elseif (z <= -1.45e+69) tmp = Float64(Float64(z * a) * b); elseif (z <= 2.05e+136) 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 (z <= -4.2e+202) tmp = y * z; elseif (z <= -1.45e+69) tmp = (z * a) * b; elseif (z <= 2.05e+136) tmp = x + (t * a); else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.2e+202], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.45e+69], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[z, 2.05e+136], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(y * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+202}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{+69}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+136}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -4.2e202 or 2.0499999999999999e136 < z Initial program 92.0%
associate-+l+92.0%
associate-*l*80.4%
Simplified80.4%
Taylor expanded in z around inf 84.3%
Taylor expanded in y around inf 67.0%
*-commutative67.0%
Simplified67.0%
if -4.2e202 < z < -1.4499999999999999e69Initial program 92.8%
associate-+l+92.8%
+-commutative92.8%
fma-define92.8%
associate-*l*79.5%
*-commutative79.5%
*-commutative79.5%
distribute-rgt-out86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in y around 0 76.3%
Taylor expanded in z around inf 43.2%
associate-*r*56.5%
*-commutative56.5%
associate-*r*66.8%
*-commutative66.8%
Simplified66.8%
if -1.4499999999999999e69 < z < 2.0499999999999999e136Initial program 95.6%
associate-+l+95.6%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in z around 0 74.6%
Final simplification72.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.75e+129) x (if (<= x 4.5e-251) (* t a) (if (<= x 3.2e+153) (* (* z a) b) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.75e+129) {
tmp = x;
} else if (x <= 4.5e-251) {
tmp = t * a;
} else if (x <= 3.2e+153) {
tmp = (z * a) * b;
} 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 <= (-1.75d+129)) then
tmp = x
else if (x <= 4.5d-251) then
tmp = t * a
else if (x <= 3.2d+153) then
tmp = (z * a) * b
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 <= -1.75e+129) {
tmp = x;
} else if (x <= 4.5e-251) {
tmp = t * a;
} else if (x <= 3.2e+153) {
tmp = (z * a) * b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.75e+129: tmp = x elif x <= 4.5e-251: tmp = t * a elif x <= 3.2e+153: tmp = (z * a) * b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.75e+129) tmp = x; elseif (x <= 4.5e-251) tmp = Float64(t * a); elseif (x <= 3.2e+153) tmp = Float64(Float64(z * a) * b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.75e+129) tmp = x; elseif (x <= 4.5e-251) tmp = t * a; elseif (x <= 3.2e+153) tmp = (z * a) * b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.75e+129], x, If[LessEqual[x, 4.5e-251], N[(t * a), $MachinePrecision], If[LessEqual[x, 3.2e+153], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+129}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-251}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+153}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.7499999999999999e129 or 3.2000000000000001e153 < x Initial program 95.1%
associate-+l+95.1%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in b around 0 89.0%
Taylor expanded in x around inf 58.4%
if -1.7499999999999999e129 < x < 4.49999999999999978e-251Initial program 94.5%
associate-+l+94.5%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in a around inf 89.2%
Taylor expanded in b around inf 62.4%
*-commutative62.4%
Simplified62.4%
Taylor expanded in t around inf 43.4%
if 4.49999999999999978e-251 < x < 3.2000000000000001e153Initial program 93.9%
associate-+l+93.9%
+-commutative93.9%
fma-define93.9%
associate-*l*83.5%
*-commutative83.5%
*-commutative83.5%
distribute-rgt-out85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in y around 0 69.9%
Taylor expanded in z around inf 31.8%
associate-*r*40.5%
*-commutative40.5%
associate-*r*42.5%
*-commutative42.5%
Simplified42.5%
Final simplification49.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.5e-11) (not (<= a 1.1e-118))) (+ x (* 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 ((a <= -2.5e-11) || !(a <= 1.1e-118)) {
tmp = x + (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 ((a <= (-2.5d-11)) .or. (.not. (a <= 1.1d-118))) then
tmp = x + (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 ((a <= -2.5e-11) || !(a <= 1.1e-118)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.5e-11) or not (a <= 1.1e-118): tmp = x + (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 ((a <= -2.5e-11) || !(a <= 1.1e-118)) tmp = Float64(x + 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 ((a <= -2.5e-11) || ~((a <= 1.1e-118))) tmp = x + (a * (t + (z * b))); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.5e-11], N[Not[LessEqual[a, 1.1e-118]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $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}\;a \leq -2.5 \cdot 10^{-11} \lor \neg \left(a \leq 1.1 \cdot 10^{-118}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if a < -2.50000000000000009e-11 or 1.09999999999999992e-118 < a Initial program 91.3%
associate-+l+91.3%
+-commutative91.3%
fma-define91.3%
associate-*l*94.9%
*-commutative94.9%
*-commutative94.9%
distribute-rgt-out98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in y around 0 90.9%
if -2.50000000000000009e-11 < a < 1.09999999999999992e-118Initial program 99.9%
associate-+l+99.9%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in t around 0 78.5%
associate-*r*91.2%
distribute-rgt-in91.2%
+-commutative91.2%
Simplified91.2%
Final simplification91.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.25e-12) (not (<= a 1.95e-149))) (+ 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 <= -2.25e-12) || !(a <= 1.95e-149)) {
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 <= (-2.25d-12)) .or. (.not. (a <= 1.95d-149))) 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 <= -2.25e-12) || !(a <= 1.95e-149)) {
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 <= -2.25e-12) or not (a <= 1.95e-149): 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 <= -2.25e-12) || !(a <= 1.95e-149)) 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 <= -2.25e-12) || ~((a <= 1.95e-149))) 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, -2.25e-12], N[Not[LessEqual[a, 1.95e-149]], $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 -2.25 \cdot 10^{-12} \lor \neg \left(a \leq 1.95 \cdot 10^{-149}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -2.2499999999999999e-12 or 1.9500000000000001e-149 < a Initial program 91.8%
associate-+l+91.8%
+-commutative91.8%
fma-define91.8%
associate-*l*95.2%
*-commutative95.2%
*-commutative95.2%
distribute-rgt-out98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in y around 0 90.3%
if -2.2499999999999999e-12 < a < 1.9500000000000001e-149Initial program 99.9%
associate-+l+99.9%
associate-*l*85.9%
Simplified85.9%
Taylor expanded in b around 0 85.0%
Taylor expanded in a around 0 77.4%
+-commutative77.4%
Simplified77.4%
Final simplification85.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -215000000000.0) (not (<= z 1.3e+55))) (* 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 <= -215000000000.0) || !(z <= 1.3e+55)) {
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 <= (-215000000000.0d0)) .or. (.not. (z <= 1.3d+55))) 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 <= -215000000000.0) || !(z <= 1.3e+55)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -215000000000.0) or not (z <= 1.3e+55): 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 <= -215000000000.0) || !(z <= 1.3e+55)) 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 <= -215000000000.0) || ~((z <= 1.3e+55))) 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, -215000000000.0], N[Not[LessEqual[z, 1.3e+55]], $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 -215000000000 \lor \neg \left(z \leq 1.3 \cdot 10^{+55}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -2.15e11 or 1.3e55 < z Initial program 89.9%
associate-+l+89.9%
associate-*l*82.6%
Simplified82.6%
Taylor expanded in z around inf 74.2%
if -2.15e11 < z < 1.3e55Initial program 97.9%
associate-+l+97.9%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in z around 0 80.1%
Final simplification77.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.3e+127) (not (<= y 4.8e+67))) (+ x (* y z)) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.3e+127) || !(y <= 4.8e+67)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.3d+127)) .or. (.not. (y <= 4.8d+67))) then
tmp = x + (y * z)
else
tmp = x + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.3e+127) || !(y <= 4.8e+67)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.3e+127) or not (y <= 4.8e+67): tmp = x + (y * z) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.3e+127) || !(y <= 4.8e+67)) tmp = Float64(x + Float64(y * z)); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.3e+127) || ~((y <= 4.8e+67))) tmp = x + (y * z); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.3e+127], N[Not[LessEqual[y, 4.8e+67]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+127} \lor \neg \left(y \leq 4.8 \cdot 10^{+67}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if y < -2.3000000000000002e127 or 4.80000000000000004e67 < y Initial program 97.5%
associate-+l+97.5%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in b around 0 90.9%
Taylor expanded in a around 0 81.0%
+-commutative81.0%
Simplified81.0%
if -2.3000000000000002e127 < y < 4.80000000000000004e67Initial program 93.3%
associate-+l+93.3%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in z around 0 69.1%
Final simplification72.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.8e+129) x (if (<= x 1.08e+139) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.8e+129) {
tmp = x;
} else if (x <= 1.08e+139) {
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 (x <= (-1.8d+129)) then
tmp = x
else if (x <= 1.08d+139) 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 (x <= -1.8e+129) {
tmp = x;
} else if (x <= 1.08e+139) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.8e+129: tmp = x elif x <= 1.08e+139: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.8e+129) tmp = x; elseif (x <= 1.08e+139) 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 (x <= -1.8e+129) tmp = x; elseif (x <= 1.08e+139) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.8e+129], x, If[LessEqual[x, 1.08e+139], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+129}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{+139}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.8000000000000001e129 or 1.08000000000000004e139 < x Initial program 95.3%
associate-+l+95.3%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in b around 0 87.6%
Taylor expanded in x around inf 57.3%
if -1.8000000000000001e129 < x < 1.08000000000000004e139Initial program 94.1%
associate-+l+94.1%
associate-*l*89.0%
Simplified89.0%
Taylor expanded in a around inf 86.4%
Taylor expanded in b around inf 61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in t around inf 40.1%
Final simplification47.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.6%
associate-+l+94.6%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in b around 0 81.5%
Taylor expanded in x around inf 30.0%
(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 2024148
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))