
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 INFINITY) t_1 (+ x (* b (* a (+ z (/ t b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x + (b * (a * (z + (t / b))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x + (b * (a * (z + (t / b))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x + (b * (a * (z + (t / b)))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(x + Float64(b * Float64(a * Float64(z + Float64(t / b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = x + (b * (a * (z + (t / b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x + N[(b * N[(a * N[(z + N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + b \cdot \left(a \cdot \left(z + \frac{t}{b}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 98.4%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
+-commutative0.0%
fma-define0.0%
associate-*l*26.3%
*-commutative26.3%
*-commutative26.3%
distribute-rgt-out68.4%
remove-double-neg68.4%
*-commutative68.4%
distribute-lft-neg-out68.4%
sub-neg68.4%
sub-neg68.4%
distribute-lft-neg-in68.4%
remove-double-neg68.4%
Simplified68.4%
Taylor expanded in y around 0 79.4%
Taylor expanded in b around inf 10.5%
associate-/l*42.1%
distribute-lft-out84.2%
Simplified84.2%
Final simplification97.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* z a) b)))
(if (<= z -2.8e+142)
t_1
(if (<= z -2.9e-73)
(* y z)
(if (<= z -8.6e-295)
(* t a)
(if (<= z 4.8e-40) x (if (<= z 2.4e+65) (* y z) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * a) * b;
double tmp;
if (z <= -2.8e+142) {
tmp = t_1;
} else if (z <= -2.9e-73) {
tmp = y * z;
} else if (z <= -8.6e-295) {
tmp = t * a;
} else if (z <= 4.8e-40) {
tmp = x;
} else if (z <= 2.4e+65) {
tmp = y * 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 = (z * a) * b
if (z <= (-2.8d+142)) then
tmp = t_1
else if (z <= (-2.9d-73)) then
tmp = y * z
else if (z <= (-8.6d-295)) then
tmp = t * a
else if (z <= 4.8d-40) then
tmp = x
else if (z <= 2.4d+65) then
tmp = y * 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 = (z * a) * b;
double tmp;
if (z <= -2.8e+142) {
tmp = t_1;
} else if (z <= -2.9e-73) {
tmp = y * z;
} else if (z <= -8.6e-295) {
tmp = t * a;
} else if (z <= 4.8e-40) {
tmp = x;
} else if (z <= 2.4e+65) {
tmp = y * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * a) * b tmp = 0 if z <= -2.8e+142: tmp = t_1 elif z <= -2.9e-73: tmp = y * z elif z <= -8.6e-295: tmp = t * a elif z <= 4.8e-40: tmp = x elif z <= 2.4e+65: tmp = y * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * a) * b) tmp = 0.0 if (z <= -2.8e+142) tmp = t_1; elseif (z <= -2.9e-73) tmp = Float64(y * z); elseif (z <= -8.6e-295) tmp = Float64(t * a); elseif (z <= 4.8e-40) tmp = x; elseif (z <= 2.4e+65) tmp = Float64(y * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * a) * b; tmp = 0.0; if (z <= -2.8e+142) tmp = t_1; elseif (z <= -2.9e-73) tmp = y * z; elseif (z <= -8.6e-295) tmp = t * a; elseif (z <= 4.8e-40) tmp = x; elseif (z <= 2.4e+65) tmp = y * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[z, -2.8e+142], t$95$1, If[LessEqual[z, -2.9e-73], N[(y * z), $MachinePrecision], If[LessEqual[z, -8.6e-295], N[(t * a), $MachinePrecision], If[LessEqual[z, 4.8e-40], x, If[LessEqual[z, 2.4e+65], N[(y * z), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-73}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-295}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-40}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+65}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8e142 or 2.4000000000000002e65 < z Initial program 79.8%
add-cube-cbrt79.7%
pow379.7%
*-commutative79.7%
Applied egg-rr79.7%
Taylor expanded in z around inf 83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in a around inf 55.7%
associate-*r*57.7%
*-commutative57.7%
associate-*r*56.8%
Simplified56.8%
if -2.8e142 < z < -2.9e-73 or 4.79999999999999982e-40 < z < 2.4000000000000002e65Initial program 94.1%
add-cube-cbrt93.9%
pow393.9%
*-commutative93.9%
Applied egg-rr93.9%
Taylor expanded in y around inf 44.4%
*-commutative44.4%
Simplified44.4%
if -2.9e-73 < z < -8.59999999999999934e-295Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 86.2%
Taylor expanded in x around 0 54.8%
if -8.59999999999999934e-295 < z < 4.79999999999999982e-40Initial program 97.8%
associate-+l+97.8%
associate-*l*97.9%
Simplified97.9%
Taylor expanded in z around 0 79.2%
Taylor expanded in x around inf 46.2%
Final simplification51.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= z -8.8e+151)
t_1
(if (<= z -7.5e-73)
(* y z)
(if (<= z -2.5e-296)
(* t a)
(if (<= z 2.2e-40) x (if (<= z 8e+64) (* y z) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (z <= -8.8e+151) {
tmp = t_1;
} else if (z <= -7.5e-73) {
tmp = y * z;
} else if (z <= -2.5e-296) {
tmp = t * a;
} else if (z <= 2.2e-40) {
tmp = x;
} else if (z <= 8e+64) {
tmp = y * 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 = a * (z * b)
if (z <= (-8.8d+151)) then
tmp = t_1
else if (z <= (-7.5d-73)) then
tmp = y * z
else if (z <= (-2.5d-296)) then
tmp = t * a
else if (z <= 2.2d-40) then
tmp = x
else if (z <= 8d+64) then
tmp = y * 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 = a * (z * b);
double tmp;
if (z <= -8.8e+151) {
tmp = t_1;
} else if (z <= -7.5e-73) {
tmp = y * z;
} else if (z <= -2.5e-296) {
tmp = t * a;
} else if (z <= 2.2e-40) {
tmp = x;
} else if (z <= 8e+64) {
tmp = y * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if z <= -8.8e+151: tmp = t_1 elif z <= -7.5e-73: tmp = y * z elif z <= -2.5e-296: tmp = t * a elif z <= 2.2e-40: tmp = x elif z <= 8e+64: tmp = y * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (z <= -8.8e+151) tmp = t_1; elseif (z <= -7.5e-73) tmp = Float64(y * z); elseif (z <= -2.5e-296) tmp = Float64(t * a); elseif (z <= 2.2e-40) tmp = x; elseif (z <= 8e+64) tmp = Float64(y * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (z <= -8.8e+151) tmp = t_1; elseif (z <= -7.5e-73) tmp = y * z; elseif (z <= -2.5e-296) tmp = t * a; elseif (z <= 2.2e-40) tmp = x; elseif (z <= 8e+64) tmp = y * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e+151], t$95$1, If[LessEqual[z, -7.5e-73], N[(y * z), $MachinePrecision], If[LessEqual[z, -2.5e-296], N[(t * a), $MachinePrecision], If[LessEqual[z, 2.2e-40], x, If[LessEqual[z, 8e+64], N[(y * z), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-73}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-296}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-40}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+64}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.80000000000000027e151 or 8.00000000000000017e64 < z Initial program 79.8%
add-cube-cbrt79.7%
pow379.7%
*-commutative79.7%
Applied egg-rr79.7%
Taylor expanded in z around inf 83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in a around inf 55.7%
*-commutative55.7%
Simplified55.7%
if -8.80000000000000027e151 < z < -7.5e-73 or 2.20000000000000009e-40 < z < 8.00000000000000017e64Initial program 94.1%
add-cube-cbrt93.9%
pow393.9%
*-commutative93.9%
Applied egg-rr93.9%
Taylor expanded in y around inf 44.4%
*-commutative44.4%
Simplified44.4%
if -7.5e-73 < z < -2.50000000000000015e-296Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 86.2%
Taylor expanded in x around 0 54.8%
if -2.50000000000000015e-296 < z < 2.20000000000000009e-40Initial program 97.8%
associate-+l+97.8%
associate-*l*97.9%
Simplified97.9%
Taylor expanded in z around 0 79.2%
Taylor expanded in x around inf 46.2%
Final simplification50.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= z -9.6e+151)
(* (* z a) b)
(if (<= z -3.7e-52)
t_1
(if (<= z 8.5e-6)
(+ x (* t a))
(if (<= z 5.2e+146) t_1 (* z (* a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (z <= -9.6e+151) {
tmp = (z * a) * b;
} else if (z <= -3.7e-52) {
tmp = t_1;
} else if (z <= 8.5e-6) {
tmp = x + (t * a);
} else if (z <= 5.2e+146) {
tmp = t_1;
} else {
tmp = z * (a * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * z)
if (z <= (-9.6d+151)) then
tmp = (z * a) * b
else if (z <= (-3.7d-52)) then
tmp = t_1
else if (z <= 8.5d-6) then
tmp = x + (t * a)
else if (z <= 5.2d+146) then
tmp = t_1
else
tmp = z * (a * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (z <= -9.6e+151) {
tmp = (z * a) * b;
} else if (z <= -3.7e-52) {
tmp = t_1;
} else if (z <= 8.5e-6) {
tmp = x + (t * a);
} else if (z <= 5.2e+146) {
tmp = t_1;
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if z <= -9.6e+151: tmp = (z * a) * b elif z <= -3.7e-52: tmp = t_1 elif z <= 8.5e-6: tmp = x + (t * a) elif z <= 5.2e+146: tmp = t_1 else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (z <= -9.6e+151) tmp = Float64(Float64(z * a) * b); elseif (z <= -3.7e-52) tmp = t_1; elseif (z <= 8.5e-6) tmp = Float64(x + Float64(t * a)); elseif (z <= 5.2e+146) tmp = t_1; else tmp = Float64(z * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (z <= -9.6e+151) tmp = (z * a) * b; elseif (z <= -3.7e-52) tmp = t_1; elseif (z <= 8.5e-6) tmp = x + (t * a); elseif (z <= 5.2e+146) tmp = t_1; else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.6e+151], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[z, -3.7e-52], t$95$1, If[LessEqual[z, 8.5e-6], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+146], t$95$1, N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{+151}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-6}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -9.6000000000000004e151Initial program 78.5%
add-cube-cbrt78.4%
pow378.4%
*-commutative78.4%
Applied egg-rr78.4%
Taylor expanded in z around inf 89.5%
+-commutative89.5%
Simplified89.5%
Taylor expanded in a around inf 65.7%
associate-*r*65.8%
*-commutative65.8%
associate-*r*65.8%
Simplified65.8%
if -9.6000000000000004e151 < z < -3.6999999999999997e-52 or 8.4999999999999999e-6 < z < 5.20000000000000028e146Initial program 93.2%
add-cube-cbrt93.1%
pow393.1%
*-commutative93.1%
Applied egg-rr93.1%
Taylor expanded in a around 0 63.2%
if -3.6999999999999997e-52 < z < 8.4999999999999999e-6Initial program 99.1%
associate-+l+99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in z around 0 80.8%
if 5.20000000000000028e146 < z Initial program 75.5%
add-cube-cbrt75.3%
pow375.3%
*-commutative75.3%
Applied egg-rr75.3%
Taylor expanded in z around inf 83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in a around inf 53.7%
associate-*r*56.2%
*-commutative56.2%
Simplified56.2%
Final simplification70.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= b -3.2e+83)
t_1
(if (<= b -1.48e-64)
(* y z)
(if (<= b -6.5e-301) (* t a) (if (<= b 2.2e-49) (* y z) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (b <= -3.2e+83) {
tmp = t_1;
} else if (b <= -1.48e-64) {
tmp = y * z;
} else if (b <= -6.5e-301) {
tmp = t * a;
} else if (b <= 2.2e-49) {
tmp = y * 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 = z * (a * b)
if (b <= (-3.2d+83)) then
tmp = t_1
else if (b <= (-1.48d-64)) then
tmp = y * z
else if (b <= (-6.5d-301)) then
tmp = t * a
else if (b <= 2.2d-49) then
tmp = y * 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 = z * (a * b);
double tmp;
if (b <= -3.2e+83) {
tmp = t_1;
} else if (b <= -1.48e-64) {
tmp = y * z;
} else if (b <= -6.5e-301) {
tmp = t * a;
} else if (b <= 2.2e-49) {
tmp = y * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if b <= -3.2e+83: tmp = t_1 elif b <= -1.48e-64: tmp = y * z elif b <= -6.5e-301: tmp = t * a elif b <= 2.2e-49: tmp = y * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (b <= -3.2e+83) tmp = t_1; elseif (b <= -1.48e-64) tmp = Float64(y * z); elseif (b <= -6.5e-301) tmp = Float64(t * a); elseif (b <= 2.2e-49) tmp = Float64(y * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (b <= -3.2e+83) tmp = t_1; elseif (b <= -1.48e-64) tmp = y * z; elseif (b <= -6.5e-301) tmp = t * a; elseif (b <= 2.2e-49) tmp = y * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.2e+83], t$95$1, If[LessEqual[b, -1.48e-64], N[(y * z), $MachinePrecision], If[LessEqual[b, -6.5e-301], N[(t * a), $MachinePrecision], If[LessEqual[b, 2.2e-49], N[(y * z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -3.2 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.48 \cdot 10^{-64}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq -6.5 \cdot 10^{-301}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{-49}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.1999999999999999e83 or 2.1999999999999999e-49 < b Initial program 88.4%
add-cube-cbrt88.2%
pow388.2%
*-commutative88.2%
Applied egg-rr88.2%
Taylor expanded in z around inf 67.6%
+-commutative67.6%
Simplified67.6%
Taylor expanded in a around inf 49.2%
associate-*r*54.2%
*-commutative54.2%
Simplified54.2%
if -3.1999999999999999e83 < b < -1.48e-64 or -6.49999999999999991e-301 < b < 2.1999999999999999e-49Initial program 93.5%
add-cube-cbrt93.5%
pow393.5%
*-commutative93.5%
Applied egg-rr93.5%
Taylor expanded in y around inf 45.2%
*-commutative45.2%
Simplified45.2%
if -1.48e-64 < b < -6.49999999999999991e-301Initial program 94.6%
associate-+l+94.6%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 81.6%
Taylor expanded in x around 0 50.3%
Final simplification50.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.02e+115) (not (<= b 5.8e-48))) (+ x (* b (* a (+ z (/ t b))))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.02e+115) || !(b <= 5.8e-48)) {
tmp = x + (b * (a * (z + (t / b))));
} else {
tmp = x + ((t * a) + (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 ((b <= (-1.02d+115)) .or. (.not. (b <= 5.8d-48))) then
tmp = x + (b * (a * (z + (t / b))))
else
tmp = x + ((t * a) + (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 ((b <= -1.02e+115) || !(b <= 5.8e-48)) {
tmp = x + (b * (a * (z + (t / b))));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.02e+115) or not (b <= 5.8e-48): tmp = x + (b * (a * (z + (t / b)))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.02e+115) || !(b <= 5.8e-48)) tmp = Float64(x + Float64(b * Float64(a * Float64(z + Float64(t / b))))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.02e+115) || ~((b <= 5.8e-48))) tmp = x + (b * (a * (z + (t / b)))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.02e+115], N[Not[LessEqual[b, 5.8e-48]], $MachinePrecision]], N[(x + N[(b * N[(a * N[(z + N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.02 \cdot 10^{+115} \lor \neg \left(b \leq 5.8 \cdot 10^{-48}\right):\\
\;\;\;\;x + b \cdot \left(a \cdot \left(z + \frac{t}{b}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if b < -1.02e115 or 5.8000000000000006e-48 < b Initial program 87.6%
associate-+l+87.6%
+-commutative87.6%
fma-define87.6%
associate-*l*80.5%
*-commutative80.5%
*-commutative80.5%
distribute-rgt-out87.1%
remove-double-neg87.1%
*-commutative87.1%
distribute-lft-neg-out87.1%
sub-neg87.1%
sub-neg87.1%
distribute-lft-neg-in87.1%
remove-double-neg87.1%
Simplified87.1%
Taylor expanded in y around 0 81.6%
Taylor expanded in b around inf 77.3%
associate-/l*82.2%
distribute-lft-out85.5%
Simplified85.5%
if -1.02e115 < b < 5.8000000000000006e-48Initial program 94.2%
associate-+l+94.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around 0 95.7%
Final simplification90.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t 1.7e+131) (+ (+ x (* y z)) (+ (* a (* z b)) (* t a))) (+ x (* t (+ a (* a (* b (/ z t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 1.7e+131) {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
} else {
tmp = x + (t * (a + (a * (b * (z / 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 <= 1.7d+131) then
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a))
else
tmp = x + (t * (a + (a * (b * (z / 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 <= 1.7e+131) {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
} else {
tmp = x + (t * (a + (a * (b * (z / t)))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= 1.7e+131: tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)) else: tmp = x + (t * (a + (a * (b * (z / t))))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 1.7e+131) tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(a * Float64(z * b)) + Float64(t * a))); else tmp = Float64(x + Float64(t * Float64(a + Float64(a * Float64(b * Float64(z / t)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= 1.7e+131) tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)); else tmp = x + (t * (a + (a * (b * (z / t))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 1.7e+131], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(a + N[(a * N[(b * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.7 \cdot 10^{+131}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(a \cdot \left(z \cdot b\right) + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \left(a + a \cdot \left(b \cdot \frac{z}{t}\right)\right)\\
\end{array}
\end{array}
if t < 1.69999999999999993e131Initial program 91.9%
associate-+l+91.9%
associate-*l*93.2%
Simplified93.2%
if 1.69999999999999993e131 < t Initial program 86.4%
associate-+l+86.4%
+-commutative86.4%
fma-define86.4%
associate-*l*76.3%
*-commutative76.3%
*-commutative76.3%
distribute-rgt-out84.4%
remove-double-neg84.4%
*-commutative84.4%
distribute-lft-neg-out84.4%
sub-neg84.4%
sub-neg84.4%
distribute-lft-neg-in84.4%
remove-double-neg84.4%
Simplified84.4%
Taylor expanded in y around 0 84.8%
Taylor expanded in t around inf 84.8%
associate-/l*84.8%
associate-/l*94.9%
Simplified94.9%
Final simplification93.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.3e-10) (not (<= y 35000.0))) (+ x (+ (* t a) (* y z))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.3e-10) || !(y <= 35000.0)) {
tmp = x + ((t * a) + (y * 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 ((y <= (-5.3d-10)) .or. (.not. (y <= 35000.0d0))) then
tmp = x + ((t * a) + (y * 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 ((y <= -5.3e-10) || !(y <= 35000.0)) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5.3e-10) or not (y <= 35000.0): tmp = x + ((t * a) + (y * z)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.3e-10) || !(y <= 35000.0)) tmp = Float64(x + Float64(Float64(t * a) + Float64(y * 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 ((y <= -5.3e-10) || ~((y <= 35000.0))) tmp = x + ((t * a) + (y * z)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.3e-10], N[Not[LessEqual[y, 35000.0]], $MachinePrecision]], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{-10} \lor \neg \left(y \leq 35000\right):\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if y < -5.3000000000000003e-10 or 35000 < y Initial program 92.2%
associate-+l+92.2%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in b around 0 88.6%
if -5.3000000000000003e-10 < y < 35000Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
fma-define89.9%
associate-*l*89.2%
*-commutative89.2%
*-commutative89.2%
distribute-rgt-out94.8%
remove-double-neg94.8%
*-commutative94.8%
distribute-lft-neg-out94.8%
sub-neg94.8%
sub-neg94.8%
distribute-lft-neg-in94.8%
remove-double-neg94.8%
Simplified94.8%
Taylor expanded in y around 0 91.8%
Final simplification90.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8.5e-47) (not (<= a 1.2e-149))) (+ x (* a (+ t (* z b)))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.5e-47) || !(a <= 1.2e-149)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (y * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-8.5d-47)) .or. (.not. (a <= 1.2d-149))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.5e-47) || !(a <= 1.2e-149)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.5e-47) or not (a <= 1.2e-149): tmp = x + (a * (t + (z * b))) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8.5e-47) || !(a <= 1.2e-149)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -8.5e-47) || ~((a <= 1.2e-149))) tmp = x + (a * (t + (z * b))); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8.5e-47], N[Not[LessEqual[a, 1.2e-149]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-47} \lor \neg \left(a \leq 1.2 \cdot 10^{-149}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -8.4999999999999999e-47 or 1.2000000000000001e-149 < a Initial program 87.7%
associate-+l+87.7%
+-commutative87.7%
fma-define87.7%
associate-*l*91.4%
*-commutative91.4%
*-commutative91.4%
distribute-rgt-out96.4%
remove-double-neg96.4%
*-commutative96.4%
distribute-lft-neg-out96.4%
sub-neg96.4%
sub-neg96.4%
distribute-lft-neg-in96.4%
remove-double-neg96.4%
Simplified96.4%
Taylor expanded in y around 0 86.0%
if -8.4999999999999999e-47 < a < 1.2000000000000001e-149Initial program 96.8%
add-cube-cbrt96.7%
pow396.8%
*-commutative96.8%
Applied egg-rr96.8%
Taylor expanded in a around 0 80.3%
Final simplification83.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -4.5e+20) x (if (<= x -2.55e-303) (* y z) (if (<= x 2.8e+104) (* t a) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.5e+20) {
tmp = x;
} else if (x <= -2.55e-303) {
tmp = y * z;
} else if (x <= 2.8e+104) {
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 <= (-4.5d+20)) then
tmp = x
else if (x <= (-2.55d-303)) then
tmp = y * z
else if (x <= 2.8d+104) 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 <= -4.5e+20) {
tmp = x;
} else if (x <= -2.55e-303) {
tmp = y * z;
} else if (x <= 2.8e+104) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4.5e+20: tmp = x elif x <= -2.55e-303: tmp = y * z elif x <= 2.8e+104: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.5e+20) tmp = x; elseif (x <= -2.55e-303) tmp = Float64(y * z); elseif (x <= 2.8e+104) 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 <= -4.5e+20) tmp = x; elseif (x <= -2.55e-303) tmp = y * z; elseif (x <= 2.8e+104) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.5e+20], x, If[LessEqual[x, -2.55e-303], N[(y * z), $MachinePrecision], If[LessEqual[x, 2.8e+104], N[(t * a), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+20}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.55 \cdot 10^{-303}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+104}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.5e20 or 2.8e104 < x Initial program 90.4%
associate-+l+90.4%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in z around 0 62.2%
Taylor expanded in x around inf 49.1%
if -4.5e20 < x < -2.55e-303Initial program 94.0%
add-cube-cbrt93.9%
pow393.9%
*-commutative93.9%
Applied egg-rr93.9%
Taylor expanded in y around inf 42.8%
*-commutative42.8%
Simplified42.8%
if -2.55e-303 < x < 2.8e104Initial program 89.6%
associate-+l+89.6%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in z around 0 44.1%
Taylor expanded in x around 0 41.4%
Final simplification45.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.6e-36) (not (<= z 0.88))) (* z (+ y (* a b))) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.6e-36) || !(z <= 0.88)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.6d-36)) .or. (.not. (z <= 0.88d0))) then
tmp = z * (y + (a * b))
else
tmp = x + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.6e-36) || !(z <= 0.88)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.6e-36) or not (z <= 0.88): tmp = z * (y + (a * b)) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.6e-36) || !(z <= 0.88)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.6e-36) || ~((z <= 0.88))) tmp = z * (y + (a * b)); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.6e-36], N[Not[LessEqual[z, 0.88]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-36} \lor \neg \left(z \leq 0.88\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -1.60000000000000011e-36 or 0.880000000000000004 < z Initial program 84.5%
associate-+l+84.5%
associate-*l*84.0%
Simplified84.0%
Taylor expanded in z around inf 78.6%
if -1.60000000000000011e-36 < z < 0.880000000000000004Initial program 99.1%
associate-+l+99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in z around 0 80.1%
Final simplification79.3%
(FPCore (x y z t a b) :precision binary64 (if (<= z -8.2e+30) (* (* z a) b) (if (<= z 6e+67) (+ x (* t a)) (* z (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8.2e+30) {
tmp = (z * a) * b;
} else if (z <= 6e+67) {
tmp = x + (t * a);
} else {
tmp = z * (a * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-8.2d+30)) then
tmp = (z * a) * b
else if (z <= 6d+67) then
tmp = x + (t * a)
else
tmp = z * (a * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8.2e+30) {
tmp = (z * a) * b;
} else if (z <= 6e+67) {
tmp = x + (t * a);
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -8.2e+30: tmp = (z * a) * b elif z <= 6e+67: tmp = x + (t * a) else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8.2e+30) tmp = Float64(Float64(z * a) * b); elseif (z <= 6e+67) tmp = Float64(x + Float64(t * a)); else tmp = Float64(z * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -8.2e+30) tmp = (z * a) * b; elseif (z <= 6e+67) tmp = x + (t * a); else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.2e+30], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[z, 6e+67], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+30}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+67}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -8.20000000000000011e30Initial program 83.7%
add-cube-cbrt83.6%
pow383.6%
*-commutative83.6%
Applied egg-rr83.6%
Taylor expanded in z around inf 86.3%
+-commutative86.3%
Simplified86.3%
Taylor expanded in a around inf 52.8%
associate-*r*54.4%
*-commutative54.4%
associate-*r*54.4%
Simplified54.4%
if -8.20000000000000011e30 < z < 6.0000000000000002e67Initial program 97.9%
associate-+l+97.9%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in z around 0 72.3%
if 6.0000000000000002e67 < z Initial program 80.3%
add-cube-cbrt80.2%
pow380.2%
*-commutative80.2%
Applied egg-rr80.2%
Taylor expanded in z around inf 80.2%
+-commutative80.2%
Simplified80.2%
Taylor expanded in a around inf 49.3%
associate-*r*52.9%
*-commutative52.9%
Simplified52.9%
Final simplification64.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.35e-5) x (if (<= x 1.25e+104) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.35e-5) {
tmp = x;
} else if (x <= 1.25e+104) {
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 <= (-2.35d-5)) then
tmp = x
else if (x <= 1.25d+104) 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 <= -2.35e-5) {
tmp = x;
} else if (x <= 1.25e+104) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.35e-5: tmp = x elif x <= 1.25e+104: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.35e-5) tmp = x; elseif (x <= 1.25e+104) 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 <= -2.35e-5) tmp = x; elseif (x <= 1.25e+104) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.35e-5], x, If[LessEqual[x, 1.25e+104], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+104}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.34999999999999986e-5 or 1.2499999999999999e104 < x Initial program 90.7%
associate-+l+90.7%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in z around 0 60.9%
Taylor expanded in x around inf 48.3%
if -2.34999999999999986e-5 < x < 1.2499999999999999e104Initial program 91.4%
associate-+l+91.4%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in z around 0 40.2%
Taylor expanded in x around 0 37.4%
Final simplification42.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 91.1%
associate-+l+91.1%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in z around 0 49.7%
Taylor expanded in x around inf 25.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024144
(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)))