
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* z t) (* x y))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* -2.0 (* c (* c (+ (* b i) (/ (* a i) c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (z * t) + (x * y);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (c * ((b * i) + ((a * i) / c))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (z * t) + (x * y);
double tmp;
if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (c * ((b * i) + ((a * i) / c))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (z * t) + (x * y) tmp = 0 if (t_2 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = -2.0 * (c * (c * ((b * i) + ((a * i) / c)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(z * t) + Float64(x * y)) tmp = 0.0 if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(Float64(b * i) + Float64(Float64(a * i) / c))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (z * t) + (x * y); tmp = 0.0; if ((t_2 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = -2.0 * (c * (c * ((b * i) + ((a * i) / c)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(c * N[(N[(b * i), $MachinePrecision] + N[(N[(a * i), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := z \cdot t + x \cdot y\\
\mathbf{if}\;t\_2 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 93.8%
fma-define93.8%
associate-*l*99.5%
Simplified99.5%
fma-define99.5%
+-commutative99.5%
Applied egg-rr99.5%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
fma-define9.1%
*-commutative9.1%
associate-*l*27.3%
+-commutative27.3%
fma-define27.3%
Simplified27.3%
Taylor expanded in i around inf 54.7%
Taylor expanded in c around inf 54.8%
Final simplification97.6%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (fma x y (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 89.8%
fma-define90.2%
associate-*l*96.4%
Simplified96.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -5e-58) (not (<= (* z t) 4e-76))) (* 2.0 (- (+ (* z t) (* x y)) (* (* b c) (* c i)))) (* 2.0 (- (* x y) (* (+ a (* b c)) (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -5e-58) || !((z * t) <= 4e-76)) {
tmp = 2.0 * (((z * t) + (x * y)) - ((b * c) * (c * i)));
} else {
tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if (((z * t) <= (-5d-58)) .or. (.not. ((z * t) <= 4d-76))) then
tmp = 2.0d0 * (((z * t) + (x * y)) - ((b * c) * (c * i)))
else
tmp = 2.0d0 * ((x * y) - ((a + (b * c)) * (c * i)))
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 i) {
double tmp;
if (((z * t) <= -5e-58) || !((z * t) <= 4e-76)) {
tmp = 2.0 * (((z * t) + (x * y)) - ((b * c) * (c * i)));
} else {
tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((z * t) <= -5e-58) or not ((z * t) <= 4e-76): tmp = 2.0 * (((z * t) + (x * y)) - ((b * c) * (c * i))) else: tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(z * t) <= -5e-58) || !(Float64(z * t) <= 4e-76)) tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(Float64(b * c) * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((z * t) <= -5e-58) || ~(((z * t) <= 4e-76))) tmp = 2.0 * (((z * t) + (x * y)) - ((b * c) * (c * i))); else tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -5e-58], N[Not[LessEqual[N[(z * t), $MachinePrecision], 4e-76]], $MachinePrecision]], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{-58} \lor \neg \left(z \cdot t \leq 4 \cdot 10^{-76}\right):\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -4.99999999999999977e-58 or 3.99999999999999971e-76 < (*.f64 z t) Initial program 89.0%
fma-define89.6%
associate-*l*95.3%
Simplified95.3%
fma-define94.6%
+-commutative94.6%
Applied egg-rr94.6%
Taylor expanded in a around 0 89.2%
if -4.99999999999999977e-58 < (*.f64 z t) < 3.99999999999999971e-76Initial program 90.9%
fma-define90.9%
associate-*l*98.0%
Simplified98.0%
fma-define98.0%
+-commutative98.0%
Applied egg-rr98.0%
Taylor expanded in z around inf 81.2%
Taylor expanded in z around 0 98.0%
Final simplification92.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -5e-58) (not (<= (* z t) 4e-76))) (* 2.0 (+ (* z t) (- (* x y) (* b (* c (* c i)))))) (* 2.0 (- (* x y) (* (+ a (* b c)) (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -5e-58) || !((z * t) <= 4e-76)) {
tmp = 2.0 * ((z * t) + ((x * y) - (b * (c * (c * i)))));
} else {
tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if (((z * t) <= (-5d-58)) .or. (.not. ((z * t) <= 4d-76))) then
tmp = 2.0d0 * ((z * t) + ((x * y) - (b * (c * (c * i)))))
else
tmp = 2.0d0 * ((x * y) - ((a + (b * c)) * (c * i)))
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 i) {
double tmp;
if (((z * t) <= -5e-58) || !((z * t) <= 4e-76)) {
tmp = 2.0 * ((z * t) + ((x * y) - (b * (c * (c * i)))));
} else {
tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((z * t) <= -5e-58) or not ((z * t) <= 4e-76): tmp = 2.0 * ((z * t) + ((x * y) - (b * (c * (c * i))))) else: tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(z * t) <= -5e-58) || !(Float64(z * t) <= 4e-76)) tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(Float64(x * y) - Float64(b * Float64(c * Float64(c * i)))))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((z * t) <= -5e-58) || ~(((z * t) <= 4e-76))) tmp = 2.0 * ((z * t) + ((x * y) - (b * (c * (c * i))))); else tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -5e-58], N[Not[LessEqual[N[(z * t), $MachinePrecision], 4e-76]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] - N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{-58} \lor \neg \left(z \cdot t \leq 4 \cdot 10^{-76}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t + \left(x \cdot y - b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -4.99999999999999977e-58 or 3.99999999999999971e-76 < (*.f64 z t) Initial program 89.0%
fma-define89.6%
associate-*l*95.3%
Simplified95.3%
fma-define94.6%
+-commutative94.6%
Applied egg-rr94.6%
Taylor expanded in a around 0 89.2%
associate--l+89.2%
associate-*l*86.6%
Applied egg-rr86.6%
if -4.99999999999999977e-58 < (*.f64 z t) < 3.99999999999999971e-76Initial program 90.9%
fma-define90.9%
associate-*l*98.0%
Simplified98.0%
fma-define98.0%
+-commutative98.0%
Applied egg-rr98.0%
Taylor expanded in z around inf 81.2%
Taylor expanded in z around 0 98.0%
Final simplification91.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* x y))) (t_2 (* c (+ a (* b c)))))
(if (<= t_2 1e+261)
(* 2.0 (- t_1 (* i t_2)))
(* 2.0 (- t_1 (* (* b c) (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (x * y);
double t_2 = c * (a + (b * c));
double tmp;
if (t_2 <= 1e+261) {
tmp = 2.0 * (t_1 - (i * t_2));
} else {
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * t) + (x * y)
t_2 = c * (a + (b * c))
if (t_2 <= 1d+261) then
tmp = 2.0d0 * (t_1 - (i * t_2))
else
tmp = 2.0d0 * (t_1 - ((b * c) * (c * i)))
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 i) {
double t_1 = (z * t) + (x * y);
double t_2 = c * (a + (b * c));
double tmp;
if (t_2 <= 1e+261) {
tmp = 2.0 * (t_1 - (i * t_2));
} else {
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (z * t) + (x * y) t_2 = c * (a + (b * c)) tmp = 0 if t_2 <= 1e+261: tmp = 2.0 * (t_1 - (i * t_2)) else: tmp = 2.0 * (t_1 - ((b * c) * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z * t) + Float64(x * y)) t_2 = Float64(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_2 <= 1e+261) tmp = Float64(2.0 * Float64(t_1 - Float64(i * t_2))); else tmp = Float64(2.0 * Float64(t_1 - Float64(Float64(b * c) * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (z * t) + (x * y); t_2 = c * (a + (b * c)); tmp = 0.0; if (t_2 <= 1e+261) tmp = 2.0 * (t_1 - (i * t_2)); else tmp = 2.0 * (t_1 - ((b * c) * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 1e+261], N[(2.0 * N[(t$95$1 - N[(i * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t + x \cdot y\\
t_2 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_2 \leq 10^{+261}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < 9.9999999999999993e260Initial program 95.4%
if 9.9999999999999993e260 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 58.6%
fma-define61.2%
associate-*l*94.8%
Simplified94.8%
fma-define92.2%
+-commutative92.2%
Applied egg-rr92.2%
Taylor expanded in a around 0 89.9%
Final simplification94.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3300000000000.0) (not (<= c 1.3e+15))) (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* z t) (* x y)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3300000000000.0) || !(c <= 1.3e+15)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if ((c <= (-3300000000000.0d0)) .or. (.not. (c <= 1.3d+15))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((z * t) + (x * y)) - (i * (a * 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 i) {
double tmp;
if ((c <= -3300000000000.0) || !(c <= 1.3e+15)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3300000000000.0) or not (c <= 1.3e+15): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3300000000000.0) || !(c <= 1.3e+15)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3300000000000.0) || ~((c <= 1.3e+15))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3300000000000.0], N[Not[LessEqual[c, 1.3e+15]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3300000000000 \lor \neg \left(c \leq 1.3 \cdot 10^{+15}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -3.3e12 or 1.3e15 < c Initial program 77.6%
Taylor expanded in z around 0 84.9%
if -3.3e12 < c < 1.3e15Initial program 99.2%
Taylor expanded in a around inf 93.2%
*-commutative93.2%
Simplified93.2%
Final simplification89.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -6.9e-16) (not (<= c 7.3e-124))) (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i)))) (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -6.9e-16) || !(c <= 7.3e-124)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if ((c <= (-6.9d-16)) .or. (.not. (c <= 7.3d-124))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * ((z * t) + (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 i) {
double tmp;
if ((c <= -6.9e-16) || !(c <= 7.3e-124)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -6.9e-16) or not (c <= 7.3e-124): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -6.9e-16) || !(c <= 7.3e-124)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -6.9e-16) || ~((c <= 7.3e-124))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -6.9e-16], N[Not[LessEqual[c, 7.3e-124]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -6.9 \cdot 10^{-16} \lor \neg \left(c \leq 7.3 \cdot 10^{-124}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -6.8999999999999997e-16 or 7.3e-124 < c Initial program 82.9%
Taylor expanded in z around 0 82.3%
if -6.8999999999999997e-16 < c < 7.3e-124Initial program 99.0%
Taylor expanded in c around 0 82.7%
Final simplification82.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= z -2.5e+117)
(* z (* 2.0 (+ t (* x (/ y z)))))
(if (<= z 5.1e-109)
(* 2.0 (- (* x y) (* (+ a (* b c)) (* c i))))
(* 2.0 (+ (* z t) (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.5e+117) {
tmp = z * (2.0 * (t + (x * (y / z))));
} else if (z <= 5.1e-109) {
tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i)));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if (z <= (-2.5d+117)) then
tmp = z * (2.0d0 * (t + (x * (y / z))))
else if (z <= 5.1d-109) then
tmp = 2.0d0 * ((x * y) - ((a + (b * c)) * (c * i)))
else
tmp = 2.0d0 * ((z * t) + (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 i) {
double tmp;
if (z <= -2.5e+117) {
tmp = z * (2.0 * (t + (x * (y / z))));
} else if (z <= 5.1e-109) {
tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i)));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.5e+117: tmp = z * (2.0 * (t + (x * (y / z)))) elif z <= 5.1e-109: tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i))) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.5e+117) tmp = Float64(z * Float64(2.0 * Float64(t + Float64(x * Float64(y / z))))); elseif (z <= 5.1e-109) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -2.5e+117) tmp = z * (2.0 * (t + (x * (y / z)))); elseif (z <= 5.1e-109) tmp = 2.0 * ((x * y) - ((a + (b * c)) * (c * i))); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.5e+117], N[(z * N[(2.0 * N[(t + N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.1e-109], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+117}:\\
\;\;\;\;z \cdot \left(2 \cdot \left(t + x \cdot \frac{y}{z}\right)\right)\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-109}:\\
\;\;\;\;2 \cdot \left(x \cdot y - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if z < -2.49999999999999992e117Initial program 85.6%
Taylor expanded in c around 0 71.2%
Taylor expanded in z around inf 77.1%
distribute-lft-out77.1%
associate-/l*79.9%
Simplified79.9%
if -2.49999999999999992e117 < z < 5.10000000000000041e-109Initial program 93.6%
fma-define93.6%
associate-*l*98.4%
Simplified98.4%
fma-define98.4%
+-commutative98.4%
Applied egg-rr98.4%
Taylor expanded in z around inf 84.2%
Taylor expanded in z around 0 85.2%
if 5.10000000000000041e-109 < z Initial program 85.5%
Taylor expanded in c around 0 66.2%
Final simplification78.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -5.5e+122) (not (<= c 1.35e+15))) (* 2.0 (- (* x y) (* c (* b (* c i))))) (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.5e+122) || !(c <= 1.35e+15)) {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if ((c <= (-5.5d+122)) .or. (.not. (c <= 1.35d+15))) then
tmp = 2.0d0 * ((x * y) - (c * (b * (c * i))))
else
tmp = 2.0d0 * ((z * t) + (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 i) {
double tmp;
if ((c <= -5.5e+122) || !(c <= 1.35e+15)) {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -5.5e+122) or not (c <= 1.35e+15): tmp = 2.0 * ((x * y) - (c * (b * (c * i)))) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -5.5e+122) || !(c <= 1.35e+15)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(b * Float64(c * i))))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -5.5e+122) || ~((c <= 1.35e+15))) tmp = 2.0 * ((x * y) - (c * (b * (c * i)))); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -5.5e+122], N[Not[LessEqual[c, 1.35e+15]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.5 \cdot 10^{+122} \lor \neg \left(c \leq 1.35 \cdot 10^{+15}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -5.4999999999999998e122 or 1.35e15 < c Initial program 76.6%
Taylor expanded in z around 0 87.9%
Taylor expanded in a around 0 82.6%
if -5.4999999999999998e122 < c < 1.35e15Initial program 97.0%
Taylor expanded in c around 0 75.2%
Final simplification77.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.95e+35) (not (<= c 1.5e+15))) (* -2.0 (* c (* (+ a (* b c)) i))) (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.95e+35) || !(c <= 1.5e+15)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if ((c <= (-2.95d+35)) .or. (.not. (c <= 1.5d+15))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = 2.0d0 * ((z * t) + (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 i) {
double tmp;
if ((c <= -2.95e+35) || !(c <= 1.5e+15)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.95e+35) or not (c <= 1.5e+15): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.95e+35) || !(c <= 1.5e+15)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.95e+35) || ~((c <= 1.5e+15))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.95e+35], N[Not[LessEqual[c, 1.5e+15]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.95 \cdot 10^{+35} \lor \neg \left(c \leq 1.5 \cdot 10^{+15}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -2.94999999999999993e35 or 1.5e15 < c Initial program 77.9%
associate--l+77.9%
*-commutative77.9%
associate--l+77.9%
associate--l+77.9%
*-commutative77.9%
associate--l+77.9%
fma-define78.8%
*-commutative78.8%
associate-*l*93.4%
+-commutative93.4%
fma-define93.4%
Simplified93.4%
Taylor expanded in i around inf 71.2%
if -2.94999999999999993e35 < c < 1.5e15Initial program 98.6%
Taylor expanded in c around 0 78.7%
Final simplification75.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (* 2.0 y))))
(if (<= y -1.46e-40)
t_1
(if (<= y 2.7e-121)
(* -2.0 (* c (* b (* c i))))
(if (<= y 1.35e+72) (* 2.0 (* z t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * (2.0 * y);
double tmp;
if (y <= -1.46e-40) {
tmp = t_1;
} else if (y <= 2.7e-121) {
tmp = -2.0 * (c * (b * (c * i)));
} else if (y <= 1.35e+72) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = x * (2.0d0 * y)
if (y <= (-1.46d-40)) then
tmp = t_1
else if (y <= 2.7d-121) then
tmp = (-2.0d0) * (c * (b * (c * i)))
else if (y <= 1.35d+72) then
tmp = 2.0d0 * (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * (2.0 * y);
double tmp;
if (y <= -1.46e-40) {
tmp = t_1;
} else if (y <= 2.7e-121) {
tmp = -2.0 * (c * (b * (c * i)));
} else if (y <= 1.35e+72) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x * (2.0 * y) tmp = 0 if y <= -1.46e-40: tmp = t_1 elif y <= 2.7e-121: tmp = -2.0 * (c * (b * (c * i))) elif y <= 1.35e+72: tmp = 2.0 * (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * Float64(2.0 * y)) tmp = 0.0 if (y <= -1.46e-40) tmp = t_1; elseif (y <= 2.7e-121) tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); elseif (y <= 1.35e+72) tmp = Float64(2.0 * Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x * (2.0 * y); tmp = 0.0; if (y <= -1.46e-40) tmp = t_1; elseif (y <= 2.7e-121) tmp = -2.0 * (c * (b * (c * i))); elseif (y <= 1.35e+72) tmp = 2.0 * (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.46e-40], t$95$1, If[LessEqual[y, 2.7e-121], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+72], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(2 \cdot y\right)\\
\mathbf{if}\;y \leq -1.46 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-121}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+72}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.46000000000000005e-40 or 1.35e72 < y Initial program 88.3%
associate--l+88.3%
*-commutative88.3%
associate--l+88.3%
associate--l+88.3%
*-commutative88.3%
associate--l+88.3%
fma-define89.1%
*-commutative89.1%
associate-*l*91.9%
+-commutative91.9%
fma-define91.9%
Simplified91.9%
Taylor expanded in x around inf 53.8%
*-commutative53.8%
associate-*l*53.8%
*-commutative53.8%
Simplified53.8%
if -1.46000000000000005e-40 < y < 2.7000000000000002e-121Initial program 93.1%
associate--l+93.1%
*-commutative93.1%
associate--l+93.1%
associate--l+93.1%
*-commutative93.1%
associate--l+93.1%
fma-define93.1%
*-commutative93.1%
associate-*l*97.5%
+-commutative97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in i around inf 59.8%
Taylor expanded in a around 0 42.2%
if 2.7000000000000002e-121 < y < 1.35e72Initial program 87.7%
Taylor expanded in z around inf 55.1%
Final simplification50.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.6e+131) (not (<= c 4.2e+85))) (* -2.0 (* c (* (* b c) i))) (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.6e+131) || !(c <= 4.2e+85)) {
tmp = -2.0 * (c * ((b * c) * i));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if ((c <= (-2.6d+131)) .or. (.not. (c <= 4.2d+85))) then
tmp = (-2.0d0) * (c * ((b * c) * i))
else
tmp = 2.0d0 * ((z * t) + (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 i) {
double tmp;
if ((c <= -2.6e+131) || !(c <= 4.2e+85)) {
tmp = -2.0 * (c * ((b * c) * i));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.6e+131) or not (c <= 4.2e+85): tmp = -2.0 * (c * ((b * c) * i)) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.6e+131) || !(c <= 4.2e+85)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.6e+131) || ~((c <= 4.2e+85))) tmp = -2.0 * (c * ((b * c) * i)); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.6e+131], N[Not[LessEqual[c, 4.2e+85]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.6 \cdot 10^{+131} \lor \neg \left(c \leq 4.2 \cdot 10^{+85}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -2.6e131 or 4.2000000000000002e85 < c Initial program 71.8%
associate--l+71.8%
*-commutative71.8%
associate--l+71.8%
associate--l+71.8%
*-commutative71.8%
associate--l+71.8%
fma-define73.2%
*-commutative73.2%
associate-*l*91.6%
+-commutative91.6%
fma-define91.6%
Simplified91.6%
Taylor expanded in i around inf 77.3%
Taylor expanded in a around 0 74.6%
if -2.6e131 < c < 4.2000000000000002e85Initial program 96.8%
Taylor expanded in c around 0 72.4%
Final simplification73.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -2.2e-52) (not (<= y 1.35e+72))) (* x (* 2.0 y)) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -2.2e-52) || !(y <= 1.35e+72)) {
tmp = x * (2.0 * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if ((y <= (-2.2d-52)) .or. (.not. (y <= 1.35d+72))) then
tmp = x * (2.0d0 * y)
else
tmp = 2.0d0 * (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 c, double i) {
double tmp;
if ((y <= -2.2e-52) || !(y <= 1.35e+72)) {
tmp = x * (2.0 * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -2.2e-52) or not (y <= 1.35e+72): tmp = x * (2.0 * y) else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -2.2e-52) || !(y <= 1.35e+72)) tmp = Float64(x * Float64(2.0 * y)); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((y <= -2.2e-52) || ~((y <= 1.35e+72))) tmp = x * (2.0 * y); else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -2.2e-52], N[Not[LessEqual[y, 1.35e+72]], $MachinePrecision]], N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-52} \lor \neg \left(y \leq 1.35 \cdot 10^{+72}\right):\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if y < -2.20000000000000009e-52 or 1.35e72 < y Initial program 88.1%
associate--l+88.1%
*-commutative88.1%
associate--l+88.1%
associate--l+88.1%
*-commutative88.1%
associate--l+88.1%
fma-define88.8%
*-commutative88.8%
associate-*l*92.2%
+-commutative92.2%
fma-define92.2%
Simplified92.2%
Taylor expanded in x around inf 52.4%
*-commutative52.4%
associate-*l*52.4%
*-commutative52.4%
Simplified52.4%
if -2.20000000000000009e-52 < y < 1.35e72Initial program 91.8%
Taylor expanded in z around inf 38.9%
Final simplification46.3%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 89.8%
Taylor expanded in z around inf 29.4%
Final simplification29.4%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024135
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))