
(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 15 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.3e+62) (not (<= z 6e+34))) (* z (+ y (+ (/ x z) (* a (+ b (/ t 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 <= -2.3e+62) || !(z <= 6e+34)) {
tmp = z * (y + ((x / z) + (a * (b + (t / 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 <= -2.3e+62) || !(z <= 6e+34)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / 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, -2.3e+62], N[Not[LessEqual[z, 6e+34]], $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[(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 -2.3 \cdot 10^{+62} \lor \neg \left(z \leq 6 \cdot 10^{+34}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\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 < -2.29999999999999984e62 or 6.00000000000000037e34 < z Initial program 87.6%
associate-+l+87.6%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in z around inf 98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-/l*99.8%
distribute-lft-out99.8%
Simplified99.8%
if -2.29999999999999984e62 < z < 6.00000000000000037e34Initial program 98.5%
associate-+l+98.5%
+-commutative98.5%
fma-define98.5%
associate-*l*99.2%
*-commutative99.2%
*-commutative99.2%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
remove-double-neg100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -6.5e+69)
(* a t)
(if (<= t 9.5e-226)
x
(if (<= t 1.55e-89) (* z y) (if (<= t 2.9e+106) (* a (* z b)) (* a t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.5e+69) {
tmp = a * t;
} else if (t <= 9.5e-226) {
tmp = x;
} else if (t <= 1.55e-89) {
tmp = z * y;
} else if (t <= 2.9e+106) {
tmp = a * (z * b);
} 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 <= (-6.5d+69)) then
tmp = a * t
else if (t <= 9.5d-226) then
tmp = x
else if (t <= 1.55d-89) then
tmp = z * y
else if (t <= 2.9d+106) then
tmp = a * (z * b)
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 <= -6.5e+69) {
tmp = a * t;
} else if (t <= 9.5e-226) {
tmp = x;
} else if (t <= 1.55e-89) {
tmp = z * y;
} else if (t <= 2.9e+106) {
tmp = a * (z * b);
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6.5e+69: tmp = a * t elif t <= 9.5e-226: tmp = x elif t <= 1.55e-89: tmp = z * y elif t <= 2.9e+106: tmp = a * (z * b) else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6.5e+69) tmp = Float64(a * t); elseif (t <= 9.5e-226) tmp = x; elseif (t <= 1.55e-89) tmp = Float64(z * y); elseif (t <= 2.9e+106) tmp = Float64(a * Float64(z * b)); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -6.5e+69) tmp = a * t; elseif (t <= 9.5e-226) tmp = x; elseif (t <= 1.55e-89) tmp = z * y; elseif (t <= 2.9e+106) tmp = a * (z * b); else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.5e+69], N[(a * t), $MachinePrecision], If[LessEqual[t, 9.5e-226], x, If[LessEqual[t, 1.55e-89], N[(z * y), $MachinePrecision], If[LessEqual[t, 2.9e+106], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+69}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-226}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-89}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+106}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -6.5000000000000001e69 or 2.9000000000000002e106 < t Initial program 92.3%
associate-+l+92.3%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in t around inf 60.6%
if -6.5000000000000001e69 < t < 9.5000000000000007e-226Initial program 94.0%
associate-+l+94.0%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in x around inf 39.8%
if 9.5000000000000007e-226 < t < 1.54999999999999998e-89Initial program 96.8%
associate-+l+96.8%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in y around inf 44.1%
*-commutative44.1%
Simplified44.1%
if 1.54999999999999998e-89 < t < 2.9000000000000002e106Initial program 91.6%
associate-+l+91.6%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in a around inf 61.9%
Taylor expanded in t around 0 44.6%
Final simplification48.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1e+64) (not (<= z 3.65e+34))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ (+ x (* z y)) (+ (* a t) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1e+64) || !(z <= 3.65e+34)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1d+64)) .or. (.not. (z <= 3.65d+34))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1e+64) || !(z <= 3.65e+34)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1e+64) or not (z <= 3.65e+34): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = (x + (z * y)) + ((a * t) + (a * (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1e+64) || !(z <= 3.65e+34)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * t) + Float64(a * Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1e+64) || ~((z <= 3.65e+34))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = (x + (z * y)) + ((a * t) + (a * (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1e+64], N[Not[LessEqual[z, 3.65e+34]], $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[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+64} \lor \neg \left(z \leq 3.65 \cdot 10^{+34}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -1.00000000000000002e64 or 3.6499999999999998e34 < z Initial program 87.6%
associate-+l+87.6%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in z around inf 98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-/l*99.8%
distribute-lft-out99.8%
Simplified99.8%
if -1.00000000000000002e64 < z < 3.6499999999999998e34Initial program 98.5%
associate-+l+98.5%
associate-*l*99.2%
Simplified99.2%
Final simplification99.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.2e-21) (not (<= z 3.8e-84))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.2e-21) || !(z <= 3.8e-84)) {
tmp = z * (y + ((x / z) + (a * (b + (t / 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 <= (-6.2d-21)) .or. (.not. (z <= 3.8d-84))) then
tmp = z * (y + ((x / z) + (a * (b + (t / 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 <= -6.2e-21) || !(z <= 3.8e-84)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.2e-21) or not (z <= 3.8e-84): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.2e-21) || !(z <= 3.8e-84)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / 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 <= -6.2e-21) || ~((z <= 3.8e-84))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.2e-21], N[Not[LessEqual[z, 3.8e-84]], $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[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-21} \lor \neg \left(z \leq 3.8 \cdot 10^{-84}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -6.1999999999999997e-21 or 3.79999999999999986e-84 < z Initial program 90.6%
associate-+l+90.6%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in z around inf 97.5%
+-commutative97.5%
associate-+l+97.5%
+-commutative97.5%
associate-/l*98.7%
distribute-lft-out98.7%
Simplified98.7%
if -6.1999999999999997e-21 < z < 3.79999999999999986e-84Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
fma-define98.0%
associate-*l*98.9%
*-commutative98.9%
*-commutative98.9%
distribute-rgt-out99.9%
remove-double-neg99.9%
*-commutative99.9%
distribute-lft-neg-out99.9%
sub-neg99.9%
sub-neg99.9%
distribute-lft-neg-out99.9%
*-commutative99.9%
remove-double-neg99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 94.5%
Final simplification97.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<= z -9.6e+71)
t_1
(if (<= z 1.25e-84)
(+ x (* a (+ t (* z b))))
(if (<= z 2.9e+164) (+ x (+ (* z y) (* a t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -9.6e+71) {
tmp = t_1;
} else if (z <= 1.25e-84) {
tmp = x + (a * (t + (z * b)));
} else if (z <= 2.9e+164) {
tmp = x + ((z * y) + (a * t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * (y + (a * b))
if (z <= (-9.6d+71)) then
tmp = t_1
else if (z <= 1.25d-84) then
tmp = x + (a * (t + (z * b)))
else if (z <= 2.9d+164) then
tmp = x + ((z * y) + (a * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -9.6e+71) {
tmp = t_1;
} else if (z <= 1.25e-84) {
tmp = x + (a * (t + (z * b)));
} else if (z <= 2.9e+164) {
tmp = x + ((z * y) + (a * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (y + (a * b)) tmp = 0 if z <= -9.6e+71: tmp = t_1 elif z <= 1.25e-84: tmp = x + (a * (t + (z * b))) elif z <= 2.9e+164: tmp = x + ((z * y) + (a * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -9.6e+71) tmp = t_1; elseif (z <= 1.25e-84) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (z <= 2.9e+164) tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (y + (a * b)); tmp = 0.0; if (z <= -9.6e+71) tmp = t_1; elseif (z <= 1.25e-84) tmp = x + (a * (t + (z * b))); elseif (z <= 2.9e+164) tmp = x + ((z * y) + (a * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.6e+71], t$95$1, If[LessEqual[z, 1.25e-84], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+164], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-84}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+164}:\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.59999999999999923e71 or 2.8999999999999999e164 < z Initial program 83.4%
associate-+l+83.4%
associate-*l*80.3%
Simplified80.3%
Taylor expanded in z around inf 86.0%
if -9.59999999999999923e71 < z < 1.25e-84Initial program 98.2%
associate-+l+98.2%
+-commutative98.2%
fma-define98.2%
associate-*l*99.0%
*-commutative99.0%
*-commutative99.0%
distribute-rgt-out99.9%
remove-double-neg99.9%
*-commutative99.9%
distribute-lft-neg-out99.9%
sub-neg99.9%
sub-neg99.9%
distribute-lft-neg-out99.9%
*-commutative99.9%
remove-double-neg99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 92.5%
if 1.25e-84 < z < 2.8999999999999999e164Initial program 99.9%
associate-+l+99.9%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in b around 0 86.5%
Final simplification88.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -9.8e-23)
(* z y)
(if (<= z 9.5e-279)
(* a t)
(if (<= z 6.5e+31) x (if (<= z 1.32e+60) (* a t) (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -9.8e-23) {
tmp = z * y;
} else if (z <= 9.5e-279) {
tmp = a * t;
} else if (z <= 6.5e+31) {
tmp = x;
} else if (z <= 1.32e+60) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-9.8d-23)) then
tmp = z * y
else if (z <= 9.5d-279) then
tmp = a * t
else if (z <= 6.5d+31) then
tmp = x
else if (z <= 1.32d+60) then
tmp = a * t
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -9.8e-23) {
tmp = z * y;
} else if (z <= 9.5e-279) {
tmp = a * t;
} else if (z <= 6.5e+31) {
tmp = x;
} else if (z <= 1.32e+60) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -9.8e-23: tmp = z * y elif z <= 9.5e-279: tmp = a * t elif z <= 6.5e+31: tmp = x elif z <= 1.32e+60: tmp = a * t else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -9.8e-23) tmp = Float64(z * y); elseif (z <= 9.5e-279) tmp = Float64(a * t); elseif (z <= 6.5e+31) tmp = x; elseif (z <= 1.32e+60) tmp = Float64(a * t); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -9.8e-23) tmp = z * y; elseif (z <= 9.5e-279) tmp = a * t; elseif (z <= 6.5e+31) tmp = x; elseif (z <= 1.32e+60) tmp = a * t; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -9.8e-23], N[(z * y), $MachinePrecision], If[LessEqual[z, 9.5e-279], N[(a * t), $MachinePrecision], If[LessEqual[z, 6.5e+31], x, If[LessEqual[z, 1.32e+60], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{-23}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-279}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+31}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+60}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -9.7999999999999996e-23 or 1.32e60 < z Initial program 87.8%
associate-+l+87.8%
associate-*l*84.7%
Simplified84.7%
Taylor expanded in y around inf 48.6%
*-commutative48.6%
Simplified48.6%
if -9.7999999999999996e-23 < z < 9.4999999999999996e-279 or 6.5000000000000004e31 < z < 1.32e60Initial program 98.5%
associate-+l+98.5%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in t around inf 52.1%
if 9.4999999999999996e-279 < z < 6.5000000000000004e31Initial program 98.5%
associate-+l+98.5%
associate-*l*98.5%
Simplified98.5%
Taylor expanded in x around inf 41.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z y) (* a t))))
(if (<= b -3.8e+139)
(+ x (* b (* a (+ z (/ t b)))))
(if (<= b 8.5e-23) (+ x t_1) (+ t_1 (* b (* z a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * y) + (a * t);
double tmp;
if (b <= -3.8e+139) {
tmp = x + (b * (a * (z + (t / b))));
} else if (b <= 8.5e-23) {
tmp = x + t_1;
} else {
tmp = t_1 + (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) :: t_1
real(8) :: tmp
t_1 = (z * y) + (a * t)
if (b <= (-3.8d+139)) then
tmp = x + (b * (a * (z + (t / b))))
else if (b <= 8.5d-23) then
tmp = x + t_1
else
tmp = t_1 + (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 t_1 = (z * y) + (a * t);
double tmp;
if (b <= -3.8e+139) {
tmp = x + (b * (a * (z + (t / b))));
} else if (b <= 8.5e-23) {
tmp = x + t_1;
} else {
tmp = t_1 + (b * (z * a));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * y) + (a * t) tmp = 0 if b <= -3.8e+139: tmp = x + (b * (a * (z + (t / b)))) elif b <= 8.5e-23: tmp = x + t_1 else: tmp = t_1 + (b * (z * a)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * y) + Float64(a * t)) tmp = 0.0 if (b <= -3.8e+139) tmp = Float64(x + Float64(b * Float64(a * Float64(z + Float64(t / b))))); elseif (b <= 8.5e-23) tmp = Float64(x + t_1); else tmp = Float64(t_1 + Float64(b * Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * y) + (a * t); tmp = 0.0; if (b <= -3.8e+139) tmp = x + (b * (a * (z + (t / b)))); elseif (b <= 8.5e-23) tmp = x + t_1; else tmp = t_1 + (b * (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.8e+139], N[(x + N[(b * N[(a * N[(z + N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.5e-23], N[(x + t$95$1), $MachinePrecision], N[(t$95$1 + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot y + a \cdot t\\
\mathbf{if}\;b \leq -3.8 \cdot 10^{+139}:\\
\;\;\;\;x + b \cdot \left(a \cdot \left(z + \frac{t}{b}\right)\right)\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{-23}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 + b \cdot \left(z \cdot a\right)\\
\end{array}
\end{array}
if b < -3.79999999999999999e139Initial program 93.1%
associate-+l+93.1%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in y around 0 84.6%
Taylor expanded in b around inf 93.2%
associate-/l*93.1%
distribute-lft-out93.1%
Simplified93.1%
if -3.79999999999999999e139 < b < 8.4999999999999996e-23Initial program 92.0%
associate-+l+92.0%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in b around 0 89.8%
if 8.4999999999999996e-23 < b Initial program 97.0%
Taylor expanded in x around 0 82.9%
Final simplification88.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.2e+139) (not (<= b 9.5e+116))) (+ x (* b (* a (+ z (/ t b))))) (+ x (+ (* z y) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.2e+139) || !(b <= 9.5e+116)) {
tmp = x + (b * (a * (z + (t / b))));
} else {
tmp = x + ((z * y) + (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 ((b <= (-4.2d+139)) .or. (.not. (b <= 9.5d+116))) then
tmp = x + (b * (a * (z + (t / b))))
else
tmp = x + ((z * y) + (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 ((b <= -4.2e+139) || !(b <= 9.5e+116)) {
tmp = x + (b * (a * (z + (t / b))));
} else {
tmp = x + ((z * y) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -4.2e+139) or not (b <= 9.5e+116): tmp = x + (b * (a * (z + (t / b)))) else: tmp = x + ((z * y) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.2e+139) || !(b <= 9.5e+116)) tmp = Float64(x + Float64(b * Float64(a * Float64(z + Float64(t / b))))); else tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -4.2e+139) || ~((b <= 9.5e+116))) tmp = x + (b * (a * (z + (t / b)))); else tmp = x + ((z * y) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.2e+139], N[Not[LessEqual[b, 9.5e+116]], $MachinePrecision]], N[(x + N[(b * N[(a * N[(z + N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.2 \cdot 10^{+139} \lor \neg \left(b \leq 9.5 \cdot 10^{+116}\right):\\
\;\;\;\;x + b \cdot \left(a \cdot \left(z + \frac{t}{b}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\
\end{array}
\end{array}
if b < -4.1999999999999997e139 or 9.5000000000000004e116 < b Initial program 97.0%
associate-+l+97.0%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in y around 0 81.4%
Taylor expanded in b around inf 87.7%
associate-/l*87.6%
distribute-lft-out87.6%
Simplified87.6%
if -4.1999999999999997e139 < b < 9.5000000000000004e116Initial program 92.1%
associate-+l+92.1%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in b around 0 88.1%
Final simplification88.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -3.4e+183)
(* a t)
(if (<= a 4.2e-20)
(+ x (* z y))
(if (<= a 8.2e+249) (* a t) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.4e+183) {
tmp = a * t;
} else if (a <= 4.2e-20) {
tmp = x + (z * y);
} else if (a <= 8.2e+249) {
tmp = a * t;
} else {
tmp = a * (z * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-3.4d+183)) then
tmp = a * t
else if (a <= 4.2d-20) then
tmp = x + (z * y)
else if (a <= 8.2d+249) then
tmp = a * t
else
tmp = a * (z * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.4e+183) {
tmp = a * t;
} else if (a <= 4.2e-20) {
tmp = x + (z * y);
} else if (a <= 8.2e+249) {
tmp = a * t;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3.4e+183: tmp = a * t elif a <= 4.2e-20: tmp = x + (z * y) elif a <= 8.2e+249: tmp = a * t else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3.4e+183) tmp = Float64(a * t); elseif (a <= 4.2e-20) tmp = Float64(x + Float64(z * y)); elseif (a <= 8.2e+249) tmp = Float64(a * t); else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3.4e+183) tmp = a * t; elseif (a <= 4.2e-20) tmp = x + (z * y); elseif (a <= 8.2e+249) tmp = a * t; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.4e+183], N[(a * t), $MachinePrecision], If[LessEqual[a, 4.2e-20], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.2e+249], N[(a * t), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.4 \cdot 10^{+183}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-20}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+249}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if a < -3.4e183 or 4.1999999999999998e-20 < a < 8.1999999999999994e249Initial program 87.9%
associate-+l+87.9%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in t around inf 56.3%
if -3.4e183 < a < 4.1999999999999998e-20Initial program 96.5%
associate-+l+96.5%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in a around 0 67.0%
if 8.1999999999999994e249 < a Initial program 82.4%
associate-+l+82.4%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in a around inf 90.8%
Taylor expanded in t around 0 73.3%
Final simplification64.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.6e+73) (not (<= z 1.8e+60))) (* z (+ y (* a b))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.6e+73) || !(z <= 1.8e+60)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.6d+73)) .or. (.not. (z <= 1.8d+60))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.6e+73) || !(z <= 1.8e+60)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.6e+73) or not (z <= 1.8e+60): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.6e+73) || !(z <= 1.8e+60)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.6e+73) || ~((z <= 1.8e+60))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.6e+73], N[Not[LessEqual[z, 1.8e+60]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+73} \lor \neg \left(z \leq 1.8 \cdot 10^{+60}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -2.6000000000000001e73 or 1.79999999999999984e60 < z Initial program 86.4%
associate-+l+86.4%
associate-*l*83.0%
Simplified83.0%
Taylor expanded in z around inf 82.6%
if -2.6000000000000001e73 < z < 1.79999999999999984e60Initial program 98.6%
associate-+l+98.6%
+-commutative98.6%
fma-define98.6%
associate-*l*98.0%
*-commutative98.0%
*-commutative98.0%
distribute-rgt-out98.7%
remove-double-neg98.7%
*-commutative98.7%
distribute-lft-neg-out98.7%
sub-neg98.7%
sub-neg98.7%
distribute-lft-neg-out98.7%
*-commutative98.7%
remove-double-neg98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in y around 0 85.4%
Final simplification84.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.2e+60) (not (<= z 8.8e+49))) (* z (+ y (* a b))) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.2e+60) || !(z <= 8.8e+49)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-4.2d+60)) .or. (.not. (z <= 8.8d+49))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.2e+60) || !(z <= 8.8e+49)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.2e+60) or not (z <= 8.8e+49): tmp = z * (y + (a * b)) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.2e+60) || !(z <= 8.8e+49)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4.2e+60) || ~((z <= 8.8e+49))) tmp = z * (y + (a * b)); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.2e+60], N[Not[LessEqual[z, 8.8e+49]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+60} \lor \neg \left(z \leq 8.8 \cdot 10^{+49}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -4.2000000000000002e60 or 8.8000000000000003e49 < z Initial program 86.9%
associate-+l+86.9%
associate-*l*82.7%
Simplified82.7%
Taylor expanded in z around inf 81.5%
if -4.2000000000000002e60 < z < 8.8000000000000003e49Initial program 98.6%
associate-+l+98.6%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in z around 0 73.7%
+-commutative73.7%
Simplified73.7%
Final simplification77.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.25e-48) (not (<= a 8e-63))) (* 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 <= -2.25e-48) || !(a <= 8e-63)) {
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 <= (-2.25d-48)) .or. (.not. (a <= 8d-63))) 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 <= -2.25e-48) || !(a <= 8e-63)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.25e-48) or not (a <= 8e-63): 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 <= -2.25e-48) || !(a <= 8e-63)) 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 <= -2.25e-48) || ~((a <= 8e-63))) 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, -2.25e-48], N[Not[LessEqual[a, 8e-63]], $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 -2.25 \cdot 10^{-48} \lor \neg \left(a \leq 8 \cdot 10^{-63}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -2.24999999999999994e-48 or 8.00000000000000053e-63 < a Initial program 89.5%
associate-+l+89.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around inf 68.8%
if -2.24999999999999994e-48 < a < 8.00000000000000053e-63Initial program 99.0%
associate-+l+99.0%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in a around 0 79.4%
Final simplification73.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.1e+72) (not (<= z 1.3e+60))) (+ x (* z y)) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.1e+72) || !(z <= 1.3e+60)) {
tmp = x + (z * y);
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-4.1d+72)) .or. (.not. (z <= 1.3d+60))) then
tmp = x + (z * y)
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.1e+72) || !(z <= 1.3e+60)) {
tmp = x + (z * y);
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.1e+72) or not (z <= 1.3e+60): tmp = x + (z * y) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.1e+72) || !(z <= 1.3e+60)) tmp = Float64(x + Float64(z * y)); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4.1e+72) || ~((z <= 1.3e+60))) tmp = x + (z * y); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.1e+72], N[Not[LessEqual[z, 1.3e+60]], $MachinePrecision]], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+72} \lor \neg \left(z \leq 1.3 \cdot 10^{+60}\right):\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -4.09999999999999963e72 or 1.30000000000000004e60 < z Initial program 86.4%
associate-+l+86.4%
associate-*l*83.0%
Simplified83.0%
Taylor expanded in a around 0 59.2%
if -4.09999999999999963e72 < z < 1.30000000000000004e60Initial program 98.6%
associate-+l+98.6%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in z around 0 73.0%
+-commutative73.0%
Simplified73.0%
Final simplification67.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -8.5e+69) (not (<= t 2.4e-94))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8.5e+69) || !(t <= 2.4e-94)) {
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 ((t <= (-8.5d+69)) .or. (.not. (t <= 2.4d-94))) 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 ((t <= -8.5e+69) || !(t <= 2.4e-94)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8.5e+69) or not (t <= 2.4e-94): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8.5e+69) || !(t <= 2.4e-94)) 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 ((t <= -8.5e+69) || ~((t <= 2.4e-94))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8.5e+69], N[Not[LessEqual[t, 2.4e-94]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+69} \lor \neg \left(t \leq 2.4 \cdot 10^{-94}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -8.5000000000000002e69 or 2.4e-94 < t Initial program 92.2%
associate-+l+92.2%
associate-*l*88.6%
Simplified88.6%
Taylor expanded in t around inf 48.9%
if -8.5000000000000002e69 < t < 2.4e-94Initial program 94.7%
associate-+l+94.7%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around inf 36.4%
Final simplification42.7%
(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.4%
associate-+l+93.4%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in x around inf 24.8%
(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 2024131
(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)))