
(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 (or (<= z -2.2e+82) (not (<= z 8.8e-70))) (* z (+ y (+ (* a (+ b (/ t z))) (/ x z)))) (+ (+ x (* y z)) (+ (* a (* z b)) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.2e+82) || !(z <= 8.8e-70)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = (x + (y * z)) + ((a * (z * b)) + (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 <= (-2.2d+82)) .or. (.not. (z <= 8.8d-70))) then
tmp = z * (y + ((a * (b + (t / z))) + (x / z)))
else
tmp = (x + (y * z)) + ((a * (z * b)) + (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 <= -2.2e+82) || !(z <= 8.8e-70)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.2e+82) or not (z <= 8.8e-70): tmp = z * (y + ((a * (b + (t / z))) + (x / z))) else: tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.2e+82) || !(z <= 8.8e-70)) tmp = Float64(z * Float64(y + Float64(Float64(a * Float64(b + Float64(t / z))) + Float64(x / z)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(a * Float64(z * b)) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.2e+82) || ~((z <= 8.8e-70))) tmp = z * (y + ((a * (b + (t / z))) + (x / z))); else tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.2e+82], N[Not[LessEqual[z, 8.8e-70]], $MachinePrecision]], N[(z * N[(y + N[(N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+82} \lor \neg \left(z \leq 8.8 \cdot 10^{-70}\right):\\
\;\;\;\;z \cdot \left(y + \left(a \cdot \left(b + \frac{t}{z}\right) + \frac{x}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(a \cdot \left(z \cdot b\right) + t \cdot a\right)\\
\end{array}
\end{array}
if z < -2.2000000000000001e82 or 8.7999999999999996e-70 < z Initial program 86.9%
associate-+l+86.9%
associate-*l*82.1%
Simplified82.1%
Taylor expanded in z around inf 95.9%
+-commutative95.9%
associate-+r+95.9%
associate-/l*97.5%
distribute-lft-out99.2%
Simplified99.2%
if -2.2000000000000001e82 < z < 8.7999999999999996e-70Initial program 98.5%
associate-+l+98.5%
associate-*l*99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (* (* z a) b) (+ (+ x (* y z)) (* t a))))) (if (<= t_1 2e+307) t_1 (* z (+ y (* a (+ b (/ t z))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * a) * b) + ((x + (y * z)) + (t * a));
double tmp;
if (t_1 <= 2e+307) {
tmp = t_1;
} else {
tmp = z * (y + (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 = ((z * a) * b) + ((x + (y * z)) + (t * a))
if (t_1 <= 2d+307) then
tmp = t_1
else
tmp = z * (y + (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 = ((z * a) * b) + ((x + (y * z)) + (t * a));
double tmp;
if (t_1 <= 2e+307) {
tmp = t_1;
} else {
tmp = z * (y + (a * (b + (t / z))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((z * a) * b) + ((x + (y * z)) + (t * a)) tmp = 0 if t_1 <= 2e+307: tmp = t_1 else: tmp = z * (y + (a * (b + (t / z)))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * a) * b) + Float64(Float64(x + Float64(y * z)) + Float64(t * a))) tmp = 0.0 if (t_1 <= 2e+307) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * Float64(b + Float64(t / z))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((z * a) * b) + ((x + (y * z)) + (t * a)); tmp = 0.0; if (t_1 <= 2e+307) tmp = t_1; else tmp = z * (y + (a * (b + (t / z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+307], t$95$1, N[(z * N[(y + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot \left(b + \frac{t}{z}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 1.99999999999999997e307Initial program 98.1%
if 1.99999999999999997e307 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 66.0%
associate-+l+66.0%
associate-*l*68.3%
Simplified68.3%
Taylor expanded in z around inf 75.6%
associate-/l*78.0%
distribute-lft-out85.4%
Simplified85.4%
Taylor expanded in x around 0 80.5%
+-commutative80.5%
*-commutative80.5%
associate-*r*85.4%
distribute-rgt-in100.0%
Simplified100.0%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a (+ t (* z b))))))
(if (<= x -3.2e+198)
t_1
(if (<= x -11000000.0)
(+ x (* z (+ y (* a b))))
(if (<= x 3e+14) (+ (* (* z a) b) (+ (* 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 (x <= -3.2e+198) {
tmp = t_1;
} else if (x <= -11000000.0) {
tmp = x + (z * (y + (a * b)));
} else if (x <= 3e+14) {
tmp = ((z * a) * b) + ((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 (x <= (-3.2d+198)) then
tmp = t_1
else if (x <= (-11000000.0d0)) then
tmp = x + (z * (y + (a * b)))
else if (x <= 3d+14) then
tmp = ((z * a) * b) + ((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 (x <= -3.2e+198) {
tmp = t_1;
} else if (x <= -11000000.0) {
tmp = x + (z * (y + (a * b)));
} else if (x <= 3e+14) {
tmp = ((z * a) * b) + ((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 x <= -3.2e+198: tmp = t_1 elif x <= -11000000.0: tmp = x + (z * (y + (a * b))) elif x <= 3e+14: tmp = ((z * a) * b) + ((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 (x <= -3.2e+198) tmp = t_1; elseif (x <= -11000000.0) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); elseif (x <= 3e+14) tmp = Float64(Float64(Float64(z * a) * b) + 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 (x <= -3.2e+198) tmp = t_1; elseif (x <= -11000000.0) tmp = x + (z * (y + (a * b))); elseif (x <= 3e+14) tmp = ((z * a) * b) + ((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[x, -3.2e+198], t$95$1, If[LessEqual[x, -11000000.0], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3e+14], N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + 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}\;x \leq -3.2 \cdot 10^{+198}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -11000000:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+14}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b + \left(y \cdot z + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.1999999999999998e198 or 3e14 < x Initial program 88.7%
associate-+l+88.7%
+-commutative88.7%
fma-define88.7%
associate-*l*93.7%
*-commutative93.7%
*-commutative93.7%
distribute-rgt-out96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in y around 0 94.7%
if -3.1999999999999998e198 < x < -1.1e7Initial program 93.9%
associate-+l+93.9%
associate-*l*87.8%
Simplified87.8%
Taylor expanded in t around 0 81.7%
+-commutative81.7%
associate-*r*89.9%
distribute-rgt-in94.0%
Simplified94.0%
if -1.1e7 < x < 3e14Initial program 95.3%
Taylor expanded in x around 0 89.8%
Final simplification92.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (* z (+ y (* a b)))))
(if (<= z -4.8e-37)
t_2
(if (<= z 1.25e-117)
t_1
(if (<= z 12500000.0) (+ x (* y z)) (if (<= z 1.14e+61) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -4.8e-37) {
tmp = t_2;
} else if (z <= 1.25e-117) {
tmp = t_1;
} else if (z <= 12500000.0) {
tmp = x + (y * z);
} else if (z <= 1.14e+61) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (t * a)
t_2 = z * (y + (a * b))
if (z <= (-4.8d-37)) then
tmp = t_2
else if (z <= 1.25d-117) then
tmp = t_1
else if (z <= 12500000.0d0) then
tmp = x + (y * z)
else if (z <= 1.14d+61) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -4.8e-37) {
tmp = t_2;
} else if (z <= 1.25e-117) {
tmp = t_1;
} else if (z <= 12500000.0) {
tmp = x + (y * z);
} else if (z <= 1.14e+61) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = z * (y + (a * b)) tmp = 0 if z <= -4.8e-37: tmp = t_2 elif z <= 1.25e-117: tmp = t_1 elif z <= 12500000.0: tmp = x + (y * z) elif z <= 1.14e+61: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -4.8e-37) tmp = t_2; elseif (z <= 1.25e-117) tmp = t_1; elseif (z <= 12500000.0) tmp = Float64(x + Float64(y * z)); elseif (z <= 1.14e+61) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = z * (y + (a * b)); tmp = 0.0; if (z <= -4.8e-37) tmp = t_2; elseif (z <= 1.25e-117) tmp = t_1; elseif (z <= 12500000.0) tmp = x + (y * z); elseif (z <= 1.14e+61) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-37], t$95$2, If[LessEqual[z, 1.25e-117], t$95$1, If[LessEqual[z, 12500000.0], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.14e+61], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-37}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 12500000:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;z \leq 1.14 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.79999999999999982e-37 or 1.13999999999999996e61 < z Initial program 85.1%
associate-+l+85.1%
associate-*l*81.7%
Simplified81.7%
Taylor expanded in z around inf 82.6%
+-commutative82.6%
Simplified82.6%
if -4.79999999999999982e-37 < z < 1.25e-117 or 1.25e7 < z < 1.13999999999999996e61Initial program 99.9%
associate-+l+99.9%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in z around 0 77.9%
+-commutative77.9%
Simplified77.9%
if 1.25e-117 < z < 1.25e7Initial program 96.8%
associate-+l+96.8%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in a around 0 70.8%
Final simplification79.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z (+ y (* a b))))))
(if (<= z -7.6e-30)
t_1
(if (<= z 1720000000.0)
(+ (+ x (* y z)) (* t a))
(if (<= z 5.9e+121) (+ x (* (* z a) (+ b (/ t z)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * (y + (a * b)));
double tmp;
if (z <= -7.6e-30) {
tmp = t_1;
} else if (z <= 1720000000.0) {
tmp = (x + (y * z)) + (t * a);
} else if (z <= 5.9e+121) {
tmp = x + ((z * a) * (b + (t / z)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (z * (y + (a * b)))
if (z <= (-7.6d-30)) then
tmp = t_1
else if (z <= 1720000000.0d0) then
tmp = (x + (y * z)) + (t * a)
else if (z <= 5.9d+121) then
tmp = x + ((z * a) * (b + (t / z)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * (y + (a * b)));
double tmp;
if (z <= -7.6e-30) {
tmp = t_1;
} else if (z <= 1720000000.0) {
tmp = (x + (y * z)) + (t * a);
} else if (z <= 5.9e+121) {
tmp = x + ((z * a) * (b + (t / z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * (y + (a * b))) tmp = 0 if z <= -7.6e-30: tmp = t_1 elif z <= 1720000000.0: tmp = (x + (y * z)) + (t * a) elif z <= 5.9e+121: tmp = x + ((z * a) * (b + (t / z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * Float64(y + Float64(a * b)))) tmp = 0.0 if (z <= -7.6e-30) tmp = t_1; elseif (z <= 1720000000.0) tmp = Float64(Float64(x + Float64(y * z)) + Float64(t * a)); elseif (z <= 5.9e+121) tmp = Float64(x + Float64(Float64(z * a) * Float64(b + Float64(t / z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * (y + (a * b))); tmp = 0.0; if (z <= -7.6e-30) tmp = t_1; elseif (z <= 1720000000.0) tmp = (x + (y * z)) + (t * a); elseif (z <= 5.9e+121) tmp = x + ((z * a) * (b + (t / z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.6e-30], t$95$1, If[LessEqual[z, 1720000000.0], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.9e+121], N[(x + N[(N[(z * a), $MachinePrecision] * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -7.6 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1720000000:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{+121}:\\
\;\;\;\;x + \left(z \cdot a\right) \cdot \left(b + \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.6000000000000006e-30 or 5.90000000000000014e121 < z Initial program 84.2%
associate-+l+84.2%
associate-*l*81.3%
Simplified81.3%
Taylor expanded in t around 0 79.3%
+-commutative79.3%
associate-*r*89.0%
distribute-rgt-in95.0%
Simplified95.0%
if -7.6000000000000006e-30 < z < 1.72e9Initial program 99.1%
associate-+l+99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in t around inf 88.4%
if 1.72e9 < z < 5.90000000000000014e121Initial program 96.7%
associate-+l+96.7%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in z around inf 99.8%
associate-/l*99.8%
distribute-lft-out99.8%
Simplified99.8%
Taylor expanded in y around 0 87.8%
associate-*r*93.5%
Simplified93.5%
Final simplification91.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.5e-91) (not (<= z 1e-69))) (* z (+ y (+ (* a (+ b (/ t z))) (/ x z)))) (+ (+ x (* y z)) (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.5e-91) || !(z <= 1e-69)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / 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 <= (-4.5d-91)) .or. (.not. (z <= 1d-69))) then
tmp = z * (y + ((a * (b + (t / z))) + (x / 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 <= -4.5e-91) || !(z <= 1e-69)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = (x + (y * z)) + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.5e-91) or not (z <= 1e-69): tmp = z * (y + ((a * (b + (t / z))) + (x / z))) else: tmp = (x + (y * z)) + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.5e-91) || !(z <= 1e-69)) tmp = Float64(z * Float64(y + Float64(Float64(a * Float64(b + Float64(t / z))) + Float64(x / z)))); else tmp = Float64(Float64(x + 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 <= -4.5e-91) || ~((z <= 1e-69))) tmp = z * (y + ((a * (b + (t / z))) + (x / z))); else tmp = (x + (y * z)) + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.5e-91], N[Not[LessEqual[z, 1e-69]], $MachinePrecision]], N[(z * N[(y + N[(N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-91} \lor \neg \left(z \leq 10^{-69}\right):\\
\;\;\;\;z \cdot \left(y + \left(a \cdot \left(b + \frac{t}{z}\right) + \frac{x}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\end{array}
\end{array}
if z < -4.49999999999999976e-91 or 9.9999999999999996e-70 < z Initial program 89.0%
associate-+l+89.0%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in z around inf 95.2%
+-commutative95.2%
associate-+r+95.2%
associate-/l*96.4%
distribute-lft-out97.7%
Simplified97.7%
if -4.49999999999999976e-91 < z < 9.9999999999999996e-70Initial program 100.0%
associate-+l+100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around inf 90.8%
Final simplification95.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -9.5e+99)
x
(if (<= x -55000000.0)
(* y z)
(if (<= x -5.5e-139) (* t a) (if (<= x 2.1e+25) (* y z) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.5e+99) {
tmp = x;
} else if (x <= -55000000.0) {
tmp = y * z;
} else if (x <= -5.5e-139) {
tmp = t * a;
} else if (x <= 2.1e+25) {
tmp = y * z;
} 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 <= (-9.5d+99)) then
tmp = x
else if (x <= (-55000000.0d0)) then
tmp = y * z
else if (x <= (-5.5d-139)) then
tmp = t * a
else if (x <= 2.1d+25) then
tmp = y * z
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 <= -9.5e+99) {
tmp = x;
} else if (x <= -55000000.0) {
tmp = y * z;
} else if (x <= -5.5e-139) {
tmp = t * a;
} else if (x <= 2.1e+25) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -9.5e+99: tmp = x elif x <= -55000000.0: tmp = y * z elif x <= -5.5e-139: tmp = t * a elif x <= 2.1e+25: tmp = y * z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -9.5e+99) tmp = x; elseif (x <= -55000000.0) tmp = Float64(y * z); elseif (x <= -5.5e-139) tmp = Float64(t * a); elseif (x <= 2.1e+25) tmp = Float64(y * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -9.5e+99) tmp = x; elseif (x <= -55000000.0) tmp = y * z; elseif (x <= -5.5e-139) tmp = t * a; elseif (x <= 2.1e+25) tmp = y * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.5e+99], x, If[LessEqual[x, -55000000.0], N[(y * z), $MachinePrecision], If[LessEqual[x, -5.5e-139], N[(t * a), $MachinePrecision], If[LessEqual[x, 2.1e+25], N[(y * z), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+99}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -55000000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-139}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+25}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.49999999999999908e99 or 2.0999999999999999e25 < x Initial program 91.1%
associate-+l+91.1%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 57.7%
if -9.49999999999999908e99 < x < -5.5e7 or -5.4999999999999997e-139 < x < 2.0999999999999999e25Initial program 94.5%
associate-+l+94.5%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in y around inf 45.8%
*-commutative45.8%
Simplified45.8%
if -5.5e7 < x < -5.4999999999999997e-139Initial program 93.2%
associate-+l+93.2%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in z around 0 47.8%
+-commutative47.8%
Simplified47.8%
Taylor expanded in a around inf 47.7%
Taylor expanded in t around inf 39.6%
Final simplification49.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.1e-41) (not (<= z 2.9e+121))) (+ x (* z (+ y (* a b)))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.1e-41) || !(z <= 2.9e+121)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.1d-41)) .or. (.not. (z <= 2.9d+121))) then
tmp = x + (z * (y + (a * b)))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.1e-41) || !(z <= 2.9e+121)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.1e-41) or not (z <= 2.9e+121): tmp = x + (z * (y + (a * b))) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.1e-41) || !(z <= 2.9e+121)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.1e-41) || ~((z <= 2.9e+121))) tmp = x + (z * (y + (a * b))); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.1e-41], N[Not[LessEqual[z, 2.9e+121]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-41} \lor \neg \left(z \leq 2.9 \cdot 10^{+121}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -1.1e-41 or 2.8999999999999999e121 < z Initial program 84.5%
associate-+l+84.5%
associate-*l*81.6%
Simplified81.6%
Taylor expanded in t around 0 78.8%
+-commutative78.8%
associate-*r*89.2%
distribute-rgt-in95.1%
Simplified95.1%
if -1.1e-41 < z < 2.8999999999999999e121Initial program 98.6%
associate-+l+98.6%
+-commutative98.6%
fma-define98.6%
associate-*l*97.4%
*-commutative97.4%
*-commutative97.4%
distribute-rgt-out98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in y around 0 86.5%
Final simplification89.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.9e+42) (not (<= z 2.1e+146))) (* 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 <= -1.9e+42) || !(z <= 2.1e+146)) {
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 <= (-1.9d+42)) .or. (.not. (z <= 2.1d+146))) 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 <= -1.9e+42) || !(z <= 2.1e+146)) {
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 <= -1.9e+42) or not (z <= 2.1e+146): 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 <= -1.9e+42) || !(z <= 2.1e+146)) 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 <= -1.9e+42) || ~((z <= 2.1e+146))) 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, -1.9e+42], N[Not[LessEqual[z, 2.1e+146]], $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 -1.9 \cdot 10^{+42} \lor \neg \left(z \leq 2.1 \cdot 10^{+146}\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 < -1.8999999999999999e42 or 2.1000000000000001e146 < z Initial program 81.6%
associate-+l+81.6%
associate-*l*77.7%
Simplified77.7%
Taylor expanded in z around inf 92.1%
+-commutative92.1%
Simplified92.1%
if -1.8999999999999999e42 < z < 2.1000000000000001e146Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
fma-define97.7%
associate-*l*96.7%
*-commutative96.7%
*-commutative96.7%
distribute-rgt-out98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in y around 0 84.7%
Final simplification86.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.22e+23) (not (<= y 2.8e-94))) (+ x (* y z)) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.22e+23) || !(y <= 2.8e-94)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.22d+23)) .or. (.not. (y <= 2.8d-94))) then
tmp = x + (y * z)
else
tmp = x + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.22e+23) || !(y <= 2.8e-94)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.22e+23) or not (y <= 2.8e-94): tmp = x + (y * z) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.22e+23) || !(y <= 2.8e-94)) tmp = Float64(x + Float64(y * z)); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.22e+23) || ~((y <= 2.8e-94))) tmp = x + (y * z); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.22e+23], N[Not[LessEqual[y, 2.8e-94]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+23} \lor \neg \left(y \leq 2.8 \cdot 10^{-94}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if y < -1.22e23 or 2.7999999999999998e-94 < y Initial program 92.8%
associate-+l+92.8%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in a around 0 71.8%
if -1.22e23 < y < 2.7999999999999998e-94Initial program 93.2%
associate-+l+93.2%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in z around 0 64.5%
+-commutative64.5%
Simplified64.5%
Final simplification68.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.2e+149) (not (<= t 2.9e+150))) (* t a) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.2e+149) || !(t <= 2.9e+150)) {
tmp = t * a;
} 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 ((t <= (-3.2d+149)) .or. (.not. (t <= 2.9d+150))) then
tmp = t * a
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 ((t <= -3.2e+149) || !(t <= 2.9e+150)) {
tmp = t * a;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.2e+149) or not (t <= 2.9e+150): tmp = t * a else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.2e+149) || !(t <= 2.9e+150)) tmp = Float64(t * a); 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 ((t <= -3.2e+149) || ~((t <= 2.9e+150))) tmp = t * a; else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.2e+149], N[Not[LessEqual[t, 2.9e+150]], $MachinePrecision]], N[(t * a), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+149} \lor \neg \left(t \leq 2.9 \cdot 10^{+150}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if t < -3.2000000000000002e149 or 2.90000000000000011e150 < t Initial program 93.3%
associate-+l+93.3%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in z around 0 65.7%
+-commutative65.7%
Simplified65.7%
Taylor expanded in a around inf 58.2%
Taylor expanded in t around inf 55.4%
if -3.2000000000000002e149 < t < 2.90000000000000011e150Initial program 92.9%
associate-+l+92.9%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in a around 0 63.6%
Final simplification61.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -28000000000.0) x (if (<= x 4.6e+18) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -28000000000.0) {
tmp = x;
} else if (x <= 4.6e+18) {
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 <= (-28000000000.0d0)) then
tmp = x
else if (x <= 4.6d+18) 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 <= -28000000000.0) {
tmp = x;
} else if (x <= 4.6e+18) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -28000000000.0: tmp = x elif x <= 4.6e+18: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -28000000000.0) tmp = x; elseif (x <= 4.6e+18) 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 <= -28000000000.0) tmp = x; elseif (x <= 4.6e+18) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -28000000000.0], x, If[LessEqual[x, 4.6e+18], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -28000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+18}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.8e10 or 4.6e18 < x Initial program 91.3%
associate-+l+91.3%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in x around inf 50.5%
if -2.8e10 < x < 4.6e18Initial program 94.6%
associate-+l+94.6%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in z around 0 37.7%
+-commutative37.7%
Simplified37.7%
Taylor expanded in a around inf 37.7%
Taylor expanded in t around inf 32.6%
Final simplification41.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%
associate-+l+93.0%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in x around inf 28.5%
(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 2024106
(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)))