
(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 12 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}
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= c_m 2.5e+74)
(/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z))
(*
t
(-
(/ (fma (/ 9.0 z) (* x (/ y c_m)) (/ b (* c_m z))) t)
(* (/ a c_m) 4.0))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 2.5e+74) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else {
tmp = t * ((fma((9.0 / z), (x * (y / c_m)), (b / (c_m * z))) / t) - ((a / c_m) * 4.0));
}
return c_s * tmp;
}
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (c_m <= 2.5e+74) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c_m * z)); else tmp = Float64(t * Float64(Float64(fma(Float64(9.0 / z), Float64(x * Float64(y / c_m)), Float64(b / Float64(c_m * z))) / t) - Float64(Float64(a / c_m) * 4.0))); end return Float64(c_s * tmp) end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[c$95$m, 2.5e+74], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(N[(9.0 / z), $MachinePrecision] * N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(a / c$95$m), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 2.5 \cdot 10^{+74}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{\mathsf{fma}\left(\frac{9}{z}, x \cdot \frac{y}{c\_m}, \frac{b}{c\_m \cdot z}\right)}{t} - \frac{a}{c\_m} \cdot 4\right)\\
\end{array}
\end{array}
if c < 2.49999999999999982e74Initial program 82.8%
associate-+l-82.8%
*-commutative82.8%
associate-*r*82.4%
*-commutative82.4%
associate-+l-82.4%
associate-*l*82.4%
associate-*l*86.0%
*-commutative86.0%
Simplified86.0%
if 2.49999999999999982e74 < c Initial program 70.9%
associate-+l-70.9%
*-commutative70.9%
associate-*r*70.9%
*-commutative70.9%
associate-+l-70.9%
Simplified70.9%
Taylor expanded in t around -inf 77.3%
mul-1-neg77.3%
*-commutative77.3%
distribute-rgt-neg-in77.3%
Simplified83.5%
Final simplification85.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<=
(/ (+ b (- (* y (* x 9.0)) (* a (* (* z 4.0) t)))) (* c_m z))
INFINITY)
(/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z))
(* a (/ (* t -4.0) c_m)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (((b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z)) <= ((double) INFINITY)) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (((b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z)) <= Double.POSITIVE_INFINITY) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if ((b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z)) <= math.inf: tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z) else: tmp = a * ((t * -4.0) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(Float64(z * 4.0) * t)))) / Float64(c_m * z)) <= Inf) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c_m * z)); else tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c); c\_s = sign(c) * abs(1.0); function tmp_2 = code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0; if (((b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z)) <= Inf) tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z); else tmp = a * ((t * -4.0) / c_m); end tmp_2 = c_s * tmp; end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(\left(z \cdot 4\right) \cdot t\right)\right)}{c\_m \cdot z} \leq \infty:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 87.4%
associate-+l-87.4%
*-commutative87.4%
associate-*r*86.6%
*-commutative86.6%
associate-+l-86.6%
associate-*l*86.6%
associate-*l*89.0%
*-commutative89.0%
Simplified89.0%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
associate-+l-0.0%
*-commutative0.0%
associate-*r*5.0%
*-commutative5.0%
associate-+l-5.0%
Simplified5.0%
Taylor expanded in t around inf 47.5%
*-commutative47.5%
associate-/l*70.5%
associate-*r*70.5%
*-commutative70.5%
*-commutative70.5%
associate-*l/70.5%
Simplified70.5%
Final simplification87.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= b -2.1e+40)
(/ (/ b c_m) z)
(if (<= b -1e-162)
(* 9.0 (* x (/ y (* c_m z))))
(if (<= b 2.2e-215)
(* -4.0 (/ (* t a) c_m))
(if (<= b 0.00285)
(* 9.0 (* x (/ (/ y c_m) z)))
(/ 1.0 (* z (/ c_m b)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -2.1e+40) {
tmp = (b / c_m) / z;
} else if (b <= -1e-162) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (b <= 2.2e-215) {
tmp = -4.0 * ((t * a) / c_m);
} else if (b <= 0.00285) {
tmp = 9.0 * (x * ((y / c_m) / z));
} else {
tmp = 1.0 / (z * (c_m / b));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (b <= (-2.1d+40)) then
tmp = (b / c_m) / z
else if (b <= (-1d-162)) then
tmp = 9.0d0 * (x * (y / (c_m * z)))
else if (b <= 2.2d-215) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (b <= 0.00285d0) then
tmp = 9.0d0 * (x * ((y / c_m) / z))
else
tmp = 1.0d0 / (z * (c_m / b))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -2.1e+40) {
tmp = (b / c_m) / z;
} else if (b <= -1e-162) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (b <= 2.2e-215) {
tmp = -4.0 * ((t * a) / c_m);
} else if (b <= 0.00285) {
tmp = 9.0 * (x * ((y / c_m) / z));
} else {
tmp = 1.0 / (z * (c_m / b));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if b <= -2.1e+40: tmp = (b / c_m) / z elif b <= -1e-162: tmp = 9.0 * (x * (y / (c_m * z))) elif b <= 2.2e-215: tmp = -4.0 * ((t * a) / c_m) elif b <= 0.00285: tmp = 9.0 * (x * ((y / c_m) / z)) else: tmp = 1.0 / (z * (c_m / b)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (b <= -2.1e+40) tmp = Float64(Float64(b / c_m) / z); elseif (b <= -1e-162) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); elseif (b <= 2.2e-215) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (b <= 0.00285) tmp = Float64(9.0 * Float64(x * Float64(Float64(y / c_m) / z))); else tmp = Float64(1.0 / Float64(z * Float64(c_m / b))); end return Float64(c_s * tmp) end
c\_m = abs(c); c\_s = sign(c) * abs(1.0); function tmp_2 = code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0; if (b <= -2.1e+40) tmp = (b / c_m) / z; elseif (b <= -1e-162) tmp = 9.0 * (x * (y / (c_m * z))); elseif (b <= 2.2e-215) tmp = -4.0 * ((t * a) / c_m); elseif (b <= 0.00285) tmp = 9.0 * (x * ((y / c_m) / z)); else tmp = 1.0 / (z * (c_m / b)); end tmp_2 = c_s * tmp; end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[b, -2.1e+40], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, -1e-162], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.2e-215], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.00285], N[(9.0 * N[(x * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(c$95$m / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -2.1 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;b \leq -1 \cdot 10^{-162}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{-215}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;b \leq 0.00285:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{\frac{y}{c\_m}}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{c\_m}{b}}\\
\end{array}
\end{array}
if b < -2.1000000000000001e40Initial program 83.8%
associate-+l-83.8%
*-commutative83.8%
associate-*r*85.8%
*-commutative85.8%
associate-+l-85.8%
associate-*l*85.8%
associate-*l*87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in t around inf 84.0%
Taylor expanded in b around inf 63.9%
associate-/r*66.1%
Simplified66.1%
if -2.1000000000000001e40 < b < -9.99999999999999954e-163Initial program 69.4%
associate-+l-69.4%
*-commutative69.4%
associate-*r*71.7%
*-commutative71.7%
associate-+l-71.7%
Simplified71.6%
Taylor expanded in x around inf 46.5%
associate-/l*51.3%
*-commutative51.3%
Simplified51.3%
if -9.99999999999999954e-163 < b < 2.19999999999999996e-215Initial program 84.6%
associate-+l-84.6%
*-commutative84.6%
associate-*r*81.3%
*-commutative81.3%
associate-+l-81.3%
Simplified81.3%
Taylor expanded in t around inf 58.4%
if 2.19999999999999996e-215 < b < 0.0028500000000000001Initial program 74.8%
associate-+l-74.8%
*-commutative74.8%
associate-*r*79.0%
*-commutative79.0%
associate-+l-79.0%
Simplified79.0%
Taylor expanded in x around inf 51.5%
*-commutative51.5%
associate-/l*59.7%
associate-*l*59.7%
*-commutative59.7%
associate-*r/59.8%
*-commutative59.8%
associate-/l*59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in x around 0 51.5%
associate-/l*59.7%
associate-/r*60.3%
Simplified60.3%
if 0.0028500000000000001 < b Initial program 86.3%
associate-+l-86.3%
*-commutative86.3%
associate-*r*81.3%
*-commutative81.3%
associate-+l-81.3%
Simplified81.3%
Taylor expanded in b around inf 63.4%
*-commutative63.4%
Simplified63.4%
clear-num63.5%
inv-pow63.5%
Applied egg-rr63.5%
unpow-163.5%
associate-/l*64.8%
Simplified64.8%
Final simplification60.7%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -4.7e+156)
(* (* a -4.0) (/ t c_m))
(if (<= t -2.6e+36)
(/ (+ b (* t (* z (* a -4.0)))) (* c_m z))
(if (<= t 1.35e-21)
(/ (+ b (* y (* x 9.0))) (* c_m z))
(* a (/ (* t -4.0) c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -4.7e+156) {
tmp = (a * -4.0) * (t / c_m);
} else if (t <= -2.6e+36) {
tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z);
} else if (t <= 1.35e-21) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (t <= (-4.7d+156)) then
tmp = (a * (-4.0d0)) * (t / c_m)
else if (t <= (-2.6d+36)) then
tmp = (b + (t * (z * (a * (-4.0d0))))) / (c_m * z)
else if (t <= 1.35d-21) then
tmp = (b + (y * (x * 9.0d0))) / (c_m * z)
else
tmp = a * ((t * (-4.0d0)) / c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -4.7e+156) {
tmp = (a * -4.0) * (t / c_m);
} else if (t <= -2.6e+36) {
tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z);
} else if (t <= 1.35e-21) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -4.7e+156: tmp = (a * -4.0) * (t / c_m) elif t <= -2.6e+36: tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z) elif t <= 1.35e-21: tmp = (b + (y * (x * 9.0))) / (c_m * z) else: tmp = a * ((t * -4.0) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -4.7e+156) tmp = Float64(Float64(a * -4.0) * Float64(t / c_m)); elseif (t <= -2.6e+36) tmp = Float64(Float64(b + Float64(t * Float64(z * Float64(a * -4.0)))) / Float64(c_m * z)); elseif (t <= 1.35e-21) tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(c_m * z)); else tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c); c\_s = sign(c) * abs(1.0); function tmp_2 = code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0; if (t <= -4.7e+156) tmp = (a * -4.0) * (t / c_m); elseif (t <= -2.6e+36) tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z); elseif (t <= 1.35e-21) tmp = (b + (y * (x * 9.0))) / (c_m * z); else tmp = a * ((t * -4.0) / c_m); end tmp_2 = c_s * tmp; end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -4.7e+156], N[(N[(a * -4.0), $MachinePrecision] * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.6e+36], N[(N[(b + N[(t * N[(z * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e-21], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{+156}:\\
\;\;\;\;\left(a \cdot -4\right) \cdot \frac{t}{c\_m}\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{+36}:\\
\;\;\;\;\frac{b + t \cdot \left(z \cdot \left(a \cdot -4\right)\right)}{c\_m \cdot z}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{-21}:\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\end{array}
\end{array}
if t < -4.7e156Initial program 67.4%
associate-+l-67.4%
*-commutative67.4%
associate-*r*71.0%
*-commutative71.0%
associate-+l-71.0%
associate-*l*71.0%
associate-*l*73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in t around inf 70.9%
Taylor expanded in t around inf 64.5%
associate-*r/70.7%
associate-*r*70.7%
Simplified70.7%
if -4.7e156 < t < -2.6000000000000001e36Initial program 80.9%
associate-+l-80.9%
*-commutative80.9%
associate-*r*80.9%
*-commutative80.9%
associate-+l-80.9%
associate-*l*80.9%
associate-*l*70.9%
*-commutative70.9%
Simplified70.9%
Taylor expanded in t around inf 80.9%
Taylor expanded in x around 0 69.9%
associate-*r*69.9%
Simplified69.9%
if -2.6000000000000001e36 < t < 1.3500000000000001e-21Initial program 87.2%
associate-+l-87.2%
*-commutative87.2%
associate-*r*83.0%
*-commutative83.0%
associate-+l-83.0%
associate-*l*83.0%
associate-*l*88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in z around inf 87.1%
Taylor expanded in z around 0 74.5%
associate-*r*74.5%
Simplified74.5%
if 1.3500000000000001e-21 < t Initial program 73.2%
associate-+l-73.2%
*-commutative73.2%
associate-*r*78.8%
*-commutative78.8%
associate-+l-78.8%
Simplified78.8%
Taylor expanded in t around inf 44.5%
*-commutative44.5%
associate-/l*48.3%
associate-*r*48.3%
*-commutative48.3%
*-commutative48.3%
associate-*l/48.3%
Simplified48.3%
Final simplification66.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= t -4.9e+33) (not (<= t 1.2e-100)))
(* a (+ (* -4.0 (/ t c_m)) (/ b (* z (* c_m a)))))
(/ (+ b (* y (* x 9.0))) (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((t <= -4.9e+33) || !(t <= 1.2e-100)) {
tmp = a * ((-4.0 * (t / c_m)) + (b / (z * (c_m * a))));
} else {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if ((t <= (-4.9d+33)) .or. (.not. (t <= 1.2d-100))) then
tmp = a * (((-4.0d0) * (t / c_m)) + (b / (z * (c_m * a))))
else
tmp = (b + (y * (x * 9.0d0))) / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((t <= -4.9e+33) || !(t <= 1.2e-100)) {
tmp = a * ((-4.0 * (t / c_m)) + (b / (z * (c_m * a))));
} else {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (t <= -4.9e+33) or not (t <= 1.2e-100): tmp = a * ((-4.0 * (t / c_m)) + (b / (z * (c_m * a)))) else: tmp = (b + (y * (x * 9.0))) / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((t <= -4.9e+33) || !(t <= 1.2e-100)) tmp = Float64(a * Float64(Float64(-4.0 * Float64(t / c_m)) + Float64(b / Float64(z * Float64(c_m * a))))); else tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c); c\_s = sign(c) * abs(1.0); function tmp_2 = code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0; if ((t <= -4.9e+33) || ~((t <= 1.2e-100))) tmp = a * ((-4.0 * (t / c_m)) + (b / (z * (c_m * a)))); else tmp = (b + (y * (x * 9.0))) / (c_m * z); end tmp_2 = c_s * tmp; end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[t, -4.9e+33], N[Not[LessEqual[t, 1.2e-100]], $MachinePrecision]], N[(a * N[(N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * N[(c$95$m * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{+33} \lor \neg \left(t \leq 1.2 \cdot 10^{-100}\right):\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m} + \frac{b}{z \cdot \left(c\_m \cdot a\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -4.90000000000000014e33 or 1.2000000000000001e-100 < t Initial program 76.0%
associate-+l-76.0%
*-commutative76.0%
associate-*r*78.9%
*-commutative78.9%
associate-+l-78.9%
Simplified78.9%
Taylor expanded in x around inf 66.2%
Taylor expanded in a around inf 66.4%
Taylor expanded in x around 0 67.1%
associate-*r*65.7%
Simplified65.7%
if -4.90000000000000014e33 < t < 1.2000000000000001e-100Initial program 86.1%
associate-+l-86.1%
*-commutative86.1%
associate-*r*81.9%
*-commutative81.9%
associate-+l-81.9%
associate-*l*81.8%
associate-*l*87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in z around inf 85.9%
Taylor expanded in z around 0 77.0%
associate-*r*76.9%
Simplified76.9%
Final simplification70.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= b -9e+38)
(/ (+ b (* z (* t (* a -4.0)))) (* c_m z))
(if (<= b 28500000.0)
(/ (- (* 9.0 (/ (* x y) z)) (* (* t a) 4.0)) c_m)
(/ (- b (* (* a (* z t)) 4.0)) (* c_m z))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -9e+38) {
tmp = (b + (z * (t * (a * -4.0)))) / (c_m * z);
} else if (b <= 28500000.0) {
tmp = ((9.0 * ((x * y) / z)) - ((t * a) * 4.0)) / c_m;
} else {
tmp = (b - ((a * (z * t)) * 4.0)) / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (b <= (-9d+38)) then
tmp = (b + (z * (t * (a * (-4.0d0))))) / (c_m * z)
else if (b <= 28500000.0d0) then
tmp = ((9.0d0 * ((x * y) / z)) - ((t * a) * 4.0d0)) / c_m
else
tmp = (b - ((a * (z * t)) * 4.0d0)) / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -9e+38) {
tmp = (b + (z * (t * (a * -4.0)))) / (c_m * z);
} else if (b <= 28500000.0) {
tmp = ((9.0 * ((x * y) / z)) - ((t * a) * 4.0)) / c_m;
} else {
tmp = (b - ((a * (z * t)) * 4.0)) / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if b <= -9e+38: tmp = (b + (z * (t * (a * -4.0)))) / (c_m * z) elif b <= 28500000.0: tmp = ((9.0 * ((x * y) / z)) - ((t * a) * 4.0)) / c_m else: tmp = (b - ((a * (z * t)) * 4.0)) / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (b <= -9e+38) tmp = Float64(Float64(b + Float64(z * Float64(t * Float64(a * -4.0)))) / Float64(c_m * z)); elseif (b <= 28500000.0) tmp = Float64(Float64(Float64(9.0 * Float64(Float64(x * y) / z)) - Float64(Float64(t * a) * 4.0)) / c_m); else tmp = Float64(Float64(b - Float64(Float64(a * Float64(z * t)) * 4.0)) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c); c\_s = sign(c) * abs(1.0); function tmp_2 = code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0; if (b <= -9e+38) tmp = (b + (z * (t * (a * -4.0)))) / (c_m * z); elseif (b <= 28500000.0) tmp = ((9.0 * ((x * y) / z)) - ((t * a) * 4.0)) / c_m; else tmp = (b - ((a * (z * t)) * 4.0)) / (c_m * z); end tmp_2 = c_s * tmp; end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[b, -9e+38], N[(N[(b + N[(z * N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 28500000.0], N[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(N[(t * a), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(b - N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -9 \cdot 10^{+38}:\\
\;\;\;\;\frac{b + z \cdot \left(t \cdot \left(a \cdot -4\right)\right)}{c\_m \cdot z}\\
\mathbf{elif}\;b \leq 28500000:\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z} - \left(t \cdot a\right) \cdot 4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b - \left(a \cdot \left(z \cdot t\right)\right) \cdot 4}{c\_m \cdot z}\\
\end{array}
\end{array}
if b < -8.99999999999999961e38Initial program 84.1%
associate-+l-84.1%
*-commutative84.1%
associate-*r*86.0%
*-commutative86.0%
associate-+l-86.0%
associate-*l*86.0%
associate-*l*87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in z around inf 85.9%
Taylor expanded in x around 0 79.0%
associate-*r*79.0%
Simplified79.0%
if -8.99999999999999961e38 < b < 2.85e7Initial program 77.0%
associate-+l-77.0%
*-commutative77.0%
associate-*r*77.6%
*-commutative77.6%
associate-+l-77.6%
associate-*l*77.6%
associate-*l*80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in z around inf 80.2%
Taylor expanded in b around 0 82.6%
if 2.85e7 < b Initial program 86.3%
associate-+l-86.3%
*-commutative86.3%
associate-*r*81.3%
*-commutative81.3%
associate-+l-81.3%
associate-*l*81.3%
associate-*l*81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in x around 0 78.9%
Final simplification81.0%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= b -1.02e+40)
(/ (/ b c_m) z)
(if (<= b -6.8e-163)
(* 9.0 (* x (/ y (* c_m z))))
(if (<= b 4e-13) (* -4.0 (/ (* t a) c_m)) (/ 1.0 (* z (/ c_m b))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -1.02e+40) {
tmp = (b / c_m) / z;
} else if (b <= -6.8e-163) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (b <= 4e-13) {
tmp = -4.0 * ((t * a) / c_m);
} else {
tmp = 1.0 / (z * (c_m / b));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (b <= (-1.02d+40)) then
tmp = (b / c_m) / z
else if (b <= (-6.8d-163)) then
tmp = 9.0d0 * (x * (y / (c_m * z)))
else if (b <= 4d-13) then
tmp = (-4.0d0) * ((t * a) / c_m)
else
tmp = 1.0d0 / (z * (c_m / b))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -1.02e+40) {
tmp = (b / c_m) / z;
} else if (b <= -6.8e-163) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (b <= 4e-13) {
tmp = -4.0 * ((t * a) / c_m);
} else {
tmp = 1.0 / (z * (c_m / b));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if b <= -1.02e+40: tmp = (b / c_m) / z elif b <= -6.8e-163: tmp = 9.0 * (x * (y / (c_m * z))) elif b <= 4e-13: tmp = -4.0 * ((t * a) / c_m) else: tmp = 1.0 / (z * (c_m / b)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (b <= -1.02e+40) tmp = Float64(Float64(b / c_m) / z); elseif (b <= -6.8e-163) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); elseif (b <= 4e-13) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); else tmp = Float64(1.0 / Float64(z * Float64(c_m / b))); end return Float64(c_s * tmp) end
c\_m = abs(c); c\_s = sign(c) * abs(1.0); function tmp_2 = code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0; if (b <= -1.02e+40) tmp = (b / c_m) / z; elseif (b <= -6.8e-163) tmp = 9.0 * (x * (y / (c_m * z))); elseif (b <= 4e-13) tmp = -4.0 * ((t * a) / c_m); else tmp = 1.0 / (z * (c_m / b)); end tmp_2 = c_s * tmp; end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[b, -1.02e+40], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, -6.8e-163], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4e-13], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(c$95$m / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -1.02 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;b \leq -6.8 \cdot 10^{-163}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\mathbf{elif}\;b \leq 4 \cdot 10^{-13}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{c\_m}{b}}\\
\end{array}
\end{array}
if b < -1.02e40Initial program 83.8%
associate-+l-83.8%
*-commutative83.8%
associate-*r*85.8%
*-commutative85.8%
associate-+l-85.8%
associate-*l*85.8%
associate-*l*87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in t around inf 84.0%
Taylor expanded in b around inf 63.9%
associate-/r*66.1%
Simplified66.1%
if -1.02e40 < b < -6.80000000000000028e-163Initial program 69.4%
associate-+l-69.4%
*-commutative69.4%
associate-*r*71.7%
*-commutative71.7%
associate-+l-71.7%
Simplified71.6%
Taylor expanded in x around inf 46.5%
associate-/l*51.3%
*-commutative51.3%
Simplified51.3%
if -6.80000000000000028e-163 < b < 4.0000000000000001e-13Initial program 79.7%
associate-+l-79.7%
*-commutative79.7%
associate-*r*79.7%
*-commutative79.7%
associate-+l-79.7%
Simplified79.7%
Taylor expanded in t around inf 53.5%
if 4.0000000000000001e-13 < b Initial program 87.0%
associate-+l-87.0%
*-commutative87.0%
associate-*r*82.2%
*-commutative82.2%
associate-+l-82.2%
Simplified82.2%
Taylor expanded in b around inf 63.5%
*-commutative63.5%
Simplified63.5%
clear-num63.6%
inv-pow63.6%
Applied egg-rr63.6%
unpow-163.6%
associate-/l*64.9%
Simplified64.9%
Final simplification58.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -1.45e+77)
(* (* a -4.0) (/ t c_m))
(if (<= t 1.3e-22)
(/ (+ b (* y (* x 9.0))) (* c_m z))
(* a (/ (* t -4.0) c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1.45e+77) {
tmp = (a * -4.0) * (t / c_m);
} else if (t <= 1.3e-22) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (t <= (-1.45d+77)) then
tmp = (a * (-4.0d0)) * (t / c_m)
else if (t <= 1.3d-22) then
tmp = (b + (y * (x * 9.0d0))) / (c_m * z)
else
tmp = a * ((t * (-4.0d0)) / c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1.45e+77) {
tmp = (a * -4.0) * (t / c_m);
} else if (t <= 1.3e-22) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -1.45e+77: tmp = (a * -4.0) * (t / c_m) elif t <= 1.3e-22: tmp = (b + (y * (x * 9.0))) / (c_m * z) else: tmp = a * ((t * -4.0) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -1.45e+77) tmp = Float64(Float64(a * -4.0) * Float64(t / c_m)); elseif (t <= 1.3e-22) tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(c_m * z)); else tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c); c\_s = sign(c) * abs(1.0); function tmp_2 = code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0; if (t <= -1.45e+77) tmp = (a * -4.0) * (t / c_m); elseif (t <= 1.3e-22) tmp = (b + (y * (x * 9.0))) / (c_m * z); else tmp = a * ((t * -4.0) / c_m); end tmp_2 = c_s * tmp; end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -1.45e+77], N[(N[(a * -4.0), $MachinePrecision] * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-22], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+77}:\\
\;\;\;\;\left(a \cdot -4\right) \cdot \frac{t}{c\_m}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-22}:\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\end{array}
\end{array}
if t < -1.4500000000000001e77Initial program 72.8%
associate-+l-72.8%
*-commutative72.8%
associate-*r*75.3%
*-commutative75.3%
associate-+l-75.3%
associate-*l*75.3%
associate-*l*75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in t around inf 75.2%
Taylor expanded in t around inf 64.1%
associate-*r/66.2%
associate-*r*66.2%
Simplified66.2%
if -1.4500000000000001e77 < t < 1.3e-22Initial program 86.5%
associate-+l-86.5%
*-commutative86.5%
associate-*r*82.5%
*-commutative82.5%
associate-+l-82.5%
associate-*l*82.5%
associate-*l*87.1%
*-commutative87.1%
Simplified87.1%
Taylor expanded in z around inf 85.7%
Taylor expanded in z around 0 73.7%
associate-*r*73.7%
Simplified73.7%
if 1.3e-22 < t Initial program 73.2%
associate-+l-73.2%
*-commutative73.2%
associate-*r*78.8%
*-commutative78.8%
associate-+l-78.8%
Simplified78.8%
Taylor expanded in t around inf 44.5%
*-commutative44.5%
associate-/l*48.3%
associate-*r*48.3%
*-commutative48.3%
*-commutative48.3%
associate-*l/48.3%
Simplified48.3%
Final simplification65.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -1.75e+77)
(* (* a -4.0) (/ t c_m))
(if (<= t 1.2e-21)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(* a (/ (* t -4.0) c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1.75e+77) {
tmp = (a * -4.0) * (t / c_m);
} else if (t <= 1.2e-21) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (t <= (-1.75d+77)) then
tmp = (a * (-4.0d0)) * (t / c_m)
else if (t <= 1.2d-21) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = a * ((t * (-4.0d0)) / c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1.75e+77) {
tmp = (a * -4.0) * (t / c_m);
} else if (t <= 1.2e-21) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -1.75e+77: tmp = (a * -4.0) * (t / c_m) elif t <= 1.2e-21: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = a * ((t * -4.0) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -1.75e+77) tmp = Float64(Float64(a * -4.0) * Float64(t / c_m)); elseif (t <= 1.2e-21) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c); c\_s = sign(c) * abs(1.0); function tmp_2 = code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0; if (t <= -1.75e+77) tmp = (a * -4.0) * (t / c_m); elseif (t <= 1.2e-21) tmp = (b + (9.0 * (x * y))) / (c_m * z); else tmp = a * ((t * -4.0) / c_m); end tmp_2 = c_s * tmp; end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -1.75e+77], N[(N[(a * -4.0), $MachinePrecision] * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-21], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+77}:\\
\;\;\;\;\left(a \cdot -4\right) \cdot \frac{t}{c\_m}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\end{array}
\end{array}
if t < -1.7500000000000001e77Initial program 72.8%
associate-+l-72.8%
*-commutative72.8%
associate-*r*75.3%
*-commutative75.3%
associate-+l-75.3%
associate-*l*75.3%
associate-*l*75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in t around inf 75.2%
Taylor expanded in t around inf 64.1%
associate-*r/66.2%
associate-*r*66.2%
Simplified66.2%
if -1.7500000000000001e77 < t < 1.2e-21Initial program 86.5%
associate-+l-86.5%
*-commutative86.5%
associate-*r*82.5%
*-commutative82.5%
associate-+l-82.5%
Simplified82.5%
Taylor expanded in t around 0 73.7%
+-commutative73.7%
*-commutative73.7%
Simplified73.7%
if 1.2e-21 < t Initial program 73.2%
associate-+l-73.2%
*-commutative73.2%
associate-*r*78.8%
*-commutative78.8%
associate-+l-78.8%
Simplified78.8%
Taylor expanded in t around inf 44.5%
*-commutative44.5%
associate-/l*48.3%
associate-*r*48.3%
*-commutative48.3%
*-commutative48.3%
associate-*l/48.3%
Simplified48.3%
Final simplification65.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= b -4e-28) (not (<= b 3.7e-20)))
(/ (/ b c_m) z)
(* -4.0 (/ (* t a) c_m)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((b <= -4e-28) || !(b <= 3.7e-20)) {
tmp = (b / c_m) / z;
} else {
tmp = -4.0 * ((t * a) / c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if ((b <= (-4d-28)) .or. (.not. (b <= 3.7d-20))) then
tmp = (b / c_m) / z
else
tmp = (-4.0d0) * ((t * a) / c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((b <= -4e-28) || !(b <= 3.7e-20)) {
tmp = (b / c_m) / z;
} else {
tmp = -4.0 * ((t * a) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (b <= -4e-28) or not (b <= 3.7e-20): tmp = (b / c_m) / z else: tmp = -4.0 * ((t * a) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((b <= -4e-28) || !(b <= 3.7e-20)) tmp = Float64(Float64(b / c_m) / z); else tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c); c\_s = sign(c) * abs(1.0); function tmp_2 = code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0; if ((b <= -4e-28) || ~((b <= 3.7e-20))) tmp = (b / c_m) / z; else tmp = -4.0 * ((t * a) / c_m); end tmp_2 = c_s * tmp; end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[b, -4e-28], N[Not[LessEqual[b, 3.7e-20]], $MachinePrecision]], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-28} \lor \neg \left(b \leq 3.7 \cdot 10^{-20}\right):\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\end{array}
\end{array}
if b < -3.99999999999999988e-28 or 3.7000000000000001e-20 < b Initial program 85.0%
associate-+l-85.0%
*-commutative85.0%
associate-*r*83.7%
*-commutative83.7%
associate-+l-83.7%
associate-*l*83.7%
associate-*l*84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in t around inf 81.5%
Taylor expanded in b around inf 60.2%
associate-/r*61.1%
Simplified61.1%
if -3.99999999999999988e-28 < b < 3.7000000000000001e-20Initial program 75.9%
associate-+l-75.9%
*-commutative75.9%
associate-*r*76.7%
*-commutative76.7%
associate-+l-76.7%
Simplified76.6%
Taylor expanded in t around inf 48.8%
Final simplification55.2%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= b -5.2e-28)
(/ (/ b c_m) z)
(if (<= b 7.5e-16) (* -4.0 (/ (* t a) c_m)) (/ 1.0 (* z (/ c_m b)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -5.2e-28) {
tmp = (b / c_m) / z;
} else if (b <= 7.5e-16) {
tmp = -4.0 * ((t * a) / c_m);
} else {
tmp = 1.0 / (z * (c_m / b));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (b <= (-5.2d-28)) then
tmp = (b / c_m) / z
else if (b <= 7.5d-16) then
tmp = (-4.0d0) * ((t * a) / c_m)
else
tmp = 1.0d0 / (z * (c_m / b))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -5.2e-28) {
tmp = (b / c_m) / z;
} else if (b <= 7.5e-16) {
tmp = -4.0 * ((t * a) / c_m);
} else {
tmp = 1.0 / (z * (c_m / b));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if b <= -5.2e-28: tmp = (b / c_m) / z elif b <= 7.5e-16: tmp = -4.0 * ((t * a) / c_m) else: tmp = 1.0 / (z * (c_m / b)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (b <= -5.2e-28) tmp = Float64(Float64(b / c_m) / z); elseif (b <= 7.5e-16) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); else tmp = Float64(1.0 / Float64(z * Float64(c_m / b))); end return Float64(c_s * tmp) end
c\_m = abs(c); c\_s = sign(c) * abs(1.0); function tmp_2 = code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0; if (b <= -5.2e-28) tmp = (b / c_m) / z; elseif (b <= 7.5e-16) tmp = -4.0 * ((t * a) / c_m); else tmp = 1.0 / (z * (c_m / b)); end tmp_2 = c_s * tmp; end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[b, -5.2e-28], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, 7.5e-16], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(c$95$m / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -5.2 \cdot 10^{-28}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;b \leq 7.5 \cdot 10^{-16}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{c\_m}{b}}\\
\end{array}
\end{array}
if b < -5.2e-28Initial program 83.3%
associate-+l-83.3%
*-commutative83.3%
associate-*r*84.9%
*-commutative84.9%
associate-+l-84.9%
associate-*l*84.9%
associate-*l*86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in t around inf 82.2%
Taylor expanded in b around inf 57.4%
associate-/r*58.8%
Simplified58.8%
if -5.2e-28 < b < 7.5e-16Initial program 75.9%
associate-+l-75.9%
*-commutative75.9%
associate-*r*76.7%
*-commutative76.7%
associate-+l-76.7%
Simplified76.6%
Taylor expanded in t around inf 48.8%
if 7.5e-16 < b Initial program 87.0%
associate-+l-87.0%
*-commutative87.0%
associate-*r*82.2%
*-commutative82.2%
associate-+l-82.2%
Simplified82.2%
Taylor expanded in b around inf 63.5%
*-commutative63.5%
Simplified63.5%
clear-num63.6%
inv-pow63.6%
Applied egg-rr63.6%
unpow-163.6%
associate-/l*64.9%
Simplified64.9%
Final simplification55.4%
c\_m = (fabs.f64 c) c\_s = (copysign.f64 #s(literal 1 binary64) c) (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ b (* c_m z))))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
code = c_s * (b / (c_m * z))
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) def code(c_s, x, y, z, t, a, b, c_m): return c_s * (b / (c_m * z))
c\_m = abs(c) c\_s = copysign(1.0, c) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(b / Float64(c_m * z))) end
c\_m = abs(c); c\_s = sign(c) * abs(1.0); function tmp = code(c_s, x, y, z, t, a, b, c_m) tmp = c_s * (b / (c_m * z)); end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
c\_s \cdot \frac{b}{c\_m \cdot z}
\end{array}
Initial program 80.6%
associate-+l-80.6%
*-commutative80.6%
associate-*r*80.3%
*-commutative80.3%
associate-+l-80.3%
Simplified80.3%
Taylor expanded in b around inf 37.0%
*-commutative37.0%
Simplified37.0%
Final simplification37.0%
(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 2024172
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -220031348160821/200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 0) (/ (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 365902434742109/31250000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 28768236795461370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ (* (* 9 (/ y c)) (/ x z)) (/ b (* c z))) (* 4 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 138385150424563190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (- (+ (* 9 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4 (/ (* a t) c)))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))