
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (if (<= (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) INFINITY) (+ c (- (fma x y (* z (/ t 16.0))) (* a (/ b 4.0)))) (+ c (* t (* z 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= ((double) INFINITY)) {
tmp = c + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) <= Inf) tmp = Float64(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0)))); else tmp = Float64(c + Float64(t * Float64(z * 0.0625))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(c + N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\
\;\;\;\;c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 99.7%
associate-+l-99.7%
*-commutative99.7%
associate-+l-99.7%
fma-define99.7%
*-commutative99.7%
associate-/l*100.0%
associate-/l*100.0%
Simplified100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in z around inf 46.1%
associate-*r*46.1%
*-commutative46.1%
associate-*r*46.1%
Simplified46.1%
Final simplification97.7%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (fma z (/ t 16.0) (/ (* a b) -4.0))) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 95.4%
associate--l+95.4%
fma-define96.2%
associate-/l*96.5%
fma-neg97.3%
distribute-neg-frac297.3%
metadata-eval97.3%
Simplified97.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25))
(t_2 (- (* x y) t_1))
(t_3 (+ c (* t (* z 0.0625))))
(t_4 (+ c (* x y))))
(if (<= (* a b) -2e+186)
t_2
(if (<= (* a b) -1e+94)
t_3
(if (<= (* a b) -2e+72)
t_2
(if (<= (* a b) -200000.0)
t_3
(if (<= (* a b) -2e-277)
t_4
(if (<= (* a b) 5e-197)
t_3
(if (<= (* a b) 1e+140) t_4 (- (* (* z t) 0.0625) t_1))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = (x * y) - t_1;
double t_3 = c + (t * (z * 0.0625));
double t_4 = c + (x * y);
double tmp;
if ((a * b) <= -2e+186) {
tmp = t_2;
} else if ((a * b) <= -1e+94) {
tmp = t_3;
} else if ((a * b) <= -2e+72) {
tmp = t_2;
} else if ((a * b) <= -200000.0) {
tmp = t_3;
} else if ((a * b) <= -2e-277) {
tmp = t_4;
} else if ((a * b) <= 5e-197) {
tmp = t_3;
} else if ((a * b) <= 1e+140) {
tmp = t_4;
} else {
tmp = ((z * t) * 0.0625) - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = (x * y) - t_1
t_3 = c + (t * (z * 0.0625d0))
t_4 = c + (x * y)
if ((a * b) <= (-2d+186)) then
tmp = t_2
else if ((a * b) <= (-1d+94)) then
tmp = t_3
else if ((a * b) <= (-2d+72)) then
tmp = t_2
else if ((a * b) <= (-200000.0d0)) then
tmp = t_3
else if ((a * b) <= (-2d-277)) then
tmp = t_4
else if ((a * b) <= 5d-197) then
tmp = t_3
else if ((a * b) <= 1d+140) then
tmp = t_4
else
tmp = ((z * t) * 0.0625d0) - 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 c) {
double t_1 = (a * b) * 0.25;
double t_2 = (x * y) - t_1;
double t_3 = c + (t * (z * 0.0625));
double t_4 = c + (x * y);
double tmp;
if ((a * b) <= -2e+186) {
tmp = t_2;
} else if ((a * b) <= -1e+94) {
tmp = t_3;
} else if ((a * b) <= -2e+72) {
tmp = t_2;
} else if ((a * b) <= -200000.0) {
tmp = t_3;
} else if ((a * b) <= -2e-277) {
tmp = t_4;
} else if ((a * b) <= 5e-197) {
tmp = t_3;
} else if ((a * b) <= 1e+140) {
tmp = t_4;
} else {
tmp = ((z * t) * 0.0625) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = (x * y) - t_1 t_3 = c + (t * (z * 0.0625)) t_4 = c + (x * y) tmp = 0 if (a * b) <= -2e+186: tmp = t_2 elif (a * b) <= -1e+94: tmp = t_3 elif (a * b) <= -2e+72: tmp = t_2 elif (a * b) <= -200000.0: tmp = t_3 elif (a * b) <= -2e-277: tmp = t_4 elif (a * b) <= 5e-197: tmp = t_3 elif (a * b) <= 1e+140: tmp = t_4 else: tmp = ((z * t) * 0.0625) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(Float64(x * y) - t_1) t_3 = Float64(c + Float64(t * Float64(z * 0.0625))) t_4 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(a * b) <= -2e+186) tmp = t_2; elseif (Float64(a * b) <= -1e+94) tmp = t_3; elseif (Float64(a * b) <= -2e+72) tmp = t_2; elseif (Float64(a * b) <= -200000.0) tmp = t_3; elseif (Float64(a * b) <= -2e-277) tmp = t_4; elseif (Float64(a * b) <= 5e-197) tmp = t_3; elseif (Float64(a * b) <= 1e+140) tmp = t_4; else tmp = Float64(Float64(Float64(z * t) * 0.0625) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = (x * y) - t_1; t_3 = c + (t * (z * 0.0625)); t_4 = c + (x * y); tmp = 0.0; if ((a * b) <= -2e+186) tmp = t_2; elseif ((a * b) <= -1e+94) tmp = t_3; elseif ((a * b) <= -2e+72) tmp = t_2; elseif ((a * b) <= -200000.0) tmp = t_3; elseif ((a * b) <= -2e-277) tmp = t_4; elseif ((a * b) <= 5e-197) tmp = t_3; elseif ((a * b) <= 1e+140) tmp = t_4; else tmp = ((z * t) * 0.0625) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+186], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -1e+94], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], -2e+72], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -200000.0], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], -2e-277], t$95$4, If[LessEqual[N[(a * b), $MachinePrecision], 5e-197], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 1e+140], t$95$4, N[(N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := x \cdot y - t\_1\\
t_3 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_4 := c + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+186}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{+94}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+72}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -200000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-277}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-197}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq 10^{+140}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t\right) \cdot 0.0625 - t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.99999999999999996e186 or -1e94 < (*.f64 a b) < -1.99999999999999989e72Initial program 86.7%
Taylor expanded in z around 0 87.3%
Taylor expanded in c around 0 83.2%
if -1.99999999999999996e186 < (*.f64 a b) < -1e94 or -1.99999999999999989e72 < (*.f64 a b) < -2e5 or -1.99999999999999994e-277 < (*.f64 a b) < 5.0000000000000002e-197Initial program 98.6%
Taylor expanded in z around inf 76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*r*76.3%
Simplified76.3%
if -2e5 < (*.f64 a b) < -1.99999999999999994e-277 or 5.0000000000000002e-197 < (*.f64 a b) < 1.00000000000000006e140Initial program 97.2%
Taylor expanded in x around inf 70.7%
if 1.00000000000000006e140 < (*.f64 a b) Initial program 95.1%
Taylor expanded in x around 0 95.3%
Taylor expanded in c around 0 90.9%
Final simplification77.6%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (+ c (* t (* z 0.0625))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = c + (t * (z * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(t * Float64(z * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = c + (t * (z * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 99.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in z around inf 46.1%
associate-*r*46.1%
*-commutative46.1%
associate-*r*46.1%
Simplified46.1%
Final simplification97.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -0.0205)
t_2
(if (<= (* x y) 7e-161)
t_1
(if (<= (* x y) 6e-112)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 6.3e+100) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -0.0205) {
tmp = t_2;
} else if ((x * y) <= 7e-161) {
tmp = t_1;
} else if ((x * y) <= 6e-112) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 6.3e+100) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (t * (z * 0.0625d0))
t_2 = c + (x * y)
if ((x * y) <= (-0.0205d0)) then
tmp = t_2
else if ((x * y) <= 7d-161) then
tmp = t_1
else if ((x * y) <= 6d-112) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 6.3d+100) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -0.0205) {
tmp = t_2;
} else if ((x * y) <= 7e-161) {
tmp = t_1;
} else if ((x * y) <= 6e-112) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 6.3e+100) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -0.0205: tmp = t_2 elif (x * y) <= 7e-161: tmp = t_1 elif (x * y) <= 6e-112: tmp = c + (a * (b * -0.25)) elif (x * y) <= 6.3e+100: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -0.0205) tmp = t_2; elseif (Float64(x * y) <= 7e-161) tmp = t_1; elseif (Float64(x * y) <= 6e-112) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 6.3e+100) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (t * (z * 0.0625)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -0.0205) tmp = t_2; elseif ((x * y) <= 7e-161) tmp = t_1; elseif ((x * y) <= 6e-112) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 6.3e+100) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -0.0205], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 7e-161], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 6e-112], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.3e+100], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -0.0205:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 7 \cdot 10^{-161}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{-112}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 6.3 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -0.0205000000000000009 or 6.3000000000000004e100 < (*.f64 x y) Initial program 94.3%
Taylor expanded in x around inf 71.0%
if -0.0205000000000000009 < (*.f64 x y) < 7.00000000000000039e-161 or 6.0000000000000002e-112 < (*.f64 x y) < 6.3000000000000004e100Initial program 95.7%
Taylor expanded in z around inf 65.0%
associate-*r*65.7%
*-commutative65.7%
associate-*r*65.7%
Simplified65.7%
if 7.00000000000000039e-161 < (*.f64 x y) < 6.0000000000000002e-112Initial program 100.0%
Taylor expanded in a around inf 85.3%
*-commutative85.3%
associate-*r*85.3%
Simplified85.3%
Final simplification68.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -5e-51)
t_2
(if (<= (* x y) 5e-99)
t_1
(if (<= (* x y) 4.1e-72)
(* t (* z 0.0625))
(if (<= (* x y) 6.8e+139) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -5e-51) {
tmp = t_2;
} else if ((x * y) <= 5e-99) {
tmp = t_1;
} else if ((x * y) <= 4.1e-72) {
tmp = t * (z * 0.0625);
} else if ((x * y) <= 6.8e+139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
t_2 = c + (x * y)
if ((x * y) <= (-5d-51)) then
tmp = t_2
else if ((x * y) <= 5d-99) then
tmp = t_1
else if ((x * y) <= 4.1d-72) then
tmp = t * (z * 0.0625d0)
else if ((x * y) <= 6.8d+139) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -5e-51) {
tmp = t_2;
} else if ((x * y) <= 5e-99) {
tmp = t_1;
} else if ((x * y) <= 4.1e-72) {
tmp = t * (z * 0.0625);
} else if ((x * y) <= 6.8e+139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -5e-51: tmp = t_2 elif (x * y) <= 5e-99: tmp = t_1 elif (x * y) <= 4.1e-72: tmp = t * (z * 0.0625) elif (x * y) <= 6.8e+139: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -5e-51) tmp = t_2; elseif (Float64(x * y) <= 5e-99) tmp = t_1; elseif (Float64(x * y) <= 4.1e-72) tmp = Float64(t * Float64(z * 0.0625)); elseif (Float64(x * y) <= 6.8e+139) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (a * (b * -0.25)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -5e-51) tmp = t_2; elseif ((x * y) <= 5e-99) tmp = t_1; elseif ((x * y) <= 4.1e-72) tmp = t * (z * 0.0625); elseif ((x * y) <= 6.8e+139) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e-51], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5e-99], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.1e-72], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.8e+139], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-51}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{-72}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 6.8 \cdot 10^{+139}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000004e-51 or 6.8000000000000005e139 < (*.f64 x y) Initial program 93.7%
Taylor expanded in x around inf 69.6%
if -5.00000000000000004e-51 < (*.f64 x y) < 4.99999999999999969e-99 or 4.10000000000000003e-72 < (*.f64 x y) < 6.8000000000000005e139Initial program 97.2%
Taylor expanded in a around inf 61.0%
*-commutative61.0%
associate-*r*61.0%
Simplified61.0%
if 4.99999999999999969e-99 < (*.f64 x y) < 4.10000000000000003e-72Initial program 83.3%
Taylor expanded in b around inf 52.8%
Taylor expanded in t around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r*100.0%
Simplified100.0%
Final simplification65.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* b (* a -0.25))) (t_3 (* t (* z 0.0625))))
(if (<= t -9.2e+73)
t_3
(if (<= t 7.2e-230)
t_1
(if (<= t 6.2e-172)
t_2
(if (<= t 3.1e+81) t_1 (if (<= t 2e+114) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = b * (a * -0.25);
double t_3 = t * (z * 0.0625);
double tmp;
if (t <= -9.2e+73) {
tmp = t_3;
} else if (t <= 7.2e-230) {
tmp = t_1;
} else if (t <= 6.2e-172) {
tmp = t_2;
} else if (t <= 3.1e+81) {
tmp = t_1;
} else if (t <= 2e+114) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c + (x * y)
t_2 = b * (a * (-0.25d0))
t_3 = t * (z * 0.0625d0)
if (t <= (-9.2d+73)) then
tmp = t_3
else if (t <= 7.2d-230) then
tmp = t_1
else if (t <= 6.2d-172) then
tmp = t_2
else if (t <= 3.1d+81) then
tmp = t_1
else if (t <= 2d+114) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = b * (a * -0.25);
double t_3 = t * (z * 0.0625);
double tmp;
if (t <= -9.2e+73) {
tmp = t_3;
} else if (t <= 7.2e-230) {
tmp = t_1;
} else if (t <= 6.2e-172) {
tmp = t_2;
} else if (t <= 3.1e+81) {
tmp = t_1;
} else if (t <= 2e+114) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = b * (a * -0.25) t_3 = t * (z * 0.0625) tmp = 0 if t <= -9.2e+73: tmp = t_3 elif t <= 7.2e-230: tmp = t_1 elif t <= 6.2e-172: tmp = t_2 elif t <= 3.1e+81: tmp = t_1 elif t <= 2e+114: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(b * Float64(a * -0.25)) t_3 = Float64(t * Float64(z * 0.0625)) tmp = 0.0 if (t <= -9.2e+73) tmp = t_3; elseif (t <= 7.2e-230) tmp = t_1; elseif (t <= 6.2e-172) tmp = t_2; elseif (t <= 3.1e+81) tmp = t_1; elseif (t <= 2e+114) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = b * (a * -0.25); t_3 = t * (z * 0.0625); tmp = 0.0; if (t <= -9.2e+73) tmp = t_3; elseif (t <= 7.2e-230) tmp = t_1; elseif (t <= 6.2e-172) tmp = t_2; elseif (t <= 3.1e+81) tmp = t_1; elseif (t <= 2e+114) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.2e+73], t$95$3, If[LessEqual[t, 7.2e-230], t$95$1, If[LessEqual[t, 6.2e-172], t$95$2, If[LessEqual[t, 3.1e+81], t$95$1, If[LessEqual[t, 2e+114], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := b \cdot \left(a \cdot -0.25\right)\\
t_3 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+73}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-230}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-172}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if t < -9.199999999999999e73 or 2e114 < t Initial program 89.4%
Taylor expanded in b around inf 80.2%
Taylor expanded in t around inf 58.2%
associate-*r*59.1%
*-commutative59.1%
associate-*r*59.1%
Simplified59.1%
if -9.199999999999999e73 < t < 7.1999999999999997e-230 or 6.2000000000000005e-172 < t < 3.1e81Initial program 99.3%
Taylor expanded in x around inf 60.3%
if 7.1999999999999997e-230 < t < 6.2000000000000005e-172 or 3.1e81 < t < 2e114Initial program 93.3%
Taylor expanded in b around inf 93.3%
Taylor expanded in b around inf 66.8%
associate-*r*66.8%
*-commutative66.8%
Simplified66.8%
Final simplification60.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))) (t_2 (* t (* z 0.0625))))
(if (<= t -5.2e-75)
t_2
(if (<= t 5.5e-230)
(* x y)
(if (<= t 1e-160)
t_1
(if (<= t 1.3e+82) (* x y) (if (<= t 4.2e+117) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b * (a * -0.25);
double t_2 = t * (z * 0.0625);
double tmp;
if (t <= -5.2e-75) {
tmp = t_2;
} else if (t <= 5.5e-230) {
tmp = x * y;
} else if (t <= 1e-160) {
tmp = t_1;
} else if (t <= 1.3e+82) {
tmp = x * y;
} else if (t <= 4.2e+117) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = b * (a * (-0.25d0))
t_2 = t * (z * 0.0625d0)
if (t <= (-5.2d-75)) then
tmp = t_2
else if (t <= 5.5d-230) then
tmp = x * y
else if (t <= 1d-160) then
tmp = t_1
else if (t <= 1.3d+82) then
tmp = x * y
else if (t <= 4.2d+117) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b * (a * -0.25);
double t_2 = t * (z * 0.0625);
double tmp;
if (t <= -5.2e-75) {
tmp = t_2;
} else if (t <= 5.5e-230) {
tmp = x * y;
} else if (t <= 1e-160) {
tmp = t_1;
} else if (t <= 1.3e+82) {
tmp = x * y;
} else if (t <= 4.2e+117) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b * (a * -0.25) t_2 = t * (z * 0.0625) tmp = 0 if t <= -5.2e-75: tmp = t_2 elif t <= 5.5e-230: tmp = x * y elif t <= 1e-160: tmp = t_1 elif t <= 1.3e+82: tmp = x * y elif t <= 4.2e+117: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b * Float64(a * -0.25)) t_2 = Float64(t * Float64(z * 0.0625)) tmp = 0.0 if (t <= -5.2e-75) tmp = t_2; elseif (t <= 5.5e-230) tmp = Float64(x * y); elseif (t <= 1e-160) tmp = t_1; elseif (t <= 1.3e+82) tmp = Float64(x * y); elseif (t <= 4.2e+117) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b * (a * -0.25); t_2 = t * (z * 0.0625); tmp = 0.0; if (t <= -5.2e-75) tmp = t_2; elseif (t <= 5.5e-230) tmp = x * y; elseif (t <= 1e-160) tmp = t_1; elseif (t <= 1.3e+82) tmp = x * y; elseif (t <= 4.2e+117) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.2e-75], t$95$2, If[LessEqual[t, 5.5e-230], N[(x * y), $MachinePrecision], If[LessEqual[t, 1e-160], t$95$1, If[LessEqual[t, 1.3e+82], N[(x * y), $MachinePrecision], If[LessEqual[t, 4.2e+117], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
t_2 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{-75}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-230}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t \leq 10^{-160}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+82}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+117}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -5.2e-75 or 4.2000000000000002e117 < t Initial program 92.2%
Taylor expanded in b around inf 79.7%
Taylor expanded in t around inf 50.4%
associate-*r*51.0%
*-commutative51.0%
associate-*r*51.0%
Simplified51.0%
if -5.2e-75 < t < 5.4999999999999997e-230 or 9.9999999999999999e-161 < t < 1.2999999999999999e82Initial program 99.1%
Taylor expanded in b around inf 77.7%
Taylor expanded in x around inf 43.5%
if 5.4999999999999997e-230 < t < 9.9999999999999999e-161 or 1.2999999999999999e82 < t < 4.2000000000000002e117Initial program 93.3%
Taylor expanded in b around inf 93.3%
Taylor expanded in b around inf 66.8%
associate-*r*66.8%
*-commutative66.8%
Simplified66.8%
Final simplification48.6%
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= z -3.3e+134)
(and (not (<= z -2.2e+63)) (or (<= z -1100.0) (not (<= z 2.3e-102)))))
(+ c (* t (* z 0.0625)))
(- (* x y) (* (* a b) 0.25))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -3.3e+134) || (!(z <= -2.2e+63) && ((z <= -1100.0) || !(z <= 2.3e-102)))) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((z <= (-3.3d+134)) .or. (.not. (z <= (-2.2d+63))) .and. (z <= (-1100.0d0)) .or. (.not. (z <= 2.3d-102))) then
tmp = c + (t * (z * 0.0625d0))
else
tmp = (x * y) - ((a * b) * 0.25d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -3.3e+134) || (!(z <= -2.2e+63) && ((z <= -1100.0) || !(z <= 2.3e-102)))) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -3.3e+134) or (not (z <= -2.2e+63) and ((z <= -1100.0) or not (z <= 2.3e-102))): tmp = c + (t * (z * 0.0625)) else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -3.3e+134) || (!(z <= -2.2e+63) && ((z <= -1100.0) || !(z <= 2.3e-102)))) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); else tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((z <= -3.3e+134) || (~((z <= -2.2e+63)) && ((z <= -1100.0) || ~((z <= 2.3e-102))))) tmp = c + (t * (z * 0.0625)); else tmp = (x * y) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -3.3e+134], And[N[Not[LessEqual[z, -2.2e+63]], $MachinePrecision], Or[LessEqual[z, -1100.0], N[Not[LessEqual[z, 2.3e-102]], $MachinePrecision]]]], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+134} \lor \neg \left(z \leq -2.2 \cdot 10^{+63}\right) \land \left(z \leq -1100 \lor \neg \left(z \leq 2.3 \cdot 10^{-102}\right)\right):\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if z < -3.3e134 or -2.1999999999999999e63 < z < -1100 or 2.29999999999999987e-102 < z Initial program 93.7%
Taylor expanded in z around inf 65.3%
associate-*r*65.9%
*-commutative65.9%
associate-*r*65.9%
Simplified65.9%
if -3.3e134 < z < -2.1999999999999999e63 or -1100 < z < 2.29999999999999987e-102Initial program 97.4%
Taylor expanded in z around 0 89.1%
Taylor expanded in c around 0 70.7%
Final simplification68.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)))
(if (or (<= (* x y) -0.0205) (not (<= (* x y) 2.6e+109)))
(- (+ c (* x y)) t_1)
(- (+ c (* (* z t) 0.0625)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double tmp;
if (((x * y) <= -0.0205) || !((x * y) <= 2.6e+109)) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + ((z * t) * 0.0625)) - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) * 0.25d0
if (((x * y) <= (-0.0205d0)) .or. (.not. ((x * y) <= 2.6d+109))) then
tmp = (c + (x * y)) - t_1
else
tmp = (c + ((z * t) * 0.0625d0)) - 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 c) {
double t_1 = (a * b) * 0.25;
double tmp;
if (((x * y) <= -0.0205) || !((x * y) <= 2.6e+109)) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + ((z * t) * 0.0625)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 tmp = 0 if ((x * y) <= -0.0205) or not ((x * y) <= 2.6e+109): tmp = (c + (x * y)) - t_1 else: tmp = (c + ((z * t) * 0.0625)) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) tmp = 0.0 if ((Float64(x * y) <= -0.0205) || !(Float64(x * y) <= 2.6e+109)) tmp = Float64(Float64(c + Float64(x * y)) - t_1); else tmp = Float64(Float64(c + Float64(Float64(z * t) * 0.0625)) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; tmp = 0.0; if (((x * y) <= -0.0205) || ~(((x * y) <= 2.6e+109))) tmp = (c + (x * y)) - t_1; else tmp = (c + ((z * t) * 0.0625)) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -0.0205], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.6e+109]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(c + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -0.0205 \lor \neg \left(x \cdot y \leq 2.6 \cdot 10^{+109}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(c + \left(z \cdot t\right) \cdot 0.0625\right) - t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -0.0205000000000000009 or 2.5999999999999998e109 < (*.f64 x y) Initial program 94.3%
Taylor expanded in z around 0 84.7%
if -0.0205000000000000009 < (*.f64 x y) < 2.5999999999999998e109Initial program 96.1%
Taylor expanded in x around 0 91.5%
Final simplification88.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -1e+59)
(* x y)
(if (<= (* x y) -2.9e-24)
c
(if (<= (* x y) 3.1e+130) (* b (* a -0.25)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -1e+59) {
tmp = x * y;
} else if ((x * y) <= -2.9e-24) {
tmp = c;
} else if ((x * y) <= 3.1e+130) {
tmp = b * (a * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((x * y) <= (-1d+59)) then
tmp = x * y
else if ((x * y) <= (-2.9d-24)) then
tmp = c
else if ((x * y) <= 3.1d+130) then
tmp = b * (a * (-0.25d0))
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -1e+59) {
tmp = x * y;
} else if ((x * y) <= -2.9e-24) {
tmp = c;
} else if ((x * y) <= 3.1e+130) {
tmp = b * (a * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -1e+59: tmp = x * y elif (x * y) <= -2.9e-24: tmp = c elif (x * y) <= 3.1e+130: tmp = b * (a * -0.25) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -1e+59) tmp = Float64(x * y); elseif (Float64(x * y) <= -2.9e-24) tmp = c; elseif (Float64(x * y) <= 3.1e+130) tmp = Float64(b * Float64(a * -0.25)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -1e+59) tmp = x * y; elseif ((x * y) <= -2.9e-24) tmp = c; elseif ((x * y) <= 3.1e+130) tmp = b * (a * -0.25); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+59], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.9e-24], c, If[LessEqual[N[(x * y), $MachinePrecision], 3.1e+130], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+59}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -2.9 \cdot 10^{-24}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 3.1 \cdot 10^{+130}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999972e58 or 3.1e130 < (*.f64 x y) Initial program 93.1%
Taylor expanded in b around inf 77.9%
Taylor expanded in x around inf 69.9%
if -9.99999999999999972e58 < (*.f64 x y) < -2.8999999999999999e-24Initial program 100.0%
Taylor expanded in c around inf 45.7%
if -2.8999999999999999e-24 < (*.f64 x y) < 3.1e130Initial program 96.1%
Taylor expanded in b around inf 80.2%
Taylor expanded in b around inf 33.3%
associate-*r*33.3%
*-commutative33.3%
Simplified33.3%
Final simplification46.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)))
(if (<= z -3.3e+134)
(+ c (* t (* z 0.0625)))
(if (<= z 1.38e-74) (- (+ c (* x y)) t_1) (- (* (* z t) 0.0625) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double tmp;
if (z <= -3.3e+134) {
tmp = c + (t * (z * 0.0625));
} else if (z <= 1.38e-74) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = ((z * t) * 0.0625) - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) * 0.25d0
if (z <= (-3.3d+134)) then
tmp = c + (t * (z * 0.0625d0))
else if (z <= 1.38d-74) then
tmp = (c + (x * y)) - t_1
else
tmp = ((z * t) * 0.0625d0) - 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 c) {
double t_1 = (a * b) * 0.25;
double tmp;
if (z <= -3.3e+134) {
tmp = c + (t * (z * 0.0625));
} else if (z <= 1.38e-74) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = ((z * t) * 0.0625) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 tmp = 0 if z <= -3.3e+134: tmp = c + (t * (z * 0.0625)) elif z <= 1.38e-74: tmp = (c + (x * y)) - t_1 else: tmp = ((z * t) * 0.0625) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) tmp = 0.0 if (z <= -3.3e+134) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (z <= 1.38e-74) tmp = Float64(Float64(c + Float64(x * y)) - t_1); else tmp = Float64(Float64(Float64(z * t) * 0.0625) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; tmp = 0.0; if (z <= -3.3e+134) tmp = c + (t * (z * 0.0625)); elseif (z <= 1.38e-74) tmp = (c + (x * y)) - t_1; else tmp = ((z * t) * 0.0625) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[z, -3.3e+134], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.38e-74], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+134}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;z \leq 1.38 \cdot 10^{-74}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t\right) \cdot 0.0625 - t\_1\\
\end{array}
\end{array}
if z < -3.3e134Initial program 97.1%
Taylor expanded in z around inf 72.4%
associate-*r*72.4%
*-commutative72.4%
associate-*r*72.4%
Simplified72.4%
if -3.3e134 < z < 1.38e-74Initial program 97.7%
Taylor expanded in z around 0 87.8%
if 1.38e-74 < z Initial program 91.2%
Taylor expanded in x around 0 83.1%
Taylor expanded in c around 0 67.2%
Final simplification78.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -9.6e+58) (not (<= (* x y) 2.8e+57))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -9.6e+58) || !((x * y) <= 2.8e+57)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-9.6d+58)) .or. (.not. ((x * y) <= 2.8d+57))) then
tmp = x * y
else
tmp = c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -9.6e+58) || !((x * y) <= 2.8e+57)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -9.6e+58) or not ((x * y) <= 2.8e+57): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -9.6e+58) || !(Float64(x * y) <= 2.8e+57)) tmp = Float64(x * y); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -9.6e+58) || ~(((x * y) <= 2.8e+57))) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -9.6e+58], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.8e+57]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.6 \cdot 10^{+58} \lor \neg \left(x \cdot y \leq 2.8 \cdot 10^{+57}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -9.5999999999999999e58 or 2.8e57 < (*.f64 x y) Initial program 93.4%
Taylor expanded in b around inf 79.8%
Taylor expanded in x around inf 62.4%
if -9.5999999999999999e58 < (*.f64 x y) < 2.8e57Initial program 96.7%
Taylor expanded in c around inf 30.0%
Final simplification43.2%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 95.4%
Taylor expanded in c around inf 19.8%
herbie shell --seed 2024089
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))