
(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}
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c_m))))
(*
c_s
(if (<= t_1 -1e-286)
(/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c_m))
(if (<= t_1 0.0)
(/
(+
(* -4.0 (/ (* a (* z t)) c_m))
(+ (* 9.0 (/ (* x y) c_m)) (/ b c_m)))
z)
(if (<= t_1 INFINITY)
t_1
(*
y
(fma
-4.0
(* (/ a c_m) (/ t y))
(fma 9.0 (/ (/ x c_m) z) (/ b (* c_m (* y z))))))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double tmp;
if (t_1 <= -1e-286) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) / c_m)) + (b / c_m))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = y * fma(-4.0, ((a / c_m) * (t / y)), fma(9.0, ((x / c_m) / z), (b / (c_m * (y * z)))));
}
return c_s * tmp;
}
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -1e-286) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(z * c_m)); elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m)) + Float64(Float64(9.0 * Float64(Float64(x * y) / c_m)) + Float64(b / c_m))) / z); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(y * fma(-4.0, Float64(Float64(a / c_m) * Float64(t / y)), fma(9.0, Float64(Float64(x / c_m) / z), Float64(b / Float64(c_m * Float64(y * z)))))); 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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = 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$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e-286], 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$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(y * N[(-4.0 * N[(N[(a / c$95$m), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x / c$95$m), $MachinePrecision] / z), $MachinePrecision] + N[(b / N[(c$95$m * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \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\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-286}:\\
\;\;\;\;\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\_m}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{-4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m} + \left(9 \cdot \frac{x \cdot y}{c\_m} + \frac{b}{c\_m}\right)}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \mathsf{fma}\left(-4, \frac{a}{c\_m} \cdot \frac{t}{y}, \mathsf{fma}\left(9, \frac{\frac{x}{c\_m}}{z}, \frac{b}{c\_m \cdot \left(y \cdot z\right)}\right)\right)\\
\end{array}
\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)) < -1.00000000000000005e-286Initial program 93.2%
+-commutative93.2%
associate-+r-93.2%
*-commutative93.2%
associate-*r*93.2%
*-commutative93.2%
associate-+r-93.2%
+-commutative93.2%
associate-*l*93.2%
associate-*l*92.3%
*-commutative92.3%
Simplified92.3%
if -1.00000000000000005e-286 < (/.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)) < 0.0Initial program 30.7%
+-commutative30.7%
associate-+r-30.7%
*-commutative30.7%
associate-*r*28.9%
*-commutative28.9%
associate-+r-28.9%
+-commutative28.9%
associate-*l*28.9%
associate-*l*30.7%
*-commutative30.7%
Simplified30.7%
Taylor expanded in z around 0 99.4%
if 0.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)) < +inf.0Initial program 93.6%
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%
+-commutative0.0%
associate-+r-0.0%
*-commutative0.0%
associate-*r*9.5%
*-commutative9.5%
associate-+r-9.5%
+-commutative9.5%
associate-*l*9.5%
associate-*l*9.5%
*-commutative9.5%
Simplified9.5%
Taylor expanded in y around inf 33.5%
cancel-sign-sub-inv33.5%
metadata-eval33.5%
+-commutative33.5%
fma-define33.5%
times-frac51.4%
fma-define51.4%
associate-/r*72.8%
*-commutative72.8%
Simplified72.8%
Final simplification91.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c_m))))
(*
c_s
(if (<= t_1 -2e-151)
(/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c_m))
(if (or (<= t_1 0.0) (not (<= t_1 INFINITY)))
(/ (* t (+ (* a -4.0) (/ b (* z t)))) c_m)
t_1)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double tmp;
if (t_1 <= -2e-151) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
} else if ((t_1 <= 0.0) || !(t_1 <= ((double) INFINITY))) {
tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m;
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double tmp;
if (t_1 <= -2e-151) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
} else if ((t_1 <= 0.0) || !(t_1 <= Double.POSITIVE_INFINITY)) {
tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m;
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m) tmp = 0 if t_1 <= -2e-151: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m) elif (t_1 <= 0.0) or not (t_1 <= math.inf): tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m else: tmp = t_1 return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -2e-151) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(z * c_m)); elseif ((t_1 <= 0.0) || !(t_1 <= Inf)) tmp = Float64(Float64(t * Float64(Float64(a * -4.0) + Float64(b / Float64(z * t)))) / c_m); else tmp = t_1; end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
tmp = 0.0;
if (t_1 <= -2e-151)
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
elseif ((t_1 <= 0.0) || ~((t_1 <= Inf)))
tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m;
else
tmp = t_1;
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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = 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$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -2e-151], 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$95$m), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, 0.0], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] + N[(b / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \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\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-151}:\\
\;\;\;\;\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\_m}\\
\mathbf{elif}\;t\_1 \leq 0 \lor \neg \left(t\_1 \leq \infty\right):\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4 + \frac{b}{z \cdot t}\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\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)) < -1.9999999999999999e-151Initial program 93.0%
+-commutative93.0%
associate-+r-93.0%
*-commutative93.0%
associate-*r*93.0%
*-commutative93.0%
associate-+r-93.0%
+-commutative93.0%
associate-*l*92.9%
associate-*l*92.0%
*-commutative92.0%
Simplified92.0%
if -1.9999999999999999e-151 < (/.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)) < 0.0 or +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 22.5%
+-commutative22.5%
associate-+r-22.5%
*-commutative22.5%
associate-*r*26.0%
*-commutative26.0%
associate-+r-26.0%
+-commutative26.0%
associate-*l*26.0%
associate-*l*26.9%
*-commutative26.9%
Simplified26.9%
Taylor expanded in x around 0 24.9%
Taylor expanded in t around inf 68.9%
Taylor expanded in c around 0 67.0%
if 0.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)) < +inf.0Initial program 93.6%
Final simplification87.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c_m))))
(*
c_s
(if (<= t_1 -1e-286)
(/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c_m))
(if (<= t_1 0.0)
(/
(+
(* -4.0 (/ (* a (* z t)) c_m))
(+ (* 9.0 (/ (* x y) c_m)) (/ b c_m)))
z)
(if (<= t_1 INFINITY)
t_1
(/ (* t (+ (* a -4.0) (/ b (* z t)))) c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double tmp;
if (t_1 <= -1e-286) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) / c_m)) + (b / c_m))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m;
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double tmp;
if (t_1 <= -1e-286) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) / c_m)) + (b / c_m))) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m) tmp = 0 if t_1 <= -1e-286: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m) elif t_1 <= 0.0: tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) / c_m)) + (b / c_m))) / z elif t_1 <= math.inf: tmp = t_1 else: tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -1e-286) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(z * c_m)); elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m)) + Float64(Float64(9.0 * Float64(Float64(x * y) / c_m)) + Float64(b / c_m))) / z); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(t * Float64(Float64(a * -4.0) + Float64(b / Float64(z * t)))) / c_m); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
tmp = 0.0;
if (t_1 <= -1e-286)
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
elseif (t_1 <= 0.0)
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) / c_m)) + (b / c_m))) / z;
elseif (t_1 <= Inf)
tmp = t_1;
else
tmp = (t * ((a * -4.0) + (b / (z * t)))) / 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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = 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$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e-286], 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$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] + N[(b / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \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\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-286}:\\
\;\;\;\;\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\_m}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{-4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m} + \left(9 \cdot \frac{x \cdot y}{c\_m} + \frac{b}{c\_m}\right)}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4 + \frac{b}{z \cdot t}\right)}{c\_m}\\
\end{array}
\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)) < -1.00000000000000005e-286Initial program 93.2%
+-commutative93.2%
associate-+r-93.2%
*-commutative93.2%
associate-*r*93.2%
*-commutative93.2%
associate-+r-93.2%
+-commutative93.2%
associate-*l*93.2%
associate-*l*92.3%
*-commutative92.3%
Simplified92.3%
if -1.00000000000000005e-286 < (/.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)) < 0.0Initial program 30.7%
+-commutative30.7%
associate-+r-30.7%
*-commutative30.7%
associate-*r*28.9%
*-commutative28.9%
associate-+r-28.9%
+-commutative28.9%
associate-*l*28.9%
associate-*l*30.7%
*-commutative30.7%
Simplified30.7%
Taylor expanded in z around 0 99.4%
if 0.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)) < +inf.0Initial program 93.6%
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%
+-commutative0.0%
associate-+r-0.0%
*-commutative0.0%
associate-*r*9.5%
*-commutative9.5%
associate-+r-9.5%
+-commutative9.5%
associate-*l*9.5%
associate-*l*9.5%
*-commutative9.5%
Simplified9.5%
Taylor expanded in x around 0 5.4%
Taylor expanded in t around inf 51.4%
Taylor expanded in c around 0 55.5%
Final simplification90.3%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -4.4e+134) (not (<= z 2.6e+247)))
(/ (* t (+ (* a -4.0) (/ b (* z t)))) c_m)
(/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c_m)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -4.4e+134) || !(z <= 2.6e+247)) {
tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m;
} else {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 ((z <= (-4.4d+134)) .or. (.not. (z <= 2.6d+247))) then
tmp = (t * ((a * (-4.0d0)) + (b / (z * t)))) / c_m
else
tmp = (b + ((x * (9.0d0 * y)) - ((z * 4.0d0) * (t * a)))) / (z * c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 ((z <= -4.4e+134) || !(z <= 2.6e+247)) {
tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m;
} else {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -4.4e+134) or not (z <= 2.6e+247): tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m else: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -4.4e+134) || !(z <= 2.6e+247)) tmp = Float64(Float64(t * Float64(Float64(a * -4.0) + Float64(b / Float64(z * t)))) / c_m); else tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(z * c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -4.4e+134) || ~((z <= 2.6e+247)))
tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m;
else
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * 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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -4.4e+134], N[Not[LessEqual[z, 2.6e+247]], $MachinePrecision]], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] + N[(b / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], 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$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+134} \lor \neg \left(z \leq 2.6 \cdot 10^{+247}\right):\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4 + \frac{b}{z \cdot t}\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\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\_m}\\
\end{array}
\end{array}
if z < -4.4e134 or 2.59999999999999991e247 < z Initial program 51.9%
+-commutative51.9%
associate-+r-51.9%
*-commutative51.9%
associate-*r*47.8%
*-commutative47.8%
associate-+r-47.8%
+-commutative47.8%
associate-*l*47.8%
associate-*l*53.7%
*-commutative53.7%
Simplified53.7%
Taylor expanded in x around 0 47.4%
Taylor expanded in t around inf 77.4%
Taylor expanded in c around 0 80.8%
if -4.4e134 < z < 2.59999999999999991e247Initial program 87.2%
+-commutative87.2%
associate-+r-87.2%
*-commutative87.2%
associate-*r*88.5%
*-commutative88.5%
associate-+r-88.5%
+-commutative88.5%
associate-*l*88.5%
associate-*l*88.3%
*-commutative88.3%
Simplified88.3%
Final simplification86.7%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -4e+43)
(* a (/ (* t -4.0) c_m))
(if (<= z -5e-300)
(/ (/ b c_m) z)
(if (<= z 1.45e+51)
(* 9.0 (* x (/ (/ y c_m) z)))
(* -4.0 (/ (* t a) c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -4e+43) {
tmp = a * ((t * -4.0) / c_m);
} else if (z <= -5e-300) {
tmp = (b / c_m) / z;
} else if (z <= 1.45e+51) {
tmp = 9.0 * (x * ((y / 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)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (z <= (-4d+43)) then
tmp = a * ((t * (-4.0d0)) / c_m)
else if (z <= (-5d-300)) then
tmp = (b / c_m) / z
else if (z <= 1.45d+51) then
tmp = 9.0d0 * (x * ((y / 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);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (z <= -4e+43) {
tmp = a * ((t * -4.0) / c_m);
} else if (z <= -5e-300) {
tmp = (b / c_m) / z;
} else if (z <= 1.45e+51) {
tmp = 9.0 * (x * ((y / 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) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -4e+43: tmp = a * ((t * -4.0) / c_m) elif z <= -5e-300: tmp = (b / c_m) / z elif z <= 1.45e+51: tmp = 9.0 * (x * ((y / 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) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -4e+43) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); elseif (z <= -5e-300) tmp = Float64(Float64(b / c_m) / z); elseif (z <= 1.45e+51) tmp = Float64(9.0 * Float64(x * Float64(Float64(y / 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);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -4e+43)
tmp = a * ((t * -4.0) / c_m);
elseif (z <= -5e-300)
tmp = (b / c_m) / z;
elseif (z <= 1.45e+51)
tmp = 9.0 * (x * ((y / 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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -4e+43], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5e-300], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.45e+51], N[(9.0 * N[(x * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $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)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+43}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-300}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+51}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{\frac{y}{c\_m}}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\end{array}
\end{array}
if z < -4.00000000000000006e43Initial program 56.4%
+-commutative56.4%
associate-+r-56.4%
*-commutative56.4%
associate-*r*61.7%
*-commutative61.7%
associate-+r-61.7%
+-commutative61.7%
associate-*l*61.8%
associate-*l*64.0%
*-commutative64.0%
Simplified64.0%
Taylor expanded in z around inf 63.0%
*-commutative63.0%
associate-/l*64.5%
associate-*r*64.5%
associate-*l/64.5%
Simplified64.5%
if -4.00000000000000006e43 < z < -4.99999999999999996e-300Initial program 94.8%
+-commutative94.8%
associate-+r-94.8%
*-commutative94.8%
associate-*r*94.9%
*-commutative94.9%
associate-+r-94.9%
+-commutative94.9%
associate-*l*94.9%
associate-*l*92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in b around inf 53.2%
associate-/r*54.4%
Simplified54.4%
if -4.99999999999999996e-300 < z < 1.4499999999999999e51Initial program 95.3%
+-commutative95.3%
associate-+r-95.3%
*-commutative95.3%
associate-*r*94.6%
*-commutative94.6%
associate-+r-94.6%
+-commutative94.6%
associate-*l*94.5%
associate-*l*92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in x around inf 58.7%
associate-/l*58.8%
associate-/r*58.8%
Simplified58.8%
if 1.4499999999999999e51 < z Initial program 63.4%
+-commutative63.4%
associate-+r-63.4%
*-commutative63.4%
associate-*r*59.8%
*-commutative59.8%
associate-+r-59.8%
+-commutative59.8%
associate-*l*59.8%
associate-*l*68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in z around inf 64.7%
*-commutative64.7%
Simplified64.7%
Final simplification60.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -1.5e+46) (not (<= z 1.7e+28)))
(+ (* -4.0 (* a (/ t c_m))) (/ b (* z c_m)))
(/ (+ b (* x (* 9.0 y))) (* z c_m)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -1.5e+46) || !(z <= 1.7e+28)) {
tmp = (-4.0 * (a * (t / c_m))) + (b / (z * c_m));
} else {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 ((z <= (-1.5d+46)) .or. (.not. (z <= 1.7d+28))) then
tmp = ((-4.0d0) * (a * (t / c_m))) + (b / (z * c_m))
else
tmp = (b + (x * (9.0d0 * y))) / (z * c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 ((z <= -1.5e+46) || !(z <= 1.7e+28)) {
tmp = (-4.0 * (a * (t / c_m))) + (b / (z * c_m));
} else {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -1.5e+46) or not (z <= 1.7e+28): tmp = (-4.0 * (a * (t / c_m))) + (b / (z * c_m)) else: tmp = (b + (x * (9.0 * y))) / (z * c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -1.5e+46) || !(z <= 1.7e+28)) tmp = Float64(Float64(-4.0 * Float64(a * Float64(t / c_m))) + Float64(b / Float64(z * c_m))); else tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -1.5e+46) || ~((z <= 1.7e+28)))
tmp = (-4.0 * (a * (t / c_m))) + (b / (z * c_m));
else
tmp = (b + (x * (9.0 * y))) / (z * 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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -1.5e+46], N[Not[LessEqual[z, 1.7e+28]], $MachinePrecision]], N[(N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+46} \lor \neg \left(z \leq 1.7 \cdot 10^{+28}\right):\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right) + \frac{b}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c\_m}\\
\end{array}
\end{array}
if z < -1.50000000000000012e46 or 1.7e28 < z Initial program 60.7%
+-commutative60.7%
associate-+r-60.7%
*-commutative60.7%
associate-*r*61.2%
*-commutative61.2%
associate-+r-61.2%
+-commutative61.2%
associate-*l*61.2%
associate-*l*66.6%
*-commutative66.6%
Simplified66.6%
Taylor expanded in y around inf 68.2%
Taylor expanded in y around 0 73.5%
cancel-sign-sub-inv73.5%
metadata-eval73.5%
*-commutative73.5%
associate-/l*70.7%
Simplified70.7%
if -1.50000000000000012e46 < z < 1.7e28Initial program 95.6%
+-commutative95.6%
associate-+r-95.6%
*-commutative95.6%
associate-*r*95.3%
*-commutative95.3%
associate-+r-95.3%
+-commutative95.3%
associate-*l*95.3%
associate-*l*92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in x around inf 86.4%
associate-*r*86.4%
*-commutative86.4%
associate-*r*86.4%
Simplified86.4%
Final simplification79.2%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -1.45e+35)
(/ (* t (+ (* a -4.0) (/ b (* z t)))) c_m)
(if (<= z 5.4e+26)
(/ (+ b (* x (* 9.0 y))) (* z c_m))
(+ (* -4.0 (* a (/ t c_m))) (/ b (* z c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -1.45e+35) {
tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m;
} else if (z <= 5.4e+26) {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
} else {
tmp = (-4.0 * (a * (t / c_m))) + (b / (z * c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (z <= (-1.45d+35)) then
tmp = (t * ((a * (-4.0d0)) + (b / (z * t)))) / c_m
else if (z <= 5.4d+26) then
tmp = (b + (x * (9.0d0 * y))) / (z * c_m)
else
tmp = ((-4.0d0) * (a * (t / c_m))) + (b / (z * c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (z <= -1.45e+35) {
tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m;
} else if (z <= 5.4e+26) {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
} else {
tmp = (-4.0 * (a * (t / c_m))) + (b / (z * c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -1.45e+35: tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m elif z <= 5.4e+26: tmp = (b + (x * (9.0 * y))) / (z * c_m) else: tmp = (-4.0 * (a * (t / c_m))) + (b / (z * c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -1.45e+35) tmp = Float64(Float64(t * Float64(Float64(a * -4.0) + Float64(b / Float64(z * t)))) / c_m); elseif (z <= 5.4e+26) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c_m)); else tmp = Float64(Float64(-4.0 * Float64(a * Float64(t / c_m))) + Float64(b / Float64(z * c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -1.45e+35)
tmp = (t * ((a * -4.0) + (b / (z * t)))) / c_m;
elseif (z <= 5.4e+26)
tmp = (b + (x * (9.0 * y))) / (z * c_m);
else
tmp = (-4.0 * (a * (t / c_m))) + (b / (z * 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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -1.45e+35], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] + N[(b / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[z, 5.4e+26], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+35}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4 + \frac{b}{z \cdot t}\right)}{c\_m}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+26}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right) + \frac{b}{z \cdot c\_m}\\
\end{array}
\end{array}
if z < -1.44999999999999997e35Initial program 56.3%
+-commutative56.3%
associate-+r-56.3%
*-commutative56.3%
associate-*r*61.4%
*-commutative61.4%
associate-+r-61.4%
+-commutative61.4%
associate-*l*61.4%
associate-*l*63.5%
*-commutative63.5%
Simplified63.5%
Taylor expanded in x around 0 47.9%
Taylor expanded in t around inf 73.0%
Taylor expanded in c around 0 71.3%
if -1.44999999999999997e35 < z < 5.4e26Initial program 96.2%
+-commutative96.2%
associate-+r-96.2%
*-commutative96.2%
associate-*r*95.9%
*-commutative95.9%
associate-+r-95.9%
+-commutative95.9%
associate-*l*95.9%
associate-*l*93.5%
*-commutative93.5%
Simplified93.5%
Taylor expanded in x around inf 86.9%
associate-*r*86.9%
*-commutative86.9%
associate-*r*86.9%
Simplified86.9%
if 5.4e26 < z Initial program 64.2%
+-commutative64.2%
associate-+r-64.2%
*-commutative64.2%
associate-*r*60.8%
*-commutative60.8%
associate-+r-60.8%
+-commutative60.8%
associate-*l*60.8%
associate-*l*68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in y around inf 71.4%
Taylor expanded in y around 0 78.8%
cancel-sign-sub-inv78.8%
metadata-eval78.8%
*-commutative78.8%
associate-/l*72.4%
Simplified72.4%
Final simplification79.9%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -6.2e+46)
(* a (/ (* t -4.0) c_m))
(if (<= z 4.1e+52)
(/ (+ b (* x (* 9.0 y))) (* z c_m))
(* -4.0 (/ (* t a) c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -6.2e+46) {
tmp = a * ((t * -4.0) / c_m);
} else if (z <= 4.1e+52) {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
} else {
tmp = -4.0 * ((t * a) / c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (z <= (-6.2d+46)) then
tmp = a * ((t * (-4.0d0)) / c_m)
else if (z <= 4.1d+52) then
tmp = (b + (x * (9.0d0 * y))) / (z * c_m)
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);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (z <= -6.2e+46) {
tmp = a * ((t * -4.0) / c_m);
} else if (z <= 4.1e+52) {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
} else {
tmp = -4.0 * ((t * a) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -6.2e+46: tmp = a * ((t * -4.0) / c_m) elif z <= 4.1e+52: tmp = (b + (x * (9.0 * y))) / (z * c_m) else: tmp = -4.0 * ((t * a) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -6.2e+46) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); elseif (z <= 4.1e+52) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c_m)); 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);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -6.2e+46)
tmp = a * ((t * -4.0) / c_m);
elseif (z <= 4.1e+52)
tmp = (b + (x * (9.0 * y))) / (z * c_m);
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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -6.2e+46], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e+52], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $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)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+46}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+52}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\end{array}
\end{array}
if z < -6.1999999999999995e46Initial program 56.4%
+-commutative56.4%
associate-+r-56.4%
*-commutative56.4%
associate-*r*61.7%
*-commutative61.7%
associate-+r-61.7%
+-commutative61.7%
associate-*l*61.8%
associate-*l*64.0%
*-commutative64.0%
Simplified64.0%
Taylor expanded in z around inf 63.0%
*-commutative63.0%
associate-/l*64.5%
associate-*r*64.5%
associate-*l/64.5%
Simplified64.5%
if -6.1999999999999995e46 < z < 4.1e52Initial program 95.0%
+-commutative95.0%
associate-+r-95.0%
*-commutative95.0%
associate-*r*94.8%
*-commutative94.8%
associate-+r-94.8%
+-commutative94.8%
associate-*l*94.8%
associate-*l*92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in x around inf 85.5%
associate-*r*85.5%
*-commutative85.5%
associate-*r*85.5%
Simplified85.5%
if 4.1e52 < z Initial program 62.8%
+-commutative62.8%
associate-+r-62.8%
*-commutative62.8%
associate-*r*59.2%
*-commutative59.2%
associate-+r-59.2%
+-commutative59.2%
associate-*l*59.2%
associate-*l*67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in z around inf 65.8%
*-commutative65.8%
Simplified65.8%
Final simplification76.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -5.4e+45) (not (<= z 50000000000000.0)))
(* -4.0 (* t (/ a c_m)))
(/ b (* z c_m)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -5.4e+45) || !(z <= 50000000000000.0)) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = b / (z * c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 ((z <= (-5.4d+45)) .or. (.not. (z <= 50000000000000.0d0))) then
tmp = (-4.0d0) * (t * (a / c_m))
else
tmp = b / (z * c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 ((z <= -5.4e+45) || !(z <= 50000000000000.0)) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = b / (z * c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -5.4e+45) or not (z <= 50000000000000.0): tmp = -4.0 * (t * (a / c_m)) else: tmp = b / (z * c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -5.4e+45) || !(z <= 50000000000000.0)) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); else tmp = Float64(b / Float64(z * c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -5.4e+45) || ~((z <= 50000000000000.0)))
tmp = -4.0 * (t * (a / c_m));
else
tmp = b / (z * 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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -5.4e+45], N[Not[LessEqual[z, 50000000000000.0]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+45} \lor \neg \left(z \leq 50000000000000\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c\_m}\\
\end{array}
\end{array}
if z < -5.39999999999999968e45 or 5e13 < z Initial program 61.1%
Simplified61.6%
Taylor expanded in b around inf 55.9%
Taylor expanded in a around inf 62.2%
*-commutative62.2%
associate-/l*60.6%
Simplified60.6%
if -5.39999999999999968e45 < z < 5e13Initial program 95.5%
+-commutative95.5%
associate-+r-95.5%
*-commutative95.5%
associate-*r*95.3%
*-commutative95.3%
associate-+r-95.3%
+-commutative95.3%
associate-*l*95.3%
associate-*l*92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in b around inf 51.6%
*-commutative51.6%
Simplified51.6%
Final simplification55.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -1.8e+72)
(* a (* t (/ -4.0 c_m)))
(if (<= t 1.12e-98) (/ b (* z c_m)) (* -4.0 (* t (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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.8e+72) {
tmp = a * (t * (-4.0 / c_m));
} else if (t <= 1.12e-98) {
tmp = b / (z * c_m);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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.8d+72)) then
tmp = a * (t * ((-4.0d0) / c_m))
else if (t <= 1.12d-98) then
tmp = b / (z * c_m)
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);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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.8e+72) {
tmp = a * (t * (-4.0 / c_m));
} else if (t <= 1.12e-98) {
tmp = b / (z * c_m);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -1.8e+72: tmp = a * (t * (-4.0 / c_m)) elif t <= 1.12e-98: tmp = b / (z * c_m) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -1.8e+72) tmp = Float64(a * Float64(t * Float64(-4.0 / c_m))); elseif (t <= 1.12e-98) tmp = Float64(b / Float64(z * c_m)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (t <= -1.8e+72)
tmp = a * (t * (-4.0 / c_m));
elseif (t <= 1.12e-98)
tmp = b / (z * c_m);
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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -1.8e+72], N[(a * N[(t * N[(-4.0 / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e-98], N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+72}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c\_m}\right)\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-98}:\\
\;\;\;\;\frac{b}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if t < -1.80000000000000017e72Initial program 67.1%
+-commutative67.1%
associate-+r-67.1%
*-commutative67.1%
associate-*r*72.7%
*-commutative72.7%
associate-+r-72.7%
+-commutative72.7%
associate-*l*72.7%
associate-*l*72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in z around 0 64.5%
Taylor expanded in a around inf 53.9%
associate-*r/53.9%
*-commutative53.9%
associate-/l*54.0%
associate-*l*69.7%
Simplified69.7%
if -1.80000000000000017e72 < t < 1.12e-98Initial program 80.1%
+-commutative80.1%
associate-+r-80.1%
*-commutative80.1%
associate-*r*75.8%
*-commutative75.8%
associate-+r-75.8%
+-commutative75.8%
associate-*l*75.8%
associate-*l*80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in b around inf 43.8%
*-commutative43.8%
Simplified43.8%
if 1.12e-98 < t Initial program 83.2%
Simplified86.4%
Taylor expanded in b around inf 79.3%
Taylor expanded in a around inf 49.4%
*-commutative49.4%
associate-/l*53.1%
Simplified53.1%
Final simplification51.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -1.7e+72)
(* a (/ (* t -4.0) c_m))
(if (<= t 1.9e-98) (/ b (* z c_m)) (* -4.0 (* t (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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.7e+72) {
tmp = a * ((t * -4.0) / c_m);
} else if (t <= 1.9e-98) {
tmp = b / (z * c_m);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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.7d+72)) then
tmp = a * ((t * (-4.0d0)) / c_m)
else if (t <= 1.9d-98) then
tmp = b / (z * c_m)
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);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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.7e+72) {
tmp = a * ((t * -4.0) / c_m);
} else if (t <= 1.9e-98) {
tmp = b / (z * c_m);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -1.7e+72: tmp = a * ((t * -4.0) / c_m) elif t <= 1.9e-98: tmp = b / (z * c_m) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -1.7e+72) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); elseif (t <= 1.9e-98) tmp = Float64(b / Float64(z * c_m)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (t <= -1.7e+72)
tmp = a * ((t * -4.0) / c_m);
elseif (t <= 1.9e-98)
tmp = b / (z * c_m);
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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -1.7e+72], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e-98], N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+72}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-98}:\\
\;\;\;\;\frac{b}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if t < -1.6999999999999999e72Initial program 67.1%
+-commutative67.1%
associate-+r-67.1%
*-commutative67.1%
associate-*r*72.7%
*-commutative72.7%
associate-+r-72.7%
+-commutative72.7%
associate-*l*72.7%
associate-*l*72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in z around inf 53.9%
*-commutative53.9%
associate-/l*69.7%
associate-*r*69.7%
associate-*l/69.7%
Simplified69.7%
if -1.6999999999999999e72 < t < 1.9000000000000002e-98Initial program 80.1%
+-commutative80.1%
associate-+r-80.1%
*-commutative80.1%
associate-*r*75.8%
*-commutative75.8%
associate-+r-75.8%
+-commutative75.8%
associate-*l*75.8%
associate-*l*80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in b around inf 43.8%
*-commutative43.8%
Simplified43.8%
if 1.9000000000000002e-98 < t Initial program 83.2%
Simplified86.4%
Taylor expanded in b around inf 79.3%
Taylor expanded in a around inf 49.4%
*-commutative49.4%
associate-/l*53.1%
Simplified53.1%
Final simplification51.2%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -1.7e+72)
(* a (/ (* t -4.0) c_m))
(if (<= t 1.36e-98) (/ b (* z c_m)) (* t (* -4.0 (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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.7e+72) {
tmp = a * ((t * -4.0) / c_m);
} else if (t <= 1.36e-98) {
tmp = b / (z * c_m);
} else {
tmp = t * (-4.0 * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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.7d+72)) then
tmp = a * ((t * (-4.0d0)) / c_m)
else if (t <= 1.36d-98) then
tmp = b / (z * c_m)
else
tmp = t * ((-4.0d0) * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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.7e+72) {
tmp = a * ((t * -4.0) / c_m);
} else if (t <= 1.36e-98) {
tmp = b / (z * c_m);
} else {
tmp = t * (-4.0 * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -1.7e+72: tmp = a * ((t * -4.0) / c_m) elif t <= 1.36e-98: tmp = b / (z * c_m) else: tmp = t * (-4.0 * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -1.7e+72) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); elseif (t <= 1.36e-98) tmp = Float64(b / Float64(z * c_m)); else tmp = Float64(t * Float64(-4.0 * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (t <= -1.7e+72)
tmp = a * ((t * -4.0) / c_m);
elseif (t <= 1.36e-98)
tmp = b / (z * c_m);
else
tmp = t * (-4.0 * (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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -1.7e+72], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.36e-98], N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+72}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{elif}\;t \leq 1.36 \cdot 10^{-98}:\\
\;\;\;\;\frac{b}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if t < -1.6999999999999999e72Initial program 67.1%
+-commutative67.1%
associate-+r-67.1%
*-commutative67.1%
associate-*r*72.7%
*-commutative72.7%
associate-+r-72.7%
+-commutative72.7%
associate-*l*72.7%
associate-*l*72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in z around inf 53.9%
*-commutative53.9%
associate-/l*69.7%
associate-*r*69.7%
associate-*l/69.7%
Simplified69.7%
if -1.6999999999999999e72 < t < 1.36000000000000003e-98Initial program 80.1%
+-commutative80.1%
associate-+r-80.1%
*-commutative80.1%
associate-*r*75.8%
*-commutative75.8%
associate-+r-75.8%
+-commutative75.8%
associate-*l*75.8%
associate-*l*80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in b around inf 43.8%
*-commutative43.8%
Simplified43.8%
if 1.36000000000000003e-98 < t Initial program 83.2%
+-commutative83.2%
associate-+r-83.2%
*-commutative83.2%
associate-*r*86.4%
*-commutative86.4%
associate-+r-86.4%
+-commutative86.4%
associate-*l*86.4%
associate-*l*84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in x around 0 66.8%
Taylor expanded in t around inf 79.2%
Taylor expanded in a around inf 53.1%
Final simplification51.2%
c\_m = (fabs.f64 c) c\_s = (copysign.f64 #s(literal 1 binary64) c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (if (<= a 6e-248) (/ (/ b c_m) z) (/ b (* z c_m)))))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (a <= 6e-248) {
tmp = (b / c_m) / z;
} else {
tmp = b / (z * c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (a <= 6d-248) then
tmp = (b / c_m) / z
else
tmp = b / (z * c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (a <= 6e-248) {
tmp = (b / c_m) / z;
} else {
tmp = b / (z * c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if a <= 6e-248: tmp = (b / c_m) / z else: tmp = b / (z * c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (a <= 6e-248) tmp = Float64(Float64(b / c_m) / z); else tmp = Float64(b / Float64(z * c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= 6e-248)
tmp = (b / c_m) / z;
else
tmp = b / (z * 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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, 6e-248], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 6 \cdot 10^{-248}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c\_m}\\
\end{array}
\end{array}
if a < 6.00000000000000027e-248Initial program 75.7%
+-commutative75.7%
associate-+r-75.7%
*-commutative75.7%
associate-*r*78.7%
*-commutative78.7%
associate-+r-78.7%
+-commutative78.7%
associate-*l*78.6%
associate-*l*77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in b around inf 33.3%
associate-/r*38.0%
Simplified38.0%
if 6.00000000000000027e-248 < a Initial program 84.4%
+-commutative84.4%
associate-+r-84.4%
*-commutative84.4%
associate-*r*80.8%
*-commutative80.8%
associate-+r-80.8%
+-commutative80.8%
associate-*l*80.8%
associate-*l*84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in b around inf 41.8%
*-commutative41.8%
Simplified41.8%
Final simplification39.6%
c\_m = (fabs.f64 c) c\_s = (copysign.f64 #s(literal 1 binary64) c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ b (* z c_m))))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (z * c_m));
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 / (z * c_m))
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 / (z * c_m));
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * (b / (z * c_m))
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(b / Float64(z * c_m))) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * (b / (z * c_m));
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]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \frac{b}{z \cdot c\_m}
\end{array}
Initial program 79.5%
+-commutative79.5%
associate-+r-79.5%
*-commutative79.5%
associate-*r*79.6%
*-commutative79.6%
associate-+r-79.6%
+-commutative79.6%
associate-*l*79.6%
associate-*l*80.7%
*-commutative80.7%
Simplified80.7%
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 2024080
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:alt
(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)))