
(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 -9.2e+66) (not (<= z 6.5e-21))) (* z (+ y (+ (* a (+ b (/ t z))) (/ x z)))) (+ (fma y z x) (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.2e+66) || !(z <= 6.5e-21)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = fma(y, z, x) + (a * (t + (z * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9.2e+66) || !(z <= 6.5e-21)) tmp = Float64(z * Float64(y + Float64(Float64(a * Float64(b + Float64(t / z))) + Float64(x / z)))); else tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.2e+66], N[Not[LessEqual[z, 6.5e-21]], $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[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+66} \lor \neg \left(z \leq 6.5 \cdot 10^{-21}\right):\\
\;\;\;\;z \cdot \left(y + \left(a \cdot \left(b + \frac{t}{z}\right) + \frac{x}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -9.2e66 or 6.49999999999999987e-21 < z Initial program 83.3%
associate-+l+83.3%
associate-*l*84.2%
Simplified84.2%
Taylor expanded in z around inf 96.7%
+-commutative96.7%
associate-+r+96.7%
associate-/l*99.1%
distribute-lft-out99.9%
Simplified99.9%
if -9.2e66 < z < 6.49999999999999987e-21Initial program 99.2%
associate-+l+99.2%
+-commutative99.2%
fma-define99.2%
associate-*l*99.2%
*-commutative99.2%
*-commutative99.2%
distribute-rgt-out100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -4e+240)
(* a t)
(if (<= a -4.7e+139)
(* z (* a b))
(if (<= a -5.3e-90)
(* z y)
(if (<= a 7500000.0) x (if (<= a 9.8e+58) (* z y) (* a t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4e+240) {
tmp = a * t;
} else if (a <= -4.7e+139) {
tmp = z * (a * b);
} else if (a <= -5.3e-90) {
tmp = z * y;
} else if (a <= 7500000.0) {
tmp = x;
} else if (a <= 9.8e+58) {
tmp = z * y;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-4d+240)) then
tmp = a * t
else if (a <= (-4.7d+139)) then
tmp = z * (a * b)
else if (a <= (-5.3d-90)) then
tmp = z * y
else if (a <= 7500000.0d0) then
tmp = x
else if (a <= 9.8d+58) then
tmp = z * y
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4e+240) {
tmp = a * t;
} else if (a <= -4.7e+139) {
tmp = z * (a * b);
} else if (a <= -5.3e-90) {
tmp = z * y;
} else if (a <= 7500000.0) {
tmp = x;
} else if (a <= 9.8e+58) {
tmp = z * y;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4e+240: tmp = a * t elif a <= -4.7e+139: tmp = z * (a * b) elif a <= -5.3e-90: tmp = z * y elif a <= 7500000.0: tmp = x elif a <= 9.8e+58: tmp = z * y else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4e+240) tmp = Float64(a * t); elseif (a <= -4.7e+139) tmp = Float64(z * Float64(a * b)); elseif (a <= -5.3e-90) tmp = Float64(z * y); elseif (a <= 7500000.0) tmp = x; elseif (a <= 9.8e+58) tmp = Float64(z * y); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4e+240) tmp = a * t; elseif (a <= -4.7e+139) tmp = z * (a * b); elseif (a <= -5.3e-90) tmp = z * y; elseif (a <= 7500000.0) tmp = x; elseif (a <= 9.8e+58) tmp = z * y; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4e+240], N[(a * t), $MachinePrecision], If[LessEqual[a, -4.7e+139], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5.3e-90], N[(z * y), $MachinePrecision], If[LessEqual[a, 7500000.0], x, If[LessEqual[a, 9.8e+58], N[(z * y), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{+240}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -4.7 \cdot 10^{+139}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq -5.3 \cdot 10^{-90}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 7500000:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9.8 \cdot 10^{+58}:\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -4.00000000000000006e240 or 9.80000000000000037e58 < a Initial program 81.9%
associate-+l+81.9%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in z around inf 65.6%
+-commutative65.6%
associate-+r+65.6%
associate-/l*70.1%
distribute-lft-out75.0%
Simplified75.0%
Taylor expanded in t around inf 59.4%
if -4.00000000000000006e240 < a < -4.7000000000000001e139Initial program 83.5%
associate-+l+83.5%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in z around inf 83.4%
+-commutative83.4%
associate-+r+83.4%
associate-/l*83.3%
distribute-lft-out87.5%
Simplified87.5%
Taylor expanded in b around inf 57.8%
associate-*r*58.0%
*-commutative58.0%
Simplified58.0%
if -4.7000000000000001e139 < a < -5.3000000000000004e-90 or 7.5e6 < a < 9.80000000000000037e58Initial program 91.3%
associate-+l+91.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in y around inf 40.3%
*-commutative40.3%
Simplified40.3%
if -5.3000000000000004e-90 < a < 7.5e6Initial program 99.1%
associate-+l+99.1%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in x around inf 50.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.26e+237)
(* a t)
(if (<= a -4.1e+139)
(* a (* z b))
(if (<= a -2.9e-88)
(* z y)
(if (<= a 27.0) x (if (<= a 1.65e+59) (* z y) (* a t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.26e+237) {
tmp = a * t;
} else if (a <= -4.1e+139) {
tmp = a * (z * b);
} else if (a <= -2.9e-88) {
tmp = z * y;
} else if (a <= 27.0) {
tmp = x;
} else if (a <= 1.65e+59) {
tmp = z * y;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.26d+237)) then
tmp = a * t
else if (a <= (-4.1d+139)) then
tmp = a * (z * b)
else if (a <= (-2.9d-88)) then
tmp = z * y
else if (a <= 27.0d0) then
tmp = x
else if (a <= 1.65d+59) then
tmp = z * y
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.26e+237) {
tmp = a * t;
} else if (a <= -4.1e+139) {
tmp = a * (z * b);
} else if (a <= -2.9e-88) {
tmp = z * y;
} else if (a <= 27.0) {
tmp = x;
} else if (a <= 1.65e+59) {
tmp = z * y;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.26e+237: tmp = a * t elif a <= -4.1e+139: tmp = a * (z * b) elif a <= -2.9e-88: tmp = z * y elif a <= 27.0: tmp = x elif a <= 1.65e+59: tmp = z * y else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.26e+237) tmp = Float64(a * t); elseif (a <= -4.1e+139) tmp = Float64(a * Float64(z * b)); elseif (a <= -2.9e-88) tmp = Float64(z * y); elseif (a <= 27.0) tmp = x; elseif (a <= 1.65e+59) tmp = Float64(z * y); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.26e+237) tmp = a * t; elseif (a <= -4.1e+139) tmp = a * (z * b); elseif (a <= -2.9e-88) tmp = z * y; elseif (a <= 27.0) tmp = x; elseif (a <= 1.65e+59) tmp = z * y; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.26e+237], N[(a * t), $MachinePrecision], If[LessEqual[a, -4.1e+139], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.9e-88], N[(z * y), $MachinePrecision], If[LessEqual[a, 27.0], x, If[LessEqual[a, 1.65e+59], N[(z * y), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.26 \cdot 10^{+237}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -4.1 \cdot 10^{+139}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -2.9 \cdot 10^{-88}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 27:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{+59}:\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -1.2599999999999999e237 or 1.65e59 < a Initial program 81.9%
associate-+l+81.9%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in z around inf 65.6%
+-commutative65.6%
associate-+r+65.6%
associate-/l*70.1%
distribute-lft-out75.0%
Simplified75.0%
Taylor expanded in t around inf 59.4%
if -1.2599999999999999e237 < a < -4.1000000000000002e139Initial program 83.5%
associate-+l+83.5%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in z around inf 83.4%
+-commutative83.4%
associate-+r+83.4%
associate-/l*83.3%
distribute-lft-out87.5%
Simplified87.5%
Taylor expanded in b around inf 57.8%
if -4.1000000000000002e139 < a < -2.9000000000000001e-88 or 27 < a < 1.65e59Initial program 91.3%
associate-+l+91.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in y around inf 40.3%
*-commutative40.3%
Simplified40.3%
if -2.9000000000000001e-88 < a < 27Initial program 99.1%
associate-+l+99.1%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in x around inf 50.6%
Final simplification51.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.9e+193) (not (<= z 6.5e-21))) (* z (+ y (+ (* a (+ b (/ t z))) (/ x z)))) (+ (+ (+ x (* z y)) (* a t)) (* b (* z a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.9e+193) || !(z <= 6.5e-21)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = ((x + (z * y)) + (a * t)) + (b * (z * 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.9d+193)) .or. (.not. (z <= 6.5d-21))) then
tmp = z * (y + ((a * (b + (t / z))) + (x / z)))
else
tmp = ((x + (z * y)) + (a * t)) + (b * (z * 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.9e+193) || !(z <= 6.5e-21)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = ((x + (z * y)) + (a * t)) + (b * (z * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.9e+193) or not (z <= 6.5e-21): tmp = z * (y + ((a * (b + (t / z))) + (x / z))) else: tmp = ((x + (z * y)) + (a * t)) + (b * (z * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.9e+193) || !(z <= 6.5e-21)) tmp = Float64(z * Float64(y + Float64(Float64(a * Float64(b + Float64(t / z))) + Float64(x / z)))); else tmp = Float64(Float64(Float64(x + Float64(z * y)) + Float64(a * t)) + Float64(b * Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.9e+193) || ~((z <= 6.5e-21))) tmp = z * (y + ((a * (b + (t / z))) + (x / z))); else tmp = ((x + (z * y)) + (a * t)) + (b * (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.9e+193], N[Not[LessEqual[z, 6.5e-21]], $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[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+193} \lor \neg \left(z \leq 6.5 \cdot 10^{-21}\right):\\
\;\;\;\;z \cdot \left(y + \left(a \cdot \left(b + \frac{t}{z}\right) + \frac{x}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x + z \cdot y\right) + a \cdot t\right) + b \cdot \left(z \cdot a\right)\\
\end{array}
\end{array}
if z < -2.90000000000000013e193 or 6.49999999999999987e-21 < z Initial program 80.6%
associate-+l+80.6%
associate-*l*85.2%
Simplified85.2%
Taylor expanded in z around inf 96.2%
+-commutative96.2%
associate-+r+96.2%
associate-/l*99.0%
distribute-lft-out99.9%
Simplified99.9%
if -2.90000000000000013e193 < z < 6.49999999999999987e-21Initial program 99.3%
Final simplification99.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1e+77) (not (<= z 6.5e-21))) (* z (+ y (+ (* a (+ b (/ t z))) (/ x z)))) (+ (+ x (* z y)) (+ (* a (* z b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1e+77) || !(z <= 6.5e-21)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = (x + (z * y)) + ((a * (z * b)) + (a * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1d+77)) .or. (.not. (z <= 6.5d-21))) then
tmp = z * (y + ((a * (b + (t / z))) + (x / z)))
else
tmp = (x + (z * y)) + ((a * (z * b)) + (a * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1e+77) || !(z <= 6.5e-21)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = (x + (z * y)) + ((a * (z * b)) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1e+77) or not (z <= 6.5e-21): tmp = z * (y + ((a * (b + (t / z))) + (x / z))) else: tmp = (x + (z * y)) + ((a * (z * b)) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1e+77) || !(z <= 6.5e-21)) tmp = Float64(z * Float64(y + Float64(Float64(a * Float64(b + Float64(t / z))) + Float64(x / z)))); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * Float64(z * b)) + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1e+77) || ~((z <= 6.5e-21))) tmp = z * (y + ((a * (b + (t / z))) + (x / z))); else tmp = (x + (z * y)) + ((a * (z * b)) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1e+77], N[Not[LessEqual[z, 6.5e-21]], $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[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+77} \lor \neg \left(z \leq 6.5 \cdot 10^{-21}\right):\\
\;\;\;\;z \cdot \left(y + \left(a \cdot \left(b + \frac{t}{z}\right) + \frac{x}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\
\end{array}
\end{array}
if z < -9.99999999999999983e76 or 6.49999999999999987e-21 < z Initial program 83.3%
associate-+l+83.3%
associate-*l*84.2%
Simplified84.2%
Taylor expanded in z around inf 96.7%
+-commutative96.7%
associate-+r+96.7%
associate-/l*99.1%
distribute-lft-out99.9%
Simplified99.9%
if -9.99999999999999983e76 < z < 6.49999999999999987e-21Initial program 99.2%
associate-+l+99.2%
associate-*l*99.2%
Simplified99.2%
Final simplification99.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.2e-76) (not (<= z 1.15e-42))) (* z (+ y (+ (* a (+ b (/ t z))) (/ x z)))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.2e-76) || !(z <= 1.15e-42)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} 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.2d-76)) .or. (.not. (z <= 1.15d-42))) then
tmp = z * (y + ((a * (b + (t / z))) + (x / z)))
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.2e-76) || !(z <= 1.15e-42)) {
tmp = z * (y + ((a * (b + (t / z))) + (x / z)));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.2e-76) or not (z <= 1.15e-42): tmp = z * (y + ((a * (b + (t / z))) + (x / z))) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.2e-76) || !(z <= 1.15e-42)) tmp = Float64(z * Float64(y + Float64(Float64(a * Float64(b + Float64(t / z))) + Float64(x / z)))); 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.2e-76) || ~((z <= 1.15e-42))) tmp = z * (y + ((a * (b + (t / z))) + (x / z))); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.2e-76], N[Not[LessEqual[z, 1.15e-42]], $MachinePrecision]], N[(z * N[(y + N[(N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / z), $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.2 \cdot 10^{-76} \lor \neg \left(z \leq 1.15 \cdot 10^{-42}\right):\\
\;\;\;\;z \cdot \left(y + \left(a \cdot \left(b + \frac{t}{z}\right) + \frac{x}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -1.20000000000000007e-76 or 1.15000000000000002e-42 < z Initial program 86.4%
associate-+l+86.4%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in z around inf 96.2%
+-commutative96.2%
associate-+r+96.2%
associate-/l*98.1%
distribute-lft-out98.7%
Simplified98.7%
if -1.20000000000000007e-76 < z < 1.15000000000000002e-42Initial program 99.0%
associate-+l+99.0%
+-commutative99.0%
fma-define99.0%
associate-*l*99.0%
*-commutative99.0%
*-commutative99.0%
distribute-rgt-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 89.4%
Final simplification95.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.9e+36) (not (<= z 6.5e+93))) (* z (+ y (+ (/ x z) (* 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+36) || !(z <= 6.5e+93)) {
tmp = z * (y + ((x / z) + (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+36)) .or. (.not. (z <= 6.5d+93))) then
tmp = z * (y + ((x / z) + (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+36) || !(z <= 6.5e+93)) {
tmp = z * (y + ((x / z) + (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+36) or not (z <= 6.5e+93): tmp = z * (y + ((x / z) + (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+36) || !(z <= 6.5e+93)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + 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+36) || ~((z <= 6.5e+93))) tmp = z * (y + ((x / z) + (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+36], N[Not[LessEqual[z, 6.5e+93]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + 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.9 \cdot 10^{+36} \lor \neg \left(z \leq 6.5 \cdot 10^{+93}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -1.90000000000000012e36 or 6.4999999999999998e93 < z Initial program 81.8%
associate-+l+81.8%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in z around inf 97.0%
+-commutative97.0%
associate-+r+97.0%
associate-/l*99.9%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in t around 0 90.6%
if -1.90000000000000012e36 < z < 6.4999999999999998e93Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
fma-define98.0%
associate-*l*98.0%
*-commutative98.0%
*-commutative98.0%
distribute-rgt-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 86.5%
Final simplification88.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -4.3e+240)
(* a t)
(if (<= a -1.6e+140)
(* z (* a b))
(if (<= a 7.5e+68) (+ x (* z y)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.3e+240) {
tmp = a * t;
} else if (a <= -1.6e+140) {
tmp = z * (a * b);
} else if (a <= 7.5e+68) {
tmp = x + (z * y);
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-4.3d+240)) then
tmp = a * t
else if (a <= (-1.6d+140)) then
tmp = z * (a * b)
else if (a <= 7.5d+68) then
tmp = x + (z * y)
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.3e+240) {
tmp = a * t;
} else if (a <= -1.6e+140) {
tmp = z * (a * b);
} else if (a <= 7.5e+68) {
tmp = x + (z * y);
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.3e+240: tmp = a * t elif a <= -1.6e+140: tmp = z * (a * b) elif a <= 7.5e+68: tmp = x + (z * y) else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.3e+240) tmp = Float64(a * t); elseif (a <= -1.6e+140) tmp = Float64(z * Float64(a * b)); elseif (a <= 7.5e+68) tmp = Float64(x + Float64(z * y)); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4.3e+240) tmp = a * t; elseif (a <= -1.6e+140) tmp = z * (a * b); elseif (a <= 7.5e+68) tmp = x + (z * y); else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.3e+240], N[(a * t), $MachinePrecision], If[LessEqual[a, -1.6e+140], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.5e+68], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{+240}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -1.6 \cdot 10^{+140}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{+68}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -4.3e240 or 7.49999999999999959e68 < a Initial program 81.6%
associate-+l+81.6%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in z around inf 66.5%
+-commutative66.5%
associate-+r+66.5%
associate-/l*71.1%
distribute-lft-out76.1%
Simplified76.1%
Taylor expanded in t around inf 60.3%
if -4.3e240 < a < -1.60000000000000005e140Initial program 83.5%
associate-+l+83.5%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in z around inf 83.4%
+-commutative83.4%
associate-+r+83.4%
associate-/l*83.3%
distribute-lft-out87.5%
Simplified87.5%
Taylor expanded in b around inf 57.8%
associate-*r*58.0%
*-commutative58.0%
Simplified58.0%
if -1.60000000000000005e140 < a < 7.49999999999999959e68Initial program 96.4%
associate-+l+96.4%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in a around 0 72.6%
Final simplification68.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6e-138) (not (<= a 1.5e-62))) (+ x (* a (+ t (* z b)))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6e-138) || !(a <= 1.5e-62)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-6d-138)) .or. (.not. (a <= 1.5d-62))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6e-138) || !(a <= 1.5e-62)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6e-138) or not (a <= 1.5e-62): tmp = x + (a * (t + (z * b))) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6e-138) || !(a <= 1.5e-62)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -6e-138) || ~((a <= 1.5e-62))) tmp = x + (a * (t + (z * b))); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6e-138], N[Not[LessEqual[a, 1.5e-62]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-138} \lor \neg \left(a \leq 1.5 \cdot 10^{-62}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -6.0000000000000001e-138 or 1.5000000000000001e-62 < a Initial program 87.5%
associate-+l+87.5%
+-commutative87.5%
fma-define87.5%
associate-*l*92.2%
*-commutative92.2%
*-commutative92.2%
distribute-rgt-out95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in y around 0 84.5%
if -6.0000000000000001e-138 < a < 1.5000000000000001e-62Initial program 98.9%
associate-+l+98.9%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in a around 0 86.6%
Final simplification85.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4.2e+154) (* a t) (if (<= t -6.7e-278) (* z y) (if (<= t 3.5e+56) x (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.2e+154) {
tmp = a * t;
} else if (t <= -6.7e-278) {
tmp = z * y;
} else if (t <= 3.5e+56) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-4.2d+154)) then
tmp = a * t
else if (t <= (-6.7d-278)) then
tmp = z * y
else if (t <= 3.5d+56) then
tmp = x
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.2e+154) {
tmp = a * t;
} else if (t <= -6.7e-278) {
tmp = z * y;
} else if (t <= 3.5e+56) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -4.2e+154: tmp = a * t elif t <= -6.7e-278: tmp = z * y elif t <= 3.5e+56: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.2e+154) tmp = Float64(a * t); elseif (t <= -6.7e-278) tmp = Float64(z * y); elseif (t <= 3.5e+56) tmp = x; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -4.2e+154) tmp = a * t; elseif (t <= -6.7e-278) tmp = z * y; elseif (t <= 3.5e+56) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.2e+154], N[(a * t), $MachinePrecision], If[LessEqual[t, -6.7e-278], N[(z * y), $MachinePrecision], If[LessEqual[t, 3.5e+56], x, N[(a * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+154}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq -6.7 \cdot 10^{-278}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+56}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -4.19999999999999989e154 or 3.49999999999999999e56 < t Initial program 89.5%
associate-+l+89.5%
associate-*l*88.6%
Simplified88.6%
Taylor expanded in z around inf 65.4%
+-commutative65.4%
associate-+r+65.4%
associate-/l*60.8%
distribute-lft-out66.6%
Simplified66.6%
Taylor expanded in t around inf 59.3%
if -4.19999999999999989e154 < t < -6.69999999999999988e-278Initial program 87.9%
associate-+l+87.9%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in y around inf 38.2%
*-commutative38.2%
Simplified38.2%
if -6.69999999999999988e-278 < t < 3.49999999999999999e56Initial program 97.5%
associate-+l+97.5%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 46.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.25e+99) (not (<= a 8.6e+67))) (* a (+ t (* z b))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.25e+99) || !(a <= 8.6e+67)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.25d+99)) .or. (.not. (a <= 8.6d+67))) then
tmp = a * (t + (z * b))
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.25e+99) || !(a <= 8.6e+67)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.25e+99) or not (a <= 8.6e+67): tmp = a * (t + (z * b)) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.25e+99) || !(a <= 8.6e+67)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.25e+99) || ~((a <= 8.6e+67))) tmp = a * (t + (z * b)); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.25e+99], N[Not[LessEqual[a, 8.6e+67]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+99} \lor \neg \left(a \leq 8.6 \cdot 10^{+67}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.25000000000000002e99 or 8.6000000000000002e67 < a Initial program 82.4%
associate-+l+82.4%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in y around 0 85.4%
Taylor expanded in x around 0 76.5%
+-commutative76.5%
distribute-lft-out82.5%
*-commutative82.5%
Applied egg-rr82.5%
if -1.25000000000000002e99 < a < 8.6000000000000002e67Initial program 97.4%
associate-+l+97.4%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in a around 0 75.3%
Final simplification78.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.1e+95) (not (<= a 1.35e+63))) (+ x (* a t)) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.1e+95) || !(a <= 1.35e+63)) {
tmp = x + (a * t);
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-3.1d+95)) .or. (.not. (a <= 1.35d+63))) then
tmp = x + (a * t)
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.1e+95) || !(a <= 1.35e+63)) {
tmp = x + (a * t);
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.1e+95) or not (a <= 1.35e+63): tmp = x + (a * t) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.1e+95) || !(a <= 1.35e+63)) tmp = Float64(x + Float64(a * t)); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.1e+95) || ~((a <= 1.35e+63))) tmp = x + (a * t); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.1e+95], N[Not[LessEqual[a, 1.35e+63]], $MachinePrecision]], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{+95} \lor \neg \left(a \leq 1.35 \cdot 10^{+63}\right):\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -3.1000000000000003e95 or 1.35000000000000009e63 < a Initial program 83.1%
associate-+l+83.1%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in z around 0 60.5%
+-commutative60.5%
Simplified60.5%
if -3.1000000000000003e95 < a < 1.35000000000000009e63Initial program 97.3%
associate-+l+97.3%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in a around 0 75.8%
Final simplification69.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.7e+99) (not (<= a 7.5e-18))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.7e+99) || !(a <= 7.5e-18)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-6.7d+99)) .or. (.not. (a <= 7.5d-18))) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.7e+99) || !(a <= 7.5e-18)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.7e+99) or not (a <= 7.5e-18): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.7e+99) || !(a <= 7.5e-18)) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -6.7e+99) || ~((a <= 7.5e-18))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.7e+99], N[Not[LessEqual[a, 7.5e-18]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.7 \cdot 10^{+99} \lor \neg \left(a \leq 7.5 \cdot 10^{-18}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.70000000000000024e99 or 7.50000000000000015e-18 < a Initial program 83.3%
associate-+l+83.3%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in z around inf 72.8%
+-commutative72.8%
associate-+r+72.8%
associate-/l*75.3%
distribute-lft-out78.8%
Simplified78.8%
Taylor expanded in t around inf 46.4%
if -6.70000000000000024e99 < a < 7.50000000000000015e-18Initial program 98.5%
associate-+l+98.5%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around inf 44.4%
Final simplification45.3%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 91.5%
associate-+l+91.5%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in x around inf 29.3%
(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 2024112
(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)))