
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * 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 * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot 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 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * 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 * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
(FPCore (x y z t a b c) :precision binary64 (/ (fma x (* 9.0 y) (fma z (* t (* -4.0 a)) b)) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, (9.0 * y), fma(z, (t * (-4.0 * a)), b)) / (z * c);
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, Float64(9.0 * y), fma(z, Float64(t * Float64(-4.0 * a)), b)) / Float64(z * c)) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(z * N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(z, t \cdot \left(-4 \cdot a\right), b\right)\right)}{z \cdot c}
\end{array}
Initial program 94.7%
Simplified96.1%
Final simplification96.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* -4.0 (* t a)) c)) (t_2 (* 9.0 (* (/ y c) (/ x z)))))
(if (<= x -5e+117)
t_2
(if (<= x -1.28e+72)
t_1
(if (<= x -1.2e+53)
t_2
(if (<= x -1.55e-37)
(/ (* b (/ 1.0 c)) z)
(if (<= x -2.2e-131)
t_1
(if (<= x 1.2e-29) (* b (/ 1.0 (* z c))) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (-4.0 * (t * a)) / c;
double t_2 = 9.0 * ((y / c) * (x / z));
double tmp;
if (x <= -5e+117) {
tmp = t_2;
} else if (x <= -1.28e+72) {
tmp = t_1;
} else if (x <= -1.2e+53) {
tmp = t_2;
} else if (x <= -1.55e-37) {
tmp = (b * (1.0 / c)) / z;
} else if (x <= -2.2e-131) {
tmp = t_1;
} else if (x <= 1.2e-29) {
tmp = b * (1.0 / (z * c));
} 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 = ((-4.0d0) * (t * a)) / c
t_2 = 9.0d0 * ((y / c) * (x / z))
if (x <= (-5d+117)) then
tmp = t_2
else if (x <= (-1.28d+72)) then
tmp = t_1
else if (x <= (-1.2d+53)) then
tmp = t_2
else if (x <= (-1.55d-37)) then
tmp = (b * (1.0d0 / c)) / z
else if (x <= (-2.2d-131)) then
tmp = t_1
else if (x <= 1.2d-29) then
tmp = b * (1.0d0 / (z * c))
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 = (-4.0 * (t * a)) / c;
double t_2 = 9.0 * ((y / c) * (x / z));
double tmp;
if (x <= -5e+117) {
tmp = t_2;
} else if (x <= -1.28e+72) {
tmp = t_1;
} else if (x <= -1.2e+53) {
tmp = t_2;
} else if (x <= -1.55e-37) {
tmp = (b * (1.0 / c)) / z;
} else if (x <= -2.2e-131) {
tmp = t_1;
} else if (x <= 1.2e-29) {
tmp = b * (1.0 / (z * c));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (-4.0 * (t * a)) / c t_2 = 9.0 * ((y / c) * (x / z)) tmp = 0 if x <= -5e+117: tmp = t_2 elif x <= -1.28e+72: tmp = t_1 elif x <= -1.2e+53: tmp = t_2 elif x <= -1.55e-37: tmp = (b * (1.0 / c)) / z elif x <= -2.2e-131: tmp = t_1 elif x <= 1.2e-29: tmp = b * (1.0 / (z * c)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(-4.0 * Float64(t * a)) / c) t_2 = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))) tmp = 0.0 if (x <= -5e+117) tmp = t_2; elseif (x <= -1.28e+72) tmp = t_1; elseif (x <= -1.2e+53) tmp = t_2; elseif (x <= -1.55e-37) tmp = Float64(Float64(b * Float64(1.0 / c)) / z); elseif (x <= -2.2e-131) tmp = t_1; elseif (x <= 1.2e-29) tmp = Float64(b * Float64(1.0 / Float64(z * c))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (-4.0 * (t * a)) / c; t_2 = 9.0 * ((y / c) * (x / z)); tmp = 0.0; if (x <= -5e+117) tmp = t_2; elseif (x <= -1.28e+72) tmp = t_1; elseif (x <= -1.2e+53) tmp = t_2; elseif (x <= -1.55e-37) tmp = (b * (1.0 / c)) / z; elseif (x <= -2.2e-131) tmp = t_1; elseif (x <= 1.2e-29) tmp = b * (1.0 / (z * c)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5e+117], t$95$2, If[LessEqual[x, -1.28e+72], t$95$1, If[LessEqual[x, -1.2e+53], t$95$2, If[LessEqual[x, -1.55e-37], N[(N[(b * N[(1.0 / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, -2.2e-131], t$95$1, If[LessEqual[x, 1.2e-29], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(t \cdot a\right)}{c}\\
t_2 := 9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\mathbf{if}\;x \leq -5 \cdot 10^{+117}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.28 \cdot 10^{+72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{+53}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-37}:\\
\;\;\;\;\frac{b \cdot \frac{1}{c}}{z}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-29}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -4.99999999999999983e117 or -1.28000000000000009e72 < x < -1.2e53 or 1.19999999999999996e-29 < x Initial program 95.3%
Simplified97.1%
Taylor expanded in x around inf 69.5%
times-frac62.5%
Simplified62.5%
if -4.99999999999999983e117 < x < -1.28000000000000009e72 or -1.54999999999999997e-37 < x < -2.2e-131Initial program 94.1%
associate-/r*91.4%
Simplified94.0%
Taylor expanded in z around inf 51.4%
if -1.2e53 < x < -1.54999999999999997e-37Initial program 95.6%
associate-/r*95.6%
Simplified94.9%
Taylor expanded in b around inf 51.4%
div-inv51.4%
Applied egg-rr51.4%
associate-*l/51.3%
Applied egg-rr51.3%
if -2.2e-131 < x < 1.19999999999999996e-29Initial program 94.0%
Simplified94.8%
Taylor expanded in b around inf 56.8%
*-commutative56.8%
Simplified56.8%
div-inv56.8%
Applied egg-rr56.8%
Final simplification58.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* -4.0 (* t a)) c)) (t_2 (* 9.0 (/ (* x y) (* z c)))))
(if (<= x -2.5e+117)
t_2
(if (<= x -1.62e+72)
t_1
(if (<= x -6.5e+52)
(* 9.0 (* (/ y c) (/ x z)))
(if (<= x -4.8e-33)
(/ (* b (/ 1.0 c)) z)
(if (<= x -3.5e-134)
t_1
(if (<= x 3.8e-114) (* b (/ 1.0 (* z c))) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (-4.0 * (t * a)) / c;
double t_2 = 9.0 * ((x * y) / (z * c));
double tmp;
if (x <= -2.5e+117) {
tmp = t_2;
} else if (x <= -1.62e+72) {
tmp = t_1;
} else if (x <= -6.5e+52) {
tmp = 9.0 * ((y / c) * (x / z));
} else if (x <= -4.8e-33) {
tmp = (b * (1.0 / c)) / z;
} else if (x <= -3.5e-134) {
tmp = t_1;
} else if (x <= 3.8e-114) {
tmp = b * (1.0 / (z * c));
} 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 = ((-4.0d0) * (t * a)) / c
t_2 = 9.0d0 * ((x * y) / (z * c))
if (x <= (-2.5d+117)) then
tmp = t_2
else if (x <= (-1.62d+72)) then
tmp = t_1
else if (x <= (-6.5d+52)) then
tmp = 9.0d0 * ((y / c) * (x / z))
else if (x <= (-4.8d-33)) then
tmp = (b * (1.0d0 / c)) / z
else if (x <= (-3.5d-134)) then
tmp = t_1
else if (x <= 3.8d-114) then
tmp = b * (1.0d0 / (z * c))
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 = (-4.0 * (t * a)) / c;
double t_2 = 9.0 * ((x * y) / (z * c));
double tmp;
if (x <= -2.5e+117) {
tmp = t_2;
} else if (x <= -1.62e+72) {
tmp = t_1;
} else if (x <= -6.5e+52) {
tmp = 9.0 * ((y / c) * (x / z));
} else if (x <= -4.8e-33) {
tmp = (b * (1.0 / c)) / z;
} else if (x <= -3.5e-134) {
tmp = t_1;
} else if (x <= 3.8e-114) {
tmp = b * (1.0 / (z * c));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (-4.0 * (t * a)) / c t_2 = 9.0 * ((x * y) / (z * c)) tmp = 0 if x <= -2.5e+117: tmp = t_2 elif x <= -1.62e+72: tmp = t_1 elif x <= -6.5e+52: tmp = 9.0 * ((y / c) * (x / z)) elif x <= -4.8e-33: tmp = (b * (1.0 / c)) / z elif x <= -3.5e-134: tmp = t_1 elif x <= 3.8e-114: tmp = b * (1.0 / (z * c)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(-4.0 * Float64(t * a)) / c) t_2 = Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))) tmp = 0.0 if (x <= -2.5e+117) tmp = t_2; elseif (x <= -1.62e+72) tmp = t_1; elseif (x <= -6.5e+52) tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); elseif (x <= -4.8e-33) tmp = Float64(Float64(b * Float64(1.0 / c)) / z); elseif (x <= -3.5e-134) tmp = t_1; elseif (x <= 3.8e-114) tmp = Float64(b * Float64(1.0 / Float64(z * c))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (-4.0 * (t * a)) / c; t_2 = 9.0 * ((x * y) / (z * c)); tmp = 0.0; if (x <= -2.5e+117) tmp = t_2; elseif (x <= -1.62e+72) tmp = t_1; elseif (x <= -6.5e+52) tmp = 9.0 * ((y / c) * (x / z)); elseif (x <= -4.8e-33) tmp = (b * (1.0 / c)) / z; elseif (x <= -3.5e-134) tmp = t_1; elseif (x <= 3.8e-114) tmp = b * (1.0 / (z * c)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5e+117], t$95$2, If[LessEqual[x, -1.62e+72], t$95$1, If[LessEqual[x, -6.5e+52], N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.8e-33], N[(N[(b * N[(1.0 / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, -3.5e-134], t$95$1, If[LessEqual[x, 3.8e-114], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(t \cdot a\right)}{c}\\
t_2 := 9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{+117}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.62 \cdot 10^{+72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{+52}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-33}:\\
\;\;\;\;\frac{b \cdot \frac{1}{c}}{z}\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-114}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -2.49999999999999992e117 or 3.7999999999999998e-114 < x Initial program 95.6%
Simplified97.3%
Taylor expanded in x around inf 65.0%
if -2.49999999999999992e117 < x < -1.62000000000000008e72 or -4.8e-33 < x < -3.4999999999999998e-134Initial program 94.1%
associate-/r*91.4%
Simplified94.0%
Taylor expanded in z around inf 51.4%
if -1.62000000000000008e72 < x < -6.49999999999999996e52Initial program 100.0%
Simplified100.0%
Taylor expanded in x around inf 66.7%
times-frac66.7%
Simplified66.7%
if -6.49999999999999996e52 < x < -4.8e-33Initial program 95.6%
associate-/r*95.6%
Simplified94.9%
Taylor expanded in b around inf 51.4%
div-inv51.4%
Applied egg-rr51.4%
associate-*l/51.3%
Applied egg-rr51.3%
if -3.4999999999999998e-134 < x < 3.7999999999999998e-114Initial program 92.8%
Simplified93.8%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
div-inv61.3%
Applied egg-rr61.3%
Final simplification61.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* -4.0 (* t a)) c)) (t_2 (* (/ 9.0 z) (/ (* x y) c))))
(if (<= x -2.5e+117)
(* 9.0 (/ (* x y) (* z c)))
(if (<= x -1.55e+72)
t_1
(if (<= x -9.6e+52)
t_2
(if (<= x -5.7e-39)
(/ (* b (/ 1.0 c)) z)
(if (<= x -2.8e-131)
t_1
(if (<= x 3.8e-114) (* b (/ 1.0 (* z c))) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (-4.0 * (t * a)) / c;
double t_2 = (9.0 / z) * ((x * y) / c);
double tmp;
if (x <= -2.5e+117) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (x <= -1.55e+72) {
tmp = t_1;
} else if (x <= -9.6e+52) {
tmp = t_2;
} else if (x <= -5.7e-39) {
tmp = (b * (1.0 / c)) / z;
} else if (x <= -2.8e-131) {
tmp = t_1;
} else if (x <= 3.8e-114) {
tmp = b * (1.0 / (z * c));
} 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 = ((-4.0d0) * (t * a)) / c
t_2 = (9.0d0 / z) * ((x * y) / c)
if (x <= (-2.5d+117)) then
tmp = 9.0d0 * ((x * y) / (z * c))
else if (x <= (-1.55d+72)) then
tmp = t_1
else if (x <= (-9.6d+52)) then
tmp = t_2
else if (x <= (-5.7d-39)) then
tmp = (b * (1.0d0 / c)) / z
else if (x <= (-2.8d-131)) then
tmp = t_1
else if (x <= 3.8d-114) then
tmp = b * (1.0d0 / (z * c))
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 = (-4.0 * (t * a)) / c;
double t_2 = (9.0 / z) * ((x * y) / c);
double tmp;
if (x <= -2.5e+117) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (x <= -1.55e+72) {
tmp = t_1;
} else if (x <= -9.6e+52) {
tmp = t_2;
} else if (x <= -5.7e-39) {
tmp = (b * (1.0 / c)) / z;
} else if (x <= -2.8e-131) {
tmp = t_1;
} else if (x <= 3.8e-114) {
tmp = b * (1.0 / (z * c));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (-4.0 * (t * a)) / c t_2 = (9.0 / z) * ((x * y) / c) tmp = 0 if x <= -2.5e+117: tmp = 9.0 * ((x * y) / (z * c)) elif x <= -1.55e+72: tmp = t_1 elif x <= -9.6e+52: tmp = t_2 elif x <= -5.7e-39: tmp = (b * (1.0 / c)) / z elif x <= -2.8e-131: tmp = t_1 elif x <= 3.8e-114: tmp = b * (1.0 / (z * c)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(-4.0 * Float64(t * a)) / c) t_2 = Float64(Float64(9.0 / z) * Float64(Float64(x * y) / c)) tmp = 0.0 if (x <= -2.5e+117) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))); elseif (x <= -1.55e+72) tmp = t_1; elseif (x <= -9.6e+52) tmp = t_2; elseif (x <= -5.7e-39) tmp = Float64(Float64(b * Float64(1.0 / c)) / z); elseif (x <= -2.8e-131) tmp = t_1; elseif (x <= 3.8e-114) tmp = Float64(b * Float64(1.0 / Float64(z * c))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (-4.0 * (t * a)) / c; t_2 = (9.0 / z) * ((x * y) / c); tmp = 0.0; if (x <= -2.5e+117) tmp = 9.0 * ((x * y) / (z * c)); elseif (x <= -1.55e+72) tmp = t_1; elseif (x <= -9.6e+52) tmp = t_2; elseif (x <= -5.7e-39) tmp = (b * (1.0 / c)) / z; elseif (x <= -2.8e-131) tmp = t_1; elseif (x <= 3.8e-114) tmp = b * (1.0 / (z * c)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(9.0 / z), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5e+117], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.55e+72], t$95$1, If[LessEqual[x, -9.6e+52], t$95$2, If[LessEqual[x, -5.7e-39], N[(N[(b * N[(1.0 / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, -2.8e-131], t$95$1, If[LessEqual[x, 3.8e-114], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(t \cdot a\right)}{c}\\
t_2 := \frac{9}{z} \cdot \frac{x \cdot y}{c}\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{+117}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{+72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -9.6 \cdot 10^{+52}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -5.7 \cdot 10^{-39}:\\
\;\;\;\;\frac{b \cdot \frac{1}{c}}{z}\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-114}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -2.49999999999999992e117Initial program 91.6%
Simplified97.7%
Taylor expanded in x around inf 73.9%
if -2.49999999999999992e117 < x < -1.54999999999999994e72 or -5.6999999999999997e-39 < x < -2.8e-131Initial program 94.1%
associate-/r*91.4%
Simplified94.0%
Taylor expanded in z around inf 51.4%
if -1.54999999999999994e72 < x < -9.5999999999999999e52 or 3.7999999999999998e-114 < x Initial program 98.5%
associate-/r*92.7%
Simplified91.4%
Taylor expanded in t around 0 68.4%
Taylor expanded in z around -inf 78.3%
mul-1-neg78.3%
distribute-neg-frac78.3%
neg-mul-178.3%
unsub-neg78.3%
*-commutative78.3%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in y around inf 59.6%
associate-*r/59.6%
*-commutative59.6%
times-frac56.0%
Simplified56.0%
if -9.5999999999999999e52 < x < -5.6999999999999997e-39Initial program 95.6%
associate-/r*95.6%
Simplified94.9%
Taylor expanded in b around inf 51.4%
div-inv51.4%
Applied egg-rr51.4%
associate-*l/51.3%
Applied egg-rr51.3%
if -2.8e-131 < x < 3.7999999999999998e-114Initial program 92.8%
Simplified93.8%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
div-inv61.3%
Applied egg-rr61.3%
Final simplification60.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* -4.0 (* t a)) c)))
(if (<= x -2.5e+117)
(* 9.0 (/ (* x y) (* z c)))
(if (<= x -1.55e+72)
t_1
(if (<= x -8.1e+52)
(/ (* y (* x 9.0)) (* z c))
(if (<= x -2.8e-38)
(/ (* b (/ 1.0 c)) z)
(if (<= x -9.6e-132)
t_1
(if (<= x 3.2e-114)
(* b (/ 1.0 (* z c)))
(* (/ 9.0 z) (/ (* x y) c))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (-4.0 * (t * a)) / c;
double tmp;
if (x <= -2.5e+117) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (x <= -1.55e+72) {
tmp = t_1;
} else if (x <= -8.1e+52) {
tmp = (y * (x * 9.0)) / (z * c);
} else if (x <= -2.8e-38) {
tmp = (b * (1.0 / c)) / z;
} else if (x <= -9.6e-132) {
tmp = t_1;
} else if (x <= 3.2e-114) {
tmp = b * (1.0 / (z * c));
} else {
tmp = (9.0 / z) * ((x * y) / 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) :: t_1
real(8) :: tmp
t_1 = ((-4.0d0) * (t * a)) / c
if (x <= (-2.5d+117)) then
tmp = 9.0d0 * ((x * y) / (z * c))
else if (x <= (-1.55d+72)) then
tmp = t_1
else if (x <= (-8.1d+52)) then
tmp = (y * (x * 9.0d0)) / (z * c)
else if (x <= (-2.8d-38)) then
tmp = (b * (1.0d0 / c)) / z
else if (x <= (-9.6d-132)) then
tmp = t_1
else if (x <= 3.2d-114) then
tmp = b * (1.0d0 / (z * c))
else
tmp = (9.0d0 / z) * ((x * y) / 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 t_1 = (-4.0 * (t * a)) / c;
double tmp;
if (x <= -2.5e+117) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (x <= -1.55e+72) {
tmp = t_1;
} else if (x <= -8.1e+52) {
tmp = (y * (x * 9.0)) / (z * c);
} else if (x <= -2.8e-38) {
tmp = (b * (1.0 / c)) / z;
} else if (x <= -9.6e-132) {
tmp = t_1;
} else if (x <= 3.2e-114) {
tmp = b * (1.0 / (z * c));
} else {
tmp = (9.0 / z) * ((x * y) / c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (-4.0 * (t * a)) / c tmp = 0 if x <= -2.5e+117: tmp = 9.0 * ((x * y) / (z * c)) elif x <= -1.55e+72: tmp = t_1 elif x <= -8.1e+52: tmp = (y * (x * 9.0)) / (z * c) elif x <= -2.8e-38: tmp = (b * (1.0 / c)) / z elif x <= -9.6e-132: tmp = t_1 elif x <= 3.2e-114: tmp = b * (1.0 / (z * c)) else: tmp = (9.0 / z) * ((x * y) / c) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(-4.0 * Float64(t * a)) / c) tmp = 0.0 if (x <= -2.5e+117) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))); elseif (x <= -1.55e+72) tmp = t_1; elseif (x <= -8.1e+52) tmp = Float64(Float64(y * Float64(x * 9.0)) / Float64(z * c)); elseif (x <= -2.8e-38) tmp = Float64(Float64(b * Float64(1.0 / c)) / z); elseif (x <= -9.6e-132) tmp = t_1; elseif (x <= 3.2e-114) tmp = Float64(b * Float64(1.0 / Float64(z * c))); else tmp = Float64(Float64(9.0 / z) * Float64(Float64(x * y) / c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (-4.0 * (t * a)) / c; tmp = 0.0; if (x <= -2.5e+117) tmp = 9.0 * ((x * y) / (z * c)); elseif (x <= -1.55e+72) tmp = t_1; elseif (x <= -8.1e+52) tmp = (y * (x * 9.0)) / (z * c); elseif (x <= -2.8e-38) tmp = (b * (1.0 / c)) / z; elseif (x <= -9.6e-132) tmp = t_1; elseif (x <= 3.2e-114) tmp = b * (1.0 / (z * c)); else tmp = (9.0 / z) * ((x * y) / c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[x, -2.5e+117], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.55e+72], t$95$1, If[LessEqual[x, -8.1e+52], N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.8e-38], N[(N[(b * N[(1.0 / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, -9.6e-132], t$95$1, If[LessEqual[x, 3.2e-114], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(9.0 / z), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(t \cdot a\right)}{c}\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{+117}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{+72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.1 \cdot 10^{+52}:\\
\;\;\;\;\frac{y \cdot \left(x \cdot 9\right)}{z \cdot c}\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-38}:\\
\;\;\;\;\frac{b \cdot \frac{1}{c}}{z}\\
\mathbf{elif}\;x \leq -9.6 \cdot 10^{-132}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-114}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{9}{z} \cdot \frac{x \cdot y}{c}\\
\end{array}
\end{array}
if x < -2.49999999999999992e117Initial program 91.6%
Simplified97.7%
Taylor expanded in x around inf 73.9%
if -2.49999999999999992e117 < x < -1.54999999999999994e72 or -2.8e-38 < x < -9.60000000000000062e-132Initial program 94.1%
associate-/r*91.4%
Simplified94.0%
Taylor expanded in z around inf 51.4%
if -1.54999999999999994e72 < x < -8.09999999999999995e52Initial program 100.0%
Simplified100.0%
Taylor expanded in x around inf 66.7%
expm1-log1p-u32.1%
expm1-udef32.3%
Applied egg-rr32.3%
expm1-def32.1%
expm1-log1p66.7%
*-commutative66.7%
associate-*r*67.0%
Simplified67.0%
if -8.09999999999999995e52 < x < -2.8e-38Initial program 95.6%
associate-/r*95.6%
Simplified94.9%
Taylor expanded in b around inf 51.4%
div-inv51.4%
Applied egg-rr51.4%
associate-*l/51.3%
Applied egg-rr51.3%
if -9.60000000000000062e-132 < x < 3.2000000000000002e-114Initial program 92.8%
Simplified93.8%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
div-inv61.3%
Applied egg-rr61.3%
if 3.2000000000000002e-114 < x Initial program 98.3%
associate-/r*93.4%
Simplified92.0%
Taylor expanded in t around 0 69.9%
Taylor expanded in z around -inf 79.2%
mul-1-neg79.2%
distribute-neg-frac79.2%
neg-mul-179.2%
unsub-neg79.2%
*-commutative79.2%
associate-*l*79.1%
*-commutative79.1%
Simplified79.1%
Taylor expanded in y around inf 59.0%
associate-*r/59.1%
*-commutative59.1%
times-frac55.1%
Simplified55.1%
Final simplification60.1%
(FPCore (x y z t a b c)
:precision binary64
(if (<= b -2.25e-54)
(/ (- b (* x (* y -9.0))) (* z c))
(if (<= b 2e-30)
(/ (- (* 9.0 (* x y)) (* 4.0 (* a (* z t)))) (* z c))
(/ (- b (* y (* x -9.0))) (* z c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -2.25e-54) {
tmp = (b - (x * (y * -9.0))) / (z * c);
} else if (b <= 2e-30) {
tmp = ((9.0 * (x * y)) - (4.0 * (a * (z * t)))) / (z * c);
} else {
tmp = (b - (y * (x * -9.0))) / (z * 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 (b <= (-2.25d-54)) then
tmp = (b - (x * (y * (-9.0d0)))) / (z * c)
else if (b <= 2d-30) then
tmp = ((9.0d0 * (x * y)) - (4.0d0 * (a * (z * t)))) / (z * c)
else
tmp = (b - (y * (x * (-9.0d0)))) / (z * 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 (b <= -2.25e-54) {
tmp = (b - (x * (y * -9.0))) / (z * c);
} else if (b <= 2e-30) {
tmp = ((9.0 * (x * y)) - (4.0 * (a * (z * t)))) / (z * c);
} else {
tmp = (b - (y * (x * -9.0))) / (z * c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if b <= -2.25e-54: tmp = (b - (x * (y * -9.0))) / (z * c) elif b <= 2e-30: tmp = ((9.0 * (x * y)) - (4.0 * (a * (z * t)))) / (z * c) else: tmp = (b - (y * (x * -9.0))) / (z * c) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -2.25e-54) tmp = Float64(Float64(b - Float64(x * Float64(y * -9.0))) / Float64(z * c)); elseif (b <= 2e-30) tmp = Float64(Float64(Float64(9.0 * Float64(x * y)) - Float64(4.0 * Float64(a * Float64(z * t)))) / Float64(z * c)); else tmp = Float64(Float64(b - Float64(y * Float64(x * -9.0))) / Float64(z * c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (b <= -2.25e-54) tmp = (b - (x * (y * -9.0))) / (z * c); elseif (b <= 2e-30) tmp = ((9.0 * (x * y)) - (4.0 * (a * (z * t)))) / (z * c); else tmp = (b - (y * (x * -9.0))) / (z * c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -2.25e-54], N[(N[(b - N[(x * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e-30], N[(N[(N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(b - N[(y * N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.25 \cdot 10^{-54}:\\
\;\;\;\;\frac{b - x \cdot \left(y \cdot -9\right)}{z \cdot c}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-30}:\\
\;\;\;\;\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b - y \cdot \left(x \cdot -9\right)}{z \cdot c}\\
\end{array}
\end{array}
if b < -2.2499999999999999e-54Initial program 95.9%
associate-/r*88.9%
Simplified88.6%
Taylor expanded in t around 0 79.4%
Taylor expanded in z around -inf 91.2%
mul-1-neg91.2%
distribute-neg-frac91.2%
neg-mul-191.2%
unsub-neg91.2%
*-commutative91.2%
associate-*l*91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in z around 0 91.2%
expm1-log1p-u69.9%
expm1-udef69.5%
Applied egg-rr69.5%
expm1-def69.9%
expm1-log1p91.2%
*-commutative91.2%
*-commutative91.2%
associate-*l*91.2%
Simplified91.2%
if -2.2499999999999999e-54 < b < 2e-30Initial program 92.9%
associate-*l*92.9%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in b around 0 82.7%
if 2e-30 < b Initial program 96.2%
associate-/r*88.8%
Simplified88.7%
Taylor expanded in t around 0 74.5%
Taylor expanded in z around -inf 85.1%
mul-1-neg85.1%
distribute-neg-frac85.1%
neg-mul-185.1%
unsub-neg85.1%
*-commutative85.1%
associate-*l*85.1%
*-commutative85.1%
Simplified85.1%
Final simplification85.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (+ b (* 9.0 (* x y))) (* z c))) (t_2 (* -4.0 (/ a (/ c t)))))
(if (<= t -4.4e+235)
t_2
(if (<= t -5e+203)
t_1
(if (<= t -4.5e+151)
t_2
(if (<= t 1.25e+52) t_1 (* -4.0 (* t (/ a c)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (z * c);
double t_2 = -4.0 * (a / (c / t));
double tmp;
if (t <= -4.4e+235) {
tmp = t_2;
} else if (t <= -5e+203) {
tmp = t_1;
} else if (t <= -4.5e+151) {
tmp = t_2;
} else if (t <= 1.25e+52) {
tmp = t_1;
} else {
tmp = -4.0 * (t * (a / 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b + (9.0d0 * (x * y))) / (z * c)
t_2 = (-4.0d0) * (a / (c / t))
if (t <= (-4.4d+235)) then
tmp = t_2
else if (t <= (-5d+203)) then
tmp = t_1
else if (t <= (-4.5d+151)) then
tmp = t_2
else if (t <= 1.25d+52) then
tmp = t_1
else
tmp = (-4.0d0) * (t * (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 t_1 = (b + (9.0 * (x * y))) / (z * c);
double t_2 = -4.0 * (a / (c / t));
double tmp;
if (t <= -4.4e+235) {
tmp = t_2;
} else if (t <= -5e+203) {
tmp = t_1;
} else if (t <= -4.5e+151) {
tmp = t_2;
} else if (t <= 1.25e+52) {
tmp = t_1;
} else {
tmp = -4.0 * (t * (a / c));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b + (9.0 * (x * y))) / (z * c) t_2 = -4.0 * (a / (c / t)) tmp = 0 if t <= -4.4e+235: tmp = t_2 elif t <= -5e+203: tmp = t_1 elif t <= -4.5e+151: tmp = t_2 elif t <= 1.25e+52: tmp = t_1 else: tmp = -4.0 * (t * (a / c)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)) t_2 = Float64(-4.0 * Float64(a / Float64(c / t))) tmp = 0.0 if (t <= -4.4e+235) tmp = t_2; elseif (t <= -5e+203) tmp = t_1; elseif (t <= -4.5e+151) tmp = t_2; elseif (t <= 1.25e+52) tmp = t_1; else tmp = Float64(-4.0 * Float64(t * Float64(a / c))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (b + (9.0 * (x * y))) / (z * c); t_2 = -4.0 * (a / (c / t)); tmp = 0.0; if (t <= -4.4e+235) tmp = t_2; elseif (t <= -5e+203) tmp = t_1; elseif (t <= -4.5e+151) tmp = t_2; elseif (t <= 1.25e+52) tmp = t_1; else tmp = -4.0 * (t * (a / c)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.4e+235], t$95$2, If[LessEqual[t, -5e+203], t$95$1, If[LessEqual[t, -4.5e+151], t$95$2, If[LessEqual[t, 1.25e+52], t$95$1, N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
t_2 := -4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{+235}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -5 \cdot 10^{+203}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{+151}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if t < -4.4e235 or -4.99999999999999994e203 < t < -4.4999999999999999e151Initial program 84.1%
Simplified89.8%
Taylor expanded in z around inf 69.2%
associate-/l*85.8%
Simplified85.8%
if -4.4e235 < t < -4.99999999999999994e203 or -4.4999999999999999e151 < t < 1.25e52Initial program 97.7%
Simplified97.1%
Taylor expanded in z around 0 83.8%
if 1.25e52 < t Initial program 89.5%
Simplified95.4%
Taylor expanded in z around inf 48.9%
associate-/l*50.4%
associate-/r/50.2%
Simplified50.2%
Final simplification75.4%
(FPCore (x y z t a b c) :precision binary64 (/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * 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 = (b + ((x * (9.0d0 * y)) - ((z * 4.0d0) * (t * a)))) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
}
def code(x, y, z, t, a, b, c): return (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right)}{z \cdot c}
\end{array}
Initial program 94.7%
associate-*l*94.7%
associate-*l*95.4%
Simplified95.4%
Final simplification95.4%
(FPCore (x y z t a b c) :precision binary64 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * 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 = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
}
def code(x, y, z, t, a, b, c): return (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}
\end{array}
Initial program 94.7%
Final simplification94.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -0.0026) (not (<= z 4.2e+61))) (/ (+ (/ b z) (* -4.0 (* t a))) c) (/ (+ b (* 9.0 (* x y))) (* z c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -0.0026) || !(z <= 4.2e+61)) {
tmp = ((b / z) + (-4.0 * (t * a))) / c;
} else {
tmp = (b + (9.0 * (x * y))) / (z * 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 ((z <= (-0.0026d0)) .or. (.not. (z <= 4.2d+61))) then
tmp = ((b / z) + ((-4.0d0) * (t * a))) / c
else
tmp = (b + (9.0d0 * (x * y))) / (z * 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 ((z <= -0.0026) || !(z <= 4.2e+61)) {
tmp = ((b / z) + (-4.0 * (t * a))) / c;
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -0.0026) or not (z <= 4.2e+61): tmp = ((b / z) + (-4.0 * (t * a))) / c else: tmp = (b + (9.0 * (x * y))) / (z * c) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -0.0026) || !(z <= 4.2e+61)) tmp = Float64(Float64(Float64(b / z) + Float64(-4.0 * Float64(t * a))) / c); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((z <= -0.0026) || ~((z <= 4.2e+61))) tmp = ((b / z) + (-4.0 * (t * a))) / c; else tmp = (b + (9.0 * (x * y))) / (z * c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -0.0026], N[Not[LessEqual[z, 4.2e+61]], $MachinePrecision]], N[(N[(N[(b / z), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0026 \lor \neg \left(z \leq 4.2 \cdot 10^{+61}\right):\\
\;\;\;\;\frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -0.0025999999999999999 or 4.2000000000000002e61 < z Initial program 88.6%
associate-/r*87.2%
Simplified94.1%
Taylor expanded in x around 0 81.1%
if -0.0025999999999999999 < z < 4.2000000000000002e61Initial program 96.8%
Simplified95.8%
Taylor expanded in z around 0 87.2%
Final simplification85.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -2e-5) (not (<= z 3.8e+62))) (/ (+ (/ b z) (* -4.0 (* t a))) c) (/ (- b (* x (* y -9.0))) (* z c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2e-5) || !(z <= 3.8e+62)) {
tmp = ((b / z) + (-4.0 * (t * a))) / c;
} else {
tmp = (b - (x * (y * -9.0))) / (z * 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 ((z <= (-2d-5)) .or. (.not. (z <= 3.8d+62))) then
tmp = ((b / z) + ((-4.0d0) * (t * a))) / c
else
tmp = (b - (x * (y * (-9.0d0)))) / (z * 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 ((z <= -2e-5) || !(z <= 3.8e+62)) {
tmp = ((b / z) + (-4.0 * (t * a))) / c;
} else {
tmp = (b - (x * (y * -9.0))) / (z * c);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -2e-5) or not (z <= 3.8e+62): tmp = ((b / z) + (-4.0 * (t * a))) / c else: tmp = (b - (x * (y * -9.0))) / (z * c) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2e-5) || !(z <= 3.8e+62)) tmp = Float64(Float64(Float64(b / z) + Float64(-4.0 * Float64(t * a))) / c); else tmp = Float64(Float64(b - Float64(x * Float64(y * -9.0))) / Float64(z * c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((z <= -2e-5) || ~((z <= 3.8e+62))) tmp = ((b / z) + (-4.0 * (t * a))) / c; else tmp = (b - (x * (y * -9.0))) / (z * c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -2e-5], N[Not[LessEqual[z, 3.8e+62]], $MachinePrecision]], N[(N[(N[(b / z), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b - N[(x * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-5} \lor \neg \left(z \leq 3.8 \cdot 10^{+62}\right):\\
\;\;\;\;\frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b - x \cdot \left(y \cdot -9\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -2.00000000000000016e-5 or 3.79999999999999984e62 < z Initial program 88.6%
associate-/r*87.2%
Simplified94.1%
Taylor expanded in x around 0 81.1%
if -2.00000000000000016e-5 < z < 3.79999999999999984e62Initial program 96.8%
associate-/r*89.5%
Simplified88.3%
Taylor expanded in t around 0 76.8%
Taylor expanded in z around -inf 87.2%
mul-1-neg87.2%
distribute-neg-frac87.2%
neg-mul-187.2%
unsub-neg87.2%
*-commutative87.2%
associate-*l*87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in z around 0 87.2%
expm1-log1p-u65.1%
expm1-udef59.9%
Applied egg-rr59.9%
expm1-def65.1%
expm1-log1p87.2%
*-commutative87.2%
*-commutative87.2%
associate-*l*87.2%
Simplified87.2%
Final simplification85.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -1.85e-57) (not (<= b 4.4e-27))) (/ b (* z c)) (* -4.0 (* t (/ a c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -1.85e-57) || !(b <= 4.4e-27)) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (t * (a / 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 ((b <= (-1.85d-57)) .or. (.not. (b <= 4.4d-27))) then
tmp = b / (z * c)
else
tmp = (-4.0d0) * (t * (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 tmp;
if ((b <= -1.85e-57) || !(b <= 4.4e-27)) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (t * (a / c));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -1.85e-57) or not (b <= 4.4e-27): tmp = b / (z * c) else: tmp = -4.0 * (t * (a / c)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -1.85e-57) || !(b <= 4.4e-27)) tmp = Float64(b / Float64(z * c)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((b <= -1.85e-57) || ~((b <= 4.4e-27))) tmp = b / (z * c); else tmp = -4.0 * (t * (a / c)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -1.85e-57], N[Not[LessEqual[b, 4.4e-27]], $MachinePrecision]], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.85 \cdot 10^{-57} \lor \neg \left(b \leq 4.4 \cdot 10^{-27}\right):\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if b < -1.85e-57 or 4.39999999999999974e-27 < b Initial program 96.0%
Simplified97.3%
Taylor expanded in b around inf 64.4%
*-commutative64.4%
Simplified64.4%
if -1.85e-57 < b < 4.39999999999999974e-27Initial program 92.9%
Simplified94.6%
Taylor expanded in z around inf 42.5%
associate-/l*42.5%
associate-/r/44.2%
Simplified44.2%
Final simplification55.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -1.5e-52) (not (<= b 2.5e-26))) (/ b (* z c)) (* -4.0 (/ a (/ c t)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -1.5e-52) || !(b <= 2.5e-26)) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
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 ((b <= (-1.5d-52)) .or. (.not. (b <= 2.5d-26))) then
tmp = b / (z * c)
else
tmp = (-4.0d0) * (a / (c / 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 tmp;
if ((b <= -1.5e-52) || !(b <= 2.5e-26)) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -1.5e-52) or not (b <= 2.5e-26): tmp = b / (z * c) else: tmp = -4.0 * (a / (c / t)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -1.5e-52) || !(b <= 2.5e-26)) tmp = Float64(b / Float64(z * c)); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((b <= -1.5e-52) || ~((b <= 2.5e-26))) tmp = b / (z * c); else tmp = -4.0 * (a / (c / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -1.5e-52], N[Not[LessEqual[b, 2.5e-26]], $MachinePrecision]], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.5 \cdot 10^{-52} \lor \neg \left(b \leq 2.5 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if b < -1.5e-52 or 2.5000000000000001e-26 < b Initial program 96.0%
Simplified97.3%
Taylor expanded in b around inf 64.8%
*-commutative64.8%
Simplified64.8%
if -1.5e-52 < b < 2.5000000000000001e-26Initial program 92.9%
Simplified94.6%
Taylor expanded in z around inf 43.0%
associate-/l*43.0%
Simplified43.0%
Final simplification55.3%
(FPCore (x y z t a b c) :precision binary64 (/ b (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * 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 = b / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
def code(x, y, z, t, a, b, c): return b / (z * c)
function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = b / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 94.7%
Simplified96.1%
Taylor expanded in b around inf 42.5%
*-commutative42.5%
Simplified42.5%
Final simplification42.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - 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) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - 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 / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t_4}{z \cdot c}\\
t_6 := \frac{\left(t_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t_5 < 0:\\
\;\;\;\;\frac{\frac{t_4}{z}}{c}\\
\mathbf{elif}\;t_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t_1\right) - t_2\\
\mathbf{elif}\;t_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t_1\right) - t_2\\
\end{array}
\end{array}
herbie shell --seed 2023278
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:herbie-target
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))