
(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 19 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
(*
c_s
(if (<= c_m 2.5e-5)
(/ (- b (* z (- (* 4.0 (* a t)) (* 9.0 (/ (* x y) z))))) (* c_m z))
(*
a
(-
(/ (- (/ b c_m) (* (* x (/ y c_m)) -9.0)) (* z a))
(* 4.0 (/ 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 tmp;
if (c_m <= 2.5e-5) {
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z);
} else {
tmp = a * ((((b / c_m) - ((x * (y / c_m)) * -9.0)) / (z * a)) - (4.0 * (t / 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 (c_m <= 2.5d-5) then
tmp = (b - (z * ((4.0d0 * (a * t)) - (9.0d0 * ((x * y) / z))))) / (c_m * z)
else
tmp = a * ((((b / c_m) - ((x * (y / c_m)) * (-9.0d0))) / (z * a)) - (4.0d0 * (t / 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 (c_m <= 2.5e-5) {
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z);
} else {
tmp = a * ((((b / c_m) - ((x * (y / c_m)) * -9.0)) / (z * a)) - (4.0 * (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): tmp = 0 if c_m <= 2.5e-5: tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z) else: tmp = a * ((((b / c_m) - ((x * (y / c_m)) * -9.0)) / (z * a)) - (4.0 * (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) tmp = 0.0 if (c_m <= 2.5e-5) tmp = Float64(Float64(b - Float64(z * Float64(Float64(4.0 * Float64(a * t)) - Float64(9.0 * Float64(Float64(x * y) / z))))) / Float64(c_m * z)); else tmp = Float64(a * Float64(Float64(Float64(Float64(b / c_m) - Float64(Float64(x * Float64(y / c_m)) * -9.0)) / Float64(z * a)) - Float64(4.0 * Float64(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)
tmp = 0.0;
if (c_m <= 2.5e-5)
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z);
else
tmp = a * ((((b / c_m) - ((x * (y / c_m)) * -9.0)) / (z * a)) - (4.0 * (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_] := N[(c$95$s * If[LessEqual[c$95$m, 2.5e-5], N[(N[(b - N[(z * N[(N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(N[(N[(b / c$95$m), $MachinePrecision] - N[(N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision] / N[(z * a), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t / c$95$m), $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 2.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{b - z \cdot \left(4 \cdot \left(a \cdot t\right) - 9 \cdot \frac{x \cdot y}{z}\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{\frac{b}{c\_m} - \left(x \cdot \frac{y}{c\_m}\right) \cdot -9}{z \cdot a} - 4 \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
if c < 2.50000000000000012e-5Initial program 80.2%
+-commutative80.2%
associate-+r-80.2%
*-commutative80.2%
associate-*r*81.8%
*-commutative81.8%
associate-+r-81.8%
+-commutative81.8%
associate-*l*81.4%
associate-*l*81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in z around inf 81.1%
if 2.50000000000000012e-5 < c Initial program 58.4%
+-commutative58.4%
associate-+r-58.4%
*-commutative58.4%
associate-*r*60.2%
*-commutative60.2%
associate-+r-60.2%
+-commutative60.2%
associate-*l*60.2%
associate-*l*56.7%
*-commutative56.7%
Simplified56.7%
Taylor expanded in a around -inf 74.7%
Taylor expanded in z around -inf 75.9%
mul-1-neg75.9%
distribute-neg-frac275.9%
mul-1-neg75.9%
unsub-neg75.9%
*-commutative75.9%
associate-/l*83.0%
*-commutative83.0%
Simplified83.0%
Final simplification81.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
(let* ((t_1 (/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* c_m z))))
(*
c_s
(if (<= t_1 -1e-123)
(/ (+ b (- (* x (* 9.0 y)) (* (* a t) (* z 4.0)))) (* c_m z))
(if (<= t_1 0.0)
(/ (+ (/ b c_m) (* -4.0 (/ (* a (* z t)) c_m))) z)
(if (<= t_1 INFINITY)
(/ (- b (* z (- (* 4.0 (* a t)) (* 9.0 (/ (* x y) z))))) (* c_m z))
(* a (- (* 9.0 (* (/ (/ x c_m) z) (/ y a))) (* 4.0 (/ 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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -1e-123) {
tmp = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z);
} else if (t_1 <= 0.0) {
tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z);
} else {
tmp = a * ((9.0 * (((x / c_m) / z) * (y / a))) - (4.0 * (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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -1e-123) {
tmp = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z);
} else if (t_1 <= 0.0) {
tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z);
} else {
tmp = a * ((9.0 * (((x / c_m) / z) * (y / a))) - (4.0 * (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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z) tmp = 0 if t_1 <= -1e-123: tmp = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z) elif t_1 <= 0.0: tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z elif t_1 <= math.inf: tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z) else: tmp = a * ((9.0 * (((x / c_m) / z) * (y / a))) - (4.0 * (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(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -1e-123) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(a * t) * Float64(z * 4.0)))) / Float64(c_m * z)); elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(b / c_m) + Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m))) / z); elseif (t_1 <= Inf) tmp = Float64(Float64(b - Float64(z * Float64(Float64(4.0 * Float64(a * t)) - Float64(9.0 * Float64(Float64(x * y) / z))))) / Float64(c_m * z)); else tmp = Float64(a * Float64(Float64(9.0 * Float64(Float64(Float64(x / c_m) / z) * Float64(y / a))) - Float64(4.0 * Float64(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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
tmp = 0.0;
if (t_1 <= -1e-123)
tmp = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z);
elseif (t_1 <= 0.0)
tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z;
elseif (t_1 <= Inf)
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z);
else
tmp = a * ((9.0 * (((x / c_m) / z) * (y / a))) - (4.0 * (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[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e-123], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * t), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(b - N[(z * N[(N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(9.0 * N[(N[(N[(x / c$95$m), $MachinePrecision] / z), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t / c$95$m), $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{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-123}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(a \cdot t\right) \cdot \left(z \cdot 4\right)\right)}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{c\_m} + -4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m}}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{b - z \cdot \left(4 \cdot \left(a \cdot t\right) - 9 \cdot \frac{x \cdot y}{z}\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(9 \cdot \left(\frac{\frac{x}{c\_m}}{z} \cdot \frac{y}{a}\right) - 4 \cdot \frac{t}{c\_m}\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.0000000000000001e-123Initial program 86.7%
+-commutative86.7%
associate-+r-86.7%
*-commutative86.7%
associate-*r*88.1%
*-commutative88.1%
associate-+r-88.1%
+-commutative88.1%
associate-*l*87.1%
associate-*l*84.5%
*-commutative84.5%
Simplified84.5%
if -1.0000000000000001e-123 < (/.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 57.7%
+-commutative57.7%
associate-+r-57.7%
*-commutative57.7%
associate-*r*57.2%
*-commutative57.2%
associate-+r-57.2%
+-commutative57.2%
associate-*l*57.2%
associate-*l*57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in x around 0 50.8%
Taylor expanded in z around 0 89.2%
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 84.0%
+-commutative84.0%
associate-+r-84.0%
*-commutative84.0%
associate-*r*86.5%
*-commutative86.5%
associate-+r-86.5%
+-commutative86.5%
associate-*l*86.5%
associate-*l*87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in z around inf 84.9%
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*0.6%
*-commutative0.6%
associate-+r-0.6%
+-commutative0.6%
associate-*l*0.6%
associate-*l*0.6%
*-commutative0.6%
Simplified0.6%
Taylor expanded in a around -inf 65.1%
Taylor expanded in x around inf 64.9%
*-commutative64.9%
*-commutative64.9%
times-frac75.2%
*-commutative75.2%
associate-/r*80.2%
Simplified80.2%
Final simplification84.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 (/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* c_m z))))
(*
c_s
(if (<= t_1 -1e-123)
(/ (+ b (- (* x (* 9.0 y)) (* (* a t) (* z 4.0)))) (* c_m z))
(if (<= t_1 0.0)
(/ (+ (/ b c_m) (* -4.0 (/ (* a (* z t)) c_m))) z)
(if (<= t_1 INFINITY)
(/ (- b (* z (- (* 4.0 (* a t)) (* 9.0 (/ (* x y) z))))) (* c_m z))
(* a (/ (* t -4.0) 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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -1e-123) {
tmp = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z);
} else if (t_1 <= 0.0) {
tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (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);
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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -1e-123) {
tmp = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z);
} else if (t_1 <= 0.0) {
tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (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) [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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z) tmp = 0 if t_1 <= -1e-123: tmp = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z) elif t_1 <= 0.0: tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z elif t_1 <= math.inf: tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (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) 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(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -1e-123) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(a * t) * Float64(z * 4.0)))) / Float64(c_m * z)); elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(b / c_m) + Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m))) / z); elseif (t_1 <= Inf) tmp = Float64(Float64(b - Float64(z * Float64(Float64(4.0 * Float64(a * t)) - Float64(9.0 * Float64(Float64(x * y) / z))))) / 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);
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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
tmp = 0.0;
if (t_1 <= -1e-123)
tmp = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z);
elseif (t_1 <= 0.0)
tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z;
elseif (t_1 <= Inf)
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (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]
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[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e-123], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * t), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(b - N[(z * N[(N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $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)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-123}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(a \cdot t\right) \cdot \left(z \cdot 4\right)\right)}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{c\_m} + -4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m}}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{b - z \cdot \left(4 \cdot \left(a \cdot t\right) - 9 \cdot \frac{x \cdot y}{z}\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{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.0000000000000001e-123Initial program 86.7%
+-commutative86.7%
associate-+r-86.7%
*-commutative86.7%
associate-*r*88.1%
*-commutative88.1%
associate-+r-88.1%
+-commutative88.1%
associate-*l*87.1%
associate-*l*84.5%
*-commutative84.5%
Simplified84.5%
if -1.0000000000000001e-123 < (/.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 57.7%
+-commutative57.7%
associate-+r-57.7%
*-commutative57.7%
associate-*r*57.2%
*-commutative57.2%
associate-+r-57.2%
+-commutative57.2%
associate-*l*57.2%
associate-*l*57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in x around 0 50.8%
Taylor expanded in z around 0 89.2%
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 84.0%
+-commutative84.0%
associate-+r-84.0%
*-commutative84.0%
associate-*r*86.5%
*-commutative86.5%
associate-+r-86.5%
+-commutative86.5%
associate-*l*86.5%
associate-*l*87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in z around inf 84.9%
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*0.6%
*-commutative0.6%
associate-+r-0.6%
+-commutative0.6%
associate-*l*0.6%
associate-*l*0.6%
*-commutative0.6%
Simplified0.6%
Taylor expanded in z around inf 47.2%
associate-/l*70.7%
associate-*r*70.7%
*-commutative70.7%
associate-*r*70.7%
*-commutative70.7%
associate-*l/70.7%
Simplified70.7%
Final simplification84.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
(let* ((t_1 (/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* c_m z)))
(t_2 (/ (+ b (- (* x (* 9.0 y)) (* (* a t) (* z 4.0)))) (* c_m z))))
(*
c_s
(if (<= t_1 -1e-123)
t_2
(if (<= t_1 0.0)
(/ (+ (/ b c_m) (* -4.0 (/ (* a (* z t)) c_m))) z)
(if (<= t_1 INFINITY) t_2 (* a (/ (* t -4.0) 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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
double t_2 = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z);
double tmp;
if (t_1 <= -1e-123) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = a * ((t * -4.0) / 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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
double t_2 = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z);
double tmp;
if (t_1 <= -1e-123) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = a * ((t * -4.0) / 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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z) t_2 = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z) tmp = 0 if t_1 <= -1e-123: tmp = t_2 elif t_1 <= 0.0: tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z elif t_1 <= math.inf: tmp = t_2 else: tmp = a * ((t * -4.0) / 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(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c_m * z)) t_2 = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(a * t) * Float64(z * 4.0)))) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -1e-123) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(b / c_m) + Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m))) / z); elseif (t_1 <= Inf) tmp = t_2; 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);
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 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
t_2 = (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0)))) / (c_m * z);
tmp = 0.0;
if (t_1 <= -1e-123)
tmp = t_2;
elseif (t_1 <= 0.0)
tmp = ((b / c_m) + (-4.0 * ((a * (z * t)) / c_m))) / z;
elseif (t_1 <= Inf)
tmp = t_2;
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]
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[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * t), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e-123], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, 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)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c\_m \cdot z}\\
t_2 := \frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(a \cdot t\right) \cdot \left(z \cdot 4\right)\right)}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-123}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{c\_m} + -4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m}}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{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.0000000000000001e-123 or 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 85.2%
+-commutative85.2%
associate-+r-85.2%
*-commutative85.2%
associate-*r*87.2%
*-commutative87.2%
associate-+r-87.2%
+-commutative87.2%
associate-*l*86.8%
associate-*l*86.0%
*-commutative86.0%
Simplified86.0%
if -1.0000000000000001e-123 < (/.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 57.7%
+-commutative57.7%
associate-+r-57.7%
*-commutative57.7%
associate-*r*57.2%
*-commutative57.2%
associate-+r-57.2%
+-commutative57.2%
associate-*l*57.2%
associate-*l*57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in x around 0 50.8%
Taylor expanded in z around 0 89.2%
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*0.6%
*-commutative0.6%
associate-+r-0.6%
+-commutative0.6%
associate-*l*0.6%
associate-*l*0.6%
*-commutative0.6%
Simplified0.6%
Taylor expanded in z around inf 47.2%
associate-/l*70.7%
associate-*r*70.7%
*-commutative70.7%
associate-*r*70.7%
*-commutative70.7%
associate-*l/70.7%
Simplified70.7%
Final simplification85.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
(let* ((t_1 (* a (* t (/ -4.0 c_m)))))
(*
c_s
(if (<= y -1.15e-130)
(* (* 9.0 x) (/ (/ y c_m) z))
(if (<= y -5.5e-220)
t_1
(if (<= y 1.6e-207)
(/ (/ b c_m) z)
(if (<= y 2.7e+176) t_1 (* 9.0 (* y (/ (/ x c_m) 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 = a * (t * (-4.0 / c_m));
double tmp;
if (y <= -1.15e-130) {
tmp = (9.0 * x) * ((y / c_m) / z);
} else if (y <= -5.5e-220) {
tmp = t_1;
} else if (y <= 1.6e-207) {
tmp = (b / c_m) / z;
} else if (y <= 2.7e+176) {
tmp = t_1;
} else {
tmp = 9.0 * (y * ((x / c_m) / z));
}
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) :: t_1
real(8) :: tmp
t_1 = a * (t * ((-4.0d0) / c_m))
if (y <= (-1.15d-130)) then
tmp = (9.0d0 * x) * ((y / c_m) / z)
else if (y <= (-5.5d-220)) then
tmp = t_1
else if (y <= 1.6d-207) then
tmp = (b / c_m) / z
else if (y <= 2.7d+176) then
tmp = t_1
else
tmp = 9.0d0 * (y * ((x / c_m) / z))
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 t_1 = a * (t * (-4.0 / c_m));
double tmp;
if (y <= -1.15e-130) {
tmp = (9.0 * x) * ((y / c_m) / z);
} else if (y <= -5.5e-220) {
tmp = t_1;
} else if (y <= 1.6e-207) {
tmp = (b / c_m) / z;
} else if (y <= 2.7e+176) {
tmp = t_1;
} else {
tmp = 9.0 * (y * ((x / c_m) / z));
}
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 = a * (t * (-4.0 / c_m)) tmp = 0 if y <= -1.15e-130: tmp = (9.0 * x) * ((y / c_m) / z) elif y <= -5.5e-220: tmp = t_1 elif y <= 1.6e-207: tmp = (b / c_m) / z elif y <= 2.7e+176: tmp = t_1 else: tmp = 9.0 * (y * ((x / c_m) / 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(a * Float64(t * Float64(-4.0 / c_m))) tmp = 0.0 if (y <= -1.15e-130) tmp = Float64(Float64(9.0 * x) * Float64(Float64(y / c_m) / z)); elseif (y <= -5.5e-220) tmp = t_1; elseif (y <= 1.6e-207) tmp = Float64(Float64(b / c_m) / z); elseif (y <= 2.7e+176) tmp = t_1; else tmp = Float64(9.0 * Float64(y * Float64(Float64(x / c_m) / z))); 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 = a * (t * (-4.0 / c_m));
tmp = 0.0;
if (y <= -1.15e-130)
tmp = (9.0 * x) * ((y / c_m) / z);
elseif (y <= -5.5e-220)
tmp = t_1;
elseif (y <= 1.6e-207)
tmp = (b / c_m) / z;
elseif (y <= 2.7e+176)
tmp = t_1;
else
tmp = 9.0 * (y * ((x / 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]
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[(a * N[(t * N[(-4.0 / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[y, -1.15e-130], N[(N[(9.0 * x), $MachinePrecision] * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.5e-220], t$95$1, If[LessEqual[y, 1.6e-207], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 2.7e+176], t$95$1, N[(9.0 * N[(y * N[(N[(x / c$95$m), $MachinePrecision] / z), $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 := a \cdot \left(t \cdot \frac{-4}{c\_m}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-130}:\\
\;\;\;\;\left(9 \cdot x\right) \cdot \frac{\frac{y}{c\_m}}{z}\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-220}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-207}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(y \cdot \frac{\frac{x}{c\_m}}{z}\right)\\
\end{array}
\end{array}
\end{array}
if y < -1.1500000000000001e-130Initial program 76.1%
+-commutative76.1%
associate-+r-76.1%
*-commutative76.1%
associate-*r*74.4%
*-commutative74.4%
associate-+r-74.4%
+-commutative74.4%
associate-*l*74.4%
associate-*l*76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in x around inf 41.1%
associate-/l*43.4%
associate-*r*43.4%
associate-/r*44.0%
Simplified44.0%
if -1.1500000000000001e-130 < y < -5.4999999999999999e-220 or 1.6000000000000002e-207 < y < 2.6999999999999998e176Initial program 77.1%
+-commutative77.1%
associate-+r-77.1%
*-commutative77.1%
associate-*r*79.2%
*-commutative79.2%
associate-+r-79.2%
+-commutative79.2%
associate-*l*79.1%
associate-*l*76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in x around 0 78.8%
Taylor expanded in z around inf 51.2%
associate-*r/51.2%
*-commutative51.2%
associate-*r/51.1%
associate-*r*57.1%
Simplified57.1%
if -5.4999999999999999e-220 < y < 1.6000000000000002e-207Initial program 70.4%
+-commutative70.4%
associate-+r-70.4%
*-commutative70.4%
associate-*r*77.8%
*-commutative77.8%
associate-+r-77.8%
+-commutative77.8%
associate-*l*77.8%
associate-*l*79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in a around -inf 70.1%
Taylor expanded in b around inf 56.0%
mul-1-neg56.0%
associate-/r*65.1%
distribute-neg-frac265.1%
Simplified65.1%
if 2.6999999999999998e176 < y Initial program 78.7%
+-commutative78.7%
associate-+r-78.7%
*-commutative78.7%
associate-*r*78.7%
*-commutative78.7%
associate-+r-78.7%
+-commutative78.7%
associate-*l*74.9%
associate-*l*70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in z around inf 74.4%
Taylor expanded in x around inf 74.3%
times-frac68.6%
*-commutative68.6%
Simplified68.6%
associate-*l/84.7%
Applied egg-rr84.7%
associate-/l*84.7%
Applied egg-rr84.7%
Final simplification56.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
(let* ((t_1 (* a (* t (/ -4.0 c_m)))))
(*
c_s
(if (<= y -1.66e-130)
(* 9.0 (* x (/ y (* c_m z))))
(if (<= y -4.5e-224)
t_1
(if (<= y 7e-210)
(/ (/ b c_m) z)
(if (<= y 2.4e+176) t_1 (* 9.0 (* y (/ (/ x c_m) 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 = a * (t * (-4.0 / c_m));
double tmp;
if (y <= -1.66e-130) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (y <= -4.5e-224) {
tmp = t_1;
} else if (y <= 7e-210) {
tmp = (b / c_m) / z;
} else if (y <= 2.4e+176) {
tmp = t_1;
} else {
tmp = 9.0 * (y * ((x / c_m) / z));
}
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) :: t_1
real(8) :: tmp
t_1 = a * (t * ((-4.0d0) / c_m))
if (y <= (-1.66d-130)) then
tmp = 9.0d0 * (x * (y / (c_m * z)))
else if (y <= (-4.5d-224)) then
tmp = t_1
else if (y <= 7d-210) then
tmp = (b / c_m) / z
else if (y <= 2.4d+176) then
tmp = t_1
else
tmp = 9.0d0 * (y * ((x / c_m) / z))
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 t_1 = a * (t * (-4.0 / c_m));
double tmp;
if (y <= -1.66e-130) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (y <= -4.5e-224) {
tmp = t_1;
} else if (y <= 7e-210) {
tmp = (b / c_m) / z;
} else if (y <= 2.4e+176) {
tmp = t_1;
} else {
tmp = 9.0 * (y * ((x / c_m) / z));
}
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 = a * (t * (-4.0 / c_m)) tmp = 0 if y <= -1.66e-130: tmp = 9.0 * (x * (y / (c_m * z))) elif y <= -4.5e-224: tmp = t_1 elif y <= 7e-210: tmp = (b / c_m) / z elif y <= 2.4e+176: tmp = t_1 else: tmp = 9.0 * (y * ((x / c_m) / 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(a * Float64(t * Float64(-4.0 / c_m))) tmp = 0.0 if (y <= -1.66e-130) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); elseif (y <= -4.5e-224) tmp = t_1; elseif (y <= 7e-210) tmp = Float64(Float64(b / c_m) / z); elseif (y <= 2.4e+176) tmp = t_1; else tmp = Float64(9.0 * Float64(y * Float64(Float64(x / c_m) / z))); 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 = a * (t * (-4.0 / c_m));
tmp = 0.0;
if (y <= -1.66e-130)
tmp = 9.0 * (x * (y / (c_m * z)));
elseif (y <= -4.5e-224)
tmp = t_1;
elseif (y <= 7e-210)
tmp = (b / c_m) / z;
elseif (y <= 2.4e+176)
tmp = t_1;
else
tmp = 9.0 * (y * ((x / 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]
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[(a * N[(t * N[(-4.0 / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[y, -1.66e-130], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.5e-224], t$95$1, If[LessEqual[y, 7e-210], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 2.4e+176], t$95$1, N[(9.0 * N[(y * N[(N[(x / c$95$m), $MachinePrecision] / z), $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 := a \cdot \left(t \cdot \frac{-4}{c\_m}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.66 \cdot 10^{-130}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-224}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-210}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(y \cdot \frac{\frac{x}{c\_m}}{z}\right)\\
\end{array}
\end{array}
\end{array}
if y < -1.65999999999999993e-130Initial program 76.1%
+-commutative76.1%
associate-+r-76.1%
*-commutative76.1%
associate-*r*74.4%
*-commutative74.4%
associate-+r-74.4%
+-commutative74.4%
associate-*l*74.4%
associate-*l*76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in x around inf 41.1%
associate-/l*43.4%
*-commutative43.4%
Simplified43.4%
if -1.65999999999999993e-130 < y < -4.5000000000000004e-224 or 7.00000000000000031e-210 < y < 2.4000000000000001e176Initial program 77.4%
+-commutative77.4%
associate-+r-77.4%
*-commutative77.4%
associate-*r*79.4%
*-commutative79.4%
associate-+r-79.4%
+-commutative79.4%
associate-*l*79.3%
associate-*l*76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in x around 0 79.0%
Taylor expanded in z around inf 51.7%
associate-*r/51.7%
*-commutative51.7%
associate-*r/51.6%
associate-*r*57.5%
Simplified57.5%
if -4.5000000000000004e-224 < y < 7.00000000000000031e-210Initial program 69.8%
+-commutative69.8%
associate-+r-69.8%
*-commutative69.8%
associate-*r*77.4%
*-commutative77.4%
associate-+r-77.4%
+-commutative77.4%
associate-*l*77.4%
associate-*l*79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in a around -inf 69.5%
Taylor expanded in b around inf 55.1%
mul-1-neg55.1%
associate-/r*64.4%
distribute-neg-frac264.4%
Simplified64.4%
if 2.4000000000000001e176 < y Initial program 78.7%
+-commutative78.7%
associate-+r-78.7%
*-commutative78.7%
associate-*r*78.7%
*-commutative78.7%
associate-+r-78.7%
+-commutative78.7%
associate-*l*74.9%
associate-*l*70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in z around inf 74.4%
Taylor expanded in x around inf 74.3%
times-frac68.6%
*-commutative68.6%
Simplified68.6%
associate-*l/84.7%
Applied egg-rr84.7%
associate-/l*84.7%
Applied egg-rr84.7%
Final simplification56.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 (<= c_m 1.45e-7)
(/ (- b (* z (- (* 4.0 (* a t)) (* 9.0 (/ (* x y) z))))) (* c_m z))
(-
(+ (* 9.0 (* (/ y z) (/ x c_m))) (/ b (* c_m z)))
(* 4.0 (/ (* a 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 tmp;
if (c_m <= 1.45e-7) {
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z);
} else {
tmp = ((9.0 * ((y / z) * (x / c_m))) + (b / (c_m * z))) - (4.0 * ((a * t) / 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 (c_m <= 1.45d-7) then
tmp = (b - (z * ((4.0d0 * (a * t)) - (9.0d0 * ((x * y) / z))))) / (c_m * z)
else
tmp = ((9.0d0 * ((y / z) * (x / c_m))) + (b / (c_m * z))) - (4.0d0 * ((a * t) / 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 (c_m <= 1.45e-7) {
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z);
} else {
tmp = ((9.0 * ((y / z) * (x / c_m))) + (b / (c_m * z))) - (4.0 * ((a * 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): tmp = 0 if c_m <= 1.45e-7: tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z) else: tmp = ((9.0 * ((y / z) * (x / c_m))) + (b / (c_m * z))) - (4.0 * ((a * 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) tmp = 0.0 if (c_m <= 1.45e-7) tmp = Float64(Float64(b - Float64(z * Float64(Float64(4.0 * Float64(a * t)) - Float64(9.0 * Float64(Float64(x * y) / z))))) / Float64(c_m * z)); else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / z) * Float64(x / c_m))) + Float64(b / Float64(c_m * z))) - Float64(4.0 * Float64(Float64(a * 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)
tmp = 0.0;
if (c_m <= 1.45e-7)
tmp = (b - (z * ((4.0 * (a * t)) - (9.0 * ((x * y) / z))))) / (c_m * z);
else
tmp = ((9.0 * ((y / z) * (x / c_m))) + (b / (c_m * z))) - (4.0 * ((a * 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_] := N[(c$95$s * If[LessEqual[c$95$m, 1.45e-7], N[(N[(b - N[(z * N[(N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / 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}\;c\_m \leq 1.45 \cdot 10^{-7}:\\
\;\;\;\;\frac{b - z \cdot \left(4 \cdot \left(a \cdot t\right) - 9 \cdot \frac{x \cdot y}{z}\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c\_m}\right) + \frac{b}{c\_m \cdot z}\right) - 4 \cdot \frac{a \cdot t}{c\_m}\\
\end{array}
\end{array}
if c < 1.4499999999999999e-7Initial program 80.2%
+-commutative80.2%
associate-+r-80.2%
*-commutative80.2%
associate-*r*81.8%
*-commutative81.8%
associate-+r-81.8%
+-commutative81.8%
associate-*l*81.4%
associate-*l*81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in z around inf 81.1%
if 1.4499999999999999e-7 < c Initial program 58.4%
+-commutative58.4%
associate-+r-58.4%
*-commutative58.4%
associate-*r*60.2%
*-commutative60.2%
associate-+r-60.2%
+-commutative60.2%
associate-*l*60.2%
associate-*l*56.7%
*-commutative56.7%
Simplified56.7%
Taylor expanded in x around 0 66.1%
associate-/l*71.5%
*-commutative71.5%
Applied egg-rr71.5%
associate-*r/66.1%
*-commutative66.1%
times-frac75.1%
Simplified75.1%
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 -2.3e+33)
(- (/ b (* c_m z)) (* 4.0 (/ (* a t) c_m)))
(if (<= z 1.8e-8)
(/ (+ (/ b c_m) (* 9.0 (/ (* x y) c_m))) z)
(* t (+ (* -4.0 (/ a c_m)) (/ b (* c_m (* z t)))))))))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 <= -2.3e+33) {
tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m));
} else if (z <= 1.8e-8) {
tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z;
} else {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
}
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 <= (-2.3d+33)) then
tmp = (b / (c_m * z)) - (4.0d0 * ((a * t) / c_m))
else if (z <= 1.8d-8) then
tmp = ((b / c_m) + (9.0d0 * ((x * y) / c_m))) / z
else
tmp = t * (((-4.0d0) * (a / c_m)) + (b / (c_m * (z * t))))
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 <= -2.3e+33) {
tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m));
} else if (z <= 1.8e-8) {
tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z;
} else {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
}
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 <= -2.3e+33: tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m)) elif z <= 1.8e-8: tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z else: tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t)))) 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 <= -2.3e+33) tmp = Float64(Float64(b / Float64(c_m * z)) - Float64(4.0 * Float64(Float64(a * t) / c_m))); elseif (z <= 1.8e-8) tmp = Float64(Float64(Float64(b / c_m) + Float64(9.0 * Float64(Float64(x * y) / c_m))) / z); else tmp = Float64(t * Float64(Float64(-4.0 * Float64(a / c_m)) + Float64(b / Float64(c_m * Float64(z * t))))); 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 <= -2.3e+33)
tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m));
elseif (z <= 1.8e-8)
tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z;
else
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
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, -2.3e+33], N[(N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-8], N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(t * N[(N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * N[(z * t), $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+33}:\\
\;\;\;\;\frac{b}{c\_m \cdot z} - 4 \cdot \frac{a \cdot t}{c\_m}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{b}{c\_m} + 9 \cdot \frac{x \cdot y}{c\_m}}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m} + \frac{b}{c\_m \cdot \left(z \cdot t\right)}\right)\\
\end{array}
\end{array}
if z < -2.30000000000000011e33Initial program 64.0%
+-commutative64.0%
associate-+r-64.0%
*-commutative64.0%
associate-*r*68.5%
*-commutative68.5%
associate-+r-68.5%
+-commutative68.5%
associate-*l*68.4%
associate-*l*71.3%
*-commutative71.3%
Simplified71.3%
Taylor expanded in x around 0 81.7%
Taylor expanded in x around 0 74.0%
if -2.30000000000000011e33 < z < 1.79999999999999991e-8Initial program 89.8%
+-commutative89.8%
associate-+r-89.8%
*-commutative89.8%
associate-*r*89.3%
*-commutative89.3%
associate-+r-89.3%
+-commutative89.3%
associate-*l*88.5%
associate-*l*84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in x around 0 70.7%
Taylor expanded in z around 0 77.2%
if 1.79999999999999991e-8 < z Initial program 63.8%
+-commutative63.8%
associate-+r-63.8%
*-commutative63.8%
associate-*r*66.3%
*-commutative66.3%
associate-+r-66.3%
+-commutative66.3%
associate-*l*66.3%
associate-*l*67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in x around 0 48.6%
Taylor expanded in t around inf 77.6%
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
(let* ((t_1 (* a (/ (* t -4.0) c_m))))
(*
c_s
(if (<= t -6.5e+29)
t_1
(if (<= t -3.2e-229)
(/ (/ b c_m) z)
(if (<= t 6.5e-65) (* 9.0 (* x (/ y (* c_m z)))) 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 = a * ((t * -4.0) / c_m);
double tmp;
if (t <= -6.5e+29) {
tmp = t_1;
} else if (t <= -3.2e-229) {
tmp = (b / c_m) / z;
} else if (t <= 6.5e-65) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = a * ((t * (-4.0d0)) / c_m)
if (t <= (-6.5d+29)) then
tmp = t_1
else if (t <= (-3.2d-229)) then
tmp = (b / c_m) / z
else if (t <= 6.5d-65) then
tmp = 9.0d0 * (x * (y / (c_m * z)))
else
tmp = t_1
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 t_1 = a * ((t * -4.0) / c_m);
double tmp;
if (t <= -6.5e+29) {
tmp = t_1;
} else if (t <= -3.2e-229) {
tmp = (b / c_m) / z;
} else if (t <= 6.5e-65) {
tmp = 9.0 * (x * (y / (c_m * z)));
} 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 = a * ((t * -4.0) / c_m) tmp = 0 if t <= -6.5e+29: tmp = t_1 elif t <= -3.2e-229: tmp = (b / c_m) / z elif t <= 6.5e-65: tmp = 9.0 * (x * (y / (c_m * z))) 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(a * Float64(Float64(t * -4.0) / c_m)) tmp = 0.0 if (t <= -6.5e+29) tmp = t_1; elseif (t <= -3.2e-229) tmp = Float64(Float64(b / c_m) / z); elseif (t <= 6.5e-65) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); 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 = a * ((t * -4.0) / c_m);
tmp = 0.0;
if (t <= -6.5e+29)
tmp = t_1;
elseif (t <= -3.2e-229)
tmp = (b / c_m) / z;
elseif (t <= 6.5e-65)
tmp = 9.0 * (x * (y / (c_m * z)));
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[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t, -6.5e+29], t$95$1, If[LessEqual[t, -3.2e-229], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 6.5e-65], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := a \cdot \frac{t \cdot -4}{c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.2 \cdot 10^{-229}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-65}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -6.49999999999999971e29 or 6.5e-65 < t Initial program 68.6%
+-commutative68.6%
associate-+r-68.6%
*-commutative68.6%
associate-*r*74.0%
*-commutative74.0%
associate-+r-74.0%
+-commutative74.0%
associate-*l*73.3%
associate-*l*69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in z around inf 49.2%
associate-/l*59.0%
associate-*r*59.0%
*-commutative59.0%
associate-*r*59.0%
*-commutative59.0%
associate-*l/59.0%
Simplified59.0%
if -6.49999999999999971e29 < t < -3.20000000000000015e-229Initial program 85.3%
+-commutative85.3%
associate-+r-85.3%
*-commutative85.3%
associate-*r*85.0%
*-commutative85.0%
associate-+r-85.0%
+-commutative85.0%
associate-*l*85.1%
associate-*l*85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in a around -inf 78.0%
Taylor expanded in b around inf 43.2%
mul-1-neg43.2%
associate-/r*45.0%
distribute-neg-frac245.0%
Simplified45.0%
if -3.20000000000000015e-229 < t < 6.5e-65Initial program 81.6%
+-commutative81.6%
associate-+r-81.6%
*-commutative81.6%
associate-*r*77.5%
*-commutative77.5%
associate-+r-77.5%
+-commutative77.5%
associate-*l*77.5%
associate-*l*82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in x around inf 45.6%
associate-/l*47.1%
*-commutative47.1%
Simplified47.1%
Final simplification52.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 (or (<= z -2.35e+33) (not (<= z 7.5e+30)))
(- (/ b (* c_m z)) (* 4.0 (/ (* a t) c_m)))
(/ (+ (/ b c_m) (* 9.0 (/ (* x y) c_m))) 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 tmp;
if ((z <= -2.35e+33) || !(z <= 7.5e+30)) {
tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m));
} else {
tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z;
}
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 <= (-2.35d+33)) .or. (.not. (z <= 7.5d+30))) then
tmp = (b / (c_m * z)) - (4.0d0 * ((a * t) / c_m))
else
tmp = ((b / c_m) + (9.0d0 * ((x * y) / c_m))) / z
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 <= -2.35e+33) || !(z <= 7.5e+30)) {
tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m));
} else {
tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z;
}
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 <= -2.35e+33) or not (z <= 7.5e+30): tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m)) else: tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / 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) tmp = 0.0 if ((z <= -2.35e+33) || !(z <= 7.5e+30)) tmp = Float64(Float64(b / Float64(c_m * z)) - Float64(4.0 * Float64(Float64(a * t) / c_m))); else tmp = Float64(Float64(Float64(b / c_m) + Float64(9.0 * Float64(Float64(x * y) / c_m))) / z); 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 <= -2.35e+33) || ~((z <= 7.5e+30)))
tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m));
else
tmp = ((b / c_m) + (9.0 * ((x * y) / 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]
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, -2.35e+33], N[Not[LessEqual[z, 7.5e+30]], $MachinePrecision]], N[(N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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 -2.35 \cdot 10^{+33} \lor \neg \left(z \leq 7.5 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{b}{c\_m \cdot z} - 4 \cdot \frac{a \cdot t}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c\_m} + 9 \cdot \frac{x \cdot y}{c\_m}}{z}\\
\end{array}
\end{array}
if z < -2.3499999999999999e33 or 7.49999999999999973e30 < z Initial program 63.3%
+-commutative63.3%
associate-+r-63.3%
*-commutative63.3%
associate-*r*66.8%
*-commutative66.8%
associate-+r-66.8%
+-commutative66.8%
associate-*l*66.8%
associate-*l*69.0%
*-commutative69.0%
Simplified69.0%
Taylor expanded in x around 0 78.9%
Taylor expanded in x around 0 68.2%
if -2.3499999999999999e33 < z < 7.49999999999999973e30Initial program 89.4%
+-commutative89.4%
associate-+r-89.4%
*-commutative89.4%
associate-*r*88.9%
*-commutative88.9%
associate-+r-88.9%
+-commutative88.9%
associate-*l*88.2%
associate-*l*84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in x around 0 71.1%
Taylor expanded in z around 0 77.3%
Final simplification72.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 -2.4e+33) (not (<= z 1.55e-99)))
(- (/ b (* c_m z)) (* 4.0 (/ (* a t) c_m)))
(/ (+ b (* y (* 9.0 x))) (* c_m 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 tmp;
if ((z <= -2.4e+33) || !(z <= 1.55e-99)) {
tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m));
} else {
tmp = (b + (y * (9.0 * x))) / (c_m * z);
}
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 <= (-2.4d+33)) .or. (.not. (z <= 1.55d-99))) then
tmp = (b / (c_m * z)) - (4.0d0 * ((a * t) / c_m))
else
tmp = (b + (y * (9.0d0 * x))) / (c_m * z)
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 <= -2.4e+33) || !(z <= 1.55e-99)) {
tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m));
} else {
tmp = (b + (y * (9.0 * x))) / (c_m * z);
}
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 <= -2.4e+33) or not (z <= 1.55e-99): tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m)) else: tmp = (b + (y * (9.0 * x))) / (c_m * 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) tmp = 0.0 if ((z <= -2.4e+33) || !(z <= 1.55e-99)) tmp = Float64(Float64(b / Float64(c_m * z)) - Float64(4.0 * Float64(Float64(a * t) / c_m))); else tmp = Float64(Float64(b + Float64(y * Float64(9.0 * x))) / Float64(c_m * z)); 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 <= -2.4e+33) || ~((z <= 1.55e-99)))
tmp = (b / (c_m * z)) - (4.0 * ((a * t) / c_m));
else
tmp = (b + (y * (9.0 * x))) / (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]
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, -2.4e+33], N[Not[LessEqual[z, 1.55e-99]], $MachinePrecision]], N[(N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(y * N[(9.0 * x), $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)
\\
[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 -2.4 \cdot 10^{+33} \lor \neg \left(z \leq 1.55 \cdot 10^{-99}\right):\\
\;\;\;\;\frac{b}{c\_m \cdot z} - 4 \cdot \frac{a \cdot t}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + y \cdot \left(9 \cdot x\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -2.4e33 or 1.5499999999999999e-99 < z Initial program 66.4%
+-commutative66.4%
associate-+r-66.4%
*-commutative66.4%
associate-*r*69.5%
*-commutative69.5%
associate-+r-69.5%
+-commutative69.5%
associate-*l*69.5%
associate-*l*70.7%
*-commutative70.7%
Simplified70.7%
Taylor expanded in x around 0 79.3%
Taylor expanded in x around 0 67.5%
if -2.4e33 < z < 1.5499999999999999e-99Initial program 90.1%
+-commutative90.1%
associate-+r-90.1%
*-commutative90.1%
associate-*r*89.4%
*-commutative89.4%
associate-+r-89.4%
+-commutative89.4%
associate-*l*88.5%
associate-*l*85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in z around 0 78.3%
associate-*r*78.3%
*-commutative78.3%
Simplified78.3%
Final simplification71.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 (or (<= t -4.4e+92) (not (<= t 3.45e+50)))
(* a (/ (* t -4.0) c_m))
(/ (+ b (* 9.0 (* x y))) (* c_m 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 tmp;
if ((t <= -4.4e+92) || !(t <= 3.45e+50)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
}
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 <= (-4.4d+92)) .or. (.not. (t <= 3.45d+50))) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
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 <= -4.4e+92) || !(t <= 3.45e+50)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
}
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 <= -4.4e+92) or not (t <= 3.45e+50): tmp = a * ((t * -4.0) / c_m) else: tmp = (b + (9.0 * (x * y))) / (c_m * 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) tmp = 0.0 if ((t <= -4.4e+92) || !(t <= 3.45e+50)) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); 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 <= -4.4e+92) || ~((t <= 3.45e+50)))
tmp = a * ((t * -4.0) / c_m);
else
tmp = (b + (9.0 * (x * y))) / (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]
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[t, -4.4e+92], N[Not[LessEqual[t, 3.45e+50]], $MachinePrecision]], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $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)
\\
[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 -4.4 \cdot 10^{+92} \lor \neg \left(t \leq 3.45 \cdot 10^{+50}\right):\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -4.39999999999999984e92 or 3.45000000000000016e50 < t Initial program 66.3%
+-commutative66.3%
associate-+r-66.3%
*-commutative66.3%
associate-*r*71.4%
*-commutative71.4%
associate-+r-71.4%
+-commutative71.4%
associate-*l*70.5%
associate-*l*65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in z around inf 50.9%
associate-/l*63.4%
associate-*r*63.4%
*-commutative63.4%
associate-*r*63.4%
*-commutative63.4%
associate-*l/63.4%
Simplified63.4%
if -4.39999999999999984e92 < t < 3.45000000000000016e50Initial program 81.9%
Simplified81.2%
Taylor expanded in t around 0 70.2%
Final simplification67.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 (<= t -3.9e-50) (not (<= t 2.4e-63)))
(* a (/ (* t -4.0) c_m))
(* b (/ 1.0 (* c_m 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 tmp;
if ((t <= -3.9e-50) || !(t <= 2.4e-63)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b * (1.0 / (c_m * z));
}
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 <= (-3.9d-50)) .or. (.not. (t <= 2.4d-63))) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = b * (1.0d0 / (c_m * z))
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 <= -3.9e-50) || !(t <= 2.4e-63)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b * (1.0 / (c_m * z));
}
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 <= -3.9e-50) or not (t <= 2.4e-63): tmp = a * ((t * -4.0) / c_m) else: tmp = b * (1.0 / (c_m * 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) tmp = 0.0 if ((t <= -3.9e-50) || !(t <= 2.4e-63)) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(b * Float64(1.0 / Float64(c_m * z))); 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 <= -3.9e-50) || ~((t <= 2.4e-63)))
tmp = a * ((t * -4.0) / c_m);
else
tmp = b * (1.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]
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[t, -3.9e-50], N[Not[LessEqual[t, 2.4e-63]], $MachinePrecision]], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(b * N[(1.0 / N[(c$95$m * z), $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 -3.9 \cdot 10^{-50} \lor \neg \left(t \leq 2.4 \cdot 10^{-63}\right):\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{1}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -3.90000000000000021e-50 or 2.4000000000000001e-63 < t Initial program 71.2%
+-commutative71.2%
associate-+r-71.2%
*-commutative71.2%
associate-*r*76.0%
*-commutative76.0%
associate-+r-76.0%
+-commutative76.0%
associate-*l*75.4%
associate-*l*71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in z around inf 49.0%
associate-/l*57.5%
associate-*r*57.5%
*-commutative57.5%
associate-*r*57.5%
*-commutative57.5%
associate-*l/57.5%
Simplified57.5%
if -3.90000000000000021e-50 < t < 2.4000000000000001e-63Initial program 82.0%
+-commutative82.0%
associate-+r-82.0%
*-commutative82.0%
associate-*r*79.2%
*-commutative79.2%
associate-+r-79.2%
+-commutative79.2%
associate-*l*79.1%
associate-*l*82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in b around inf 44.7%
*-commutative44.7%
Simplified44.7%
div-inv45.6%
Applied egg-rr45.6%
Final simplification52.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
(if (or (<= t -6.4e-50) (not (<= t 8.5e-51)))
(* a (/ (* t -4.0) c_m))
(/ b (* c_m 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 tmp;
if ((t <= -6.4e-50) || !(t <= 8.5e-51)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b / (c_m * z);
}
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 <= (-6.4d-50)) .or. (.not. (t <= 8.5d-51))) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = b / (c_m * z)
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 <= -6.4e-50) || !(t <= 8.5e-51)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b / (c_m * z);
}
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 <= -6.4e-50) or not (t <= 8.5e-51): tmp = a * ((t * -4.0) / c_m) else: tmp = b / (c_m * 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) tmp = 0.0 if ((t <= -6.4e-50) || !(t <= 8.5e-51)) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(b / Float64(c_m * z)); 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 <= -6.4e-50) || ~((t <= 8.5e-51)))
tmp = a * ((t * -4.0) / c_m);
else
tmp = b / (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]
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[t, -6.4e-50], N[Not[LessEqual[t, 8.5e-51]], $MachinePrecision]], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], 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)
\\
[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 -6.4 \cdot 10^{-50} \lor \neg \left(t \leq 8.5 \cdot 10^{-51}\right):\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -6.4e-50 or 8.50000000000000036e-51 < t Initial program 71.9%
+-commutative71.9%
associate-+r-71.9%
*-commutative71.9%
associate-*r*76.8%
*-commutative76.8%
associate-+r-76.8%
+-commutative76.8%
associate-*l*76.2%
associate-*l*72.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in z around inf 49.3%
associate-/l*58.0%
associate-*r*58.0%
*-commutative58.0%
associate-*r*58.0%
*-commutative58.0%
associate-*l/58.0%
Simplified58.0%
if -6.4e-50 < t < 8.50000000000000036e-51Initial program 80.8%
+-commutative80.8%
associate-+r-80.8%
*-commutative80.8%
associate-*r*78.0%
*-commutative78.0%
associate-+r-78.0%
+-commutative78.0%
associate-*l*77.9%
associate-*l*81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in b around inf 44.4%
*-commutative44.4%
Simplified44.4%
Final simplification52.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 (<= t -2.3e-49) (not (<= t 2.9e-63)))
(* a (* t (/ -4.0 c_m)))
(/ b (* c_m 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 tmp;
if ((t <= -2.3e-49) || !(t <= 2.9e-63)) {
tmp = a * (t * (-4.0 / c_m));
} else {
tmp = b / (c_m * z);
}
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 <= (-2.3d-49)) .or. (.not. (t <= 2.9d-63))) then
tmp = a * (t * ((-4.0d0) / c_m))
else
tmp = b / (c_m * z)
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 <= -2.3e-49) || !(t <= 2.9e-63)) {
tmp = a * (t * (-4.0 / c_m));
} else {
tmp = b / (c_m * z);
}
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 <= -2.3e-49) or not (t <= 2.9e-63): tmp = a * (t * (-4.0 / c_m)) else: tmp = b / (c_m * 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) tmp = 0.0 if ((t <= -2.3e-49) || !(t <= 2.9e-63)) tmp = Float64(a * Float64(t * Float64(-4.0 / c_m))); else tmp = Float64(b / Float64(c_m * z)); 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 <= -2.3e-49) || ~((t <= 2.9e-63)))
tmp = a * (t * (-4.0 / c_m));
else
tmp = b / (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]
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[t, -2.3e-49], N[Not[LessEqual[t, 2.9e-63]], $MachinePrecision]], N[(a * N[(t * N[(-4.0 / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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)
\\
[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 -2.3 \cdot 10^{-49} \lor \neg \left(t \leq 2.9 \cdot 10^{-63}\right):\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -2.2999999999999999e-49 or 2.89999999999999975e-63 < t Initial program 71.2%
+-commutative71.2%
associate-+r-71.2%
*-commutative71.2%
associate-*r*76.0%
*-commutative76.0%
associate-+r-76.0%
+-commutative76.0%
associate-*l*75.4%
associate-*l*71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in x around 0 71.5%
Taylor expanded in z around inf 49.0%
associate-*r/49.0%
*-commutative49.0%
associate-*r/49.0%
associate-*r*57.5%
Simplified57.5%
if -2.2999999999999999e-49 < t < 2.89999999999999975e-63Initial program 82.0%
+-commutative82.0%
associate-+r-82.0%
*-commutative82.0%
associate-*r*79.2%
*-commutative79.2%
associate-+r-79.2%
+-commutative79.2%
associate-*l*79.1%
associate-*l*82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in b around inf 44.7%
*-commutative44.7%
Simplified44.7%
Final simplification52.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 (<= z -1.5e-66)
(* (/ (* a t) c_m) -4.0)
(if (<= z 4.7e+32) (/ (/ b c_m) z) (* a (* t (/ -4.0 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-66) {
tmp = ((a * t) / c_m) * -4.0;
} else if (z <= 4.7e+32) {
tmp = (b / 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)
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-66)) then
tmp = ((a * t) / c_m) * (-4.0d0)
else if (z <= 4.7d+32) then
tmp = (b / 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);
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-66) {
tmp = ((a * t) / c_m) * -4.0;
} else if (z <= 4.7e+32) {
tmp = (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) [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-66: tmp = ((a * t) / c_m) * -4.0 elif z <= 4.7e+32: tmp = (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) 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-66) tmp = Float64(Float64(Float64(a * t) / c_m) * -4.0); elseif (z <= 4.7e+32) tmp = Float64(Float64(b / c_m) / z); else tmp = Float64(a * Float64(t * Float64(-4.0 / 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-66)
tmp = ((a * t) / c_m) * -4.0;
elseif (z <= 4.7e+32)
tmp = (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]
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.5e-66], N[(N[(N[(a * t), $MachinePrecision] / c$95$m), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[z, 4.7e+32], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], N[(a * N[(t * N[(-4.0 / 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.5 \cdot 10^{-66}:\\
\;\;\;\;\frac{a \cdot t}{c\_m} \cdot -4\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{+32}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c\_m}\right)\\
\end{array}
\end{array}
if z < -1.5000000000000001e-66Initial program 67.9%
+-commutative67.9%
associate-+r-67.9%
*-commutative67.9%
associate-*r*70.3%
*-commutative70.3%
associate-+r-70.3%
+-commutative70.3%
associate-*l*70.3%
associate-*l*73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in z around inf 57.3%
*-commutative57.3%
Simplified57.3%
if -1.5000000000000001e-66 < z < 4.70000000000000023e32Initial program 90.1%
+-commutative90.1%
associate-+r-90.1%
*-commutative90.1%
associate-*r*90.4%
*-commutative90.4%
associate-+r-90.4%
+-commutative90.4%
associate-*l*89.6%
associate-*l*84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in a around -inf 71.0%
Taylor expanded in b around inf 50.4%
mul-1-neg50.4%
associate-/r*52.8%
distribute-neg-frac252.8%
Simplified52.8%
if 4.70000000000000023e32 < z Initial program 61.5%
+-commutative61.5%
associate-+r-61.5%
*-commutative61.5%
associate-*r*64.3%
*-commutative64.3%
associate-+r-64.3%
+-commutative64.3%
associate-*l*64.3%
associate-*l*65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in x around 0 75.7%
Taylor expanded in z around inf 47.3%
associate-*r/47.3%
*-commutative47.3%
associate-*r/47.3%
associate-*r*58.8%
Simplified58.8%
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 (<= z -5.3e-61)
(* (/ (* a t) c_m) -4.0)
(if (<= z 2.2e+32) (/ 1.0 (* z (/ c_m b))) (* a (* t (/ -4.0 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.3e-61) {
tmp = ((a * t) / c_m) * -4.0;
} else if (z <= 2.2e+32) {
tmp = 1.0 / (z * (c_m / b));
} else {
tmp = a * (t * (-4.0 / 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.3d-61)) then
tmp = ((a * t) / c_m) * (-4.0d0)
else if (z <= 2.2d+32) then
tmp = 1.0d0 / (z * (c_m / b))
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);
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.3e-61) {
tmp = ((a * t) / c_m) * -4.0;
} else if (z <= 2.2e+32) {
tmp = 1.0 / (z * (c_m / b));
} else {
tmp = a * (t * (-4.0 / 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.3e-61: tmp = ((a * t) / c_m) * -4.0 elif z <= 2.2e+32: tmp = 1.0 / (z * (c_m / b)) else: tmp = a * (t * (-4.0 / 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.3e-61) tmp = Float64(Float64(Float64(a * t) / c_m) * -4.0); elseif (z <= 2.2e+32) tmp = Float64(1.0 / Float64(z * Float64(c_m / b))); else tmp = Float64(a * Float64(t * Float64(-4.0 / 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.3e-61)
tmp = ((a * t) / c_m) * -4.0;
elseif (z <= 2.2e+32)
tmp = 1.0 / (z * (c_m / b));
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]
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, -5.3e-61], N[(N[(N[(a * t), $MachinePrecision] / c$95$m), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[z, 2.2e+32], N[(1.0 / N[(z * N[(c$95$m / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(t * N[(-4.0 / 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 -5.3 \cdot 10^{-61}:\\
\;\;\;\;\frac{a \cdot t}{c\_m} \cdot -4\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+32}:\\
\;\;\;\;\frac{1}{z \cdot \frac{c\_m}{b}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c\_m}\right)\\
\end{array}
\end{array}
if z < -5.3e-61Initial program 67.9%
+-commutative67.9%
associate-+r-67.9%
*-commutative67.9%
associate-*r*70.3%
*-commutative70.3%
associate-+r-70.3%
+-commutative70.3%
associate-*l*70.3%
associate-*l*73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in z around inf 57.3%
*-commutative57.3%
Simplified57.3%
if -5.3e-61 < z < 2.20000000000000001e32Initial program 90.1%
+-commutative90.1%
associate-+r-90.1%
*-commutative90.1%
associate-*r*90.4%
*-commutative90.4%
associate-+r-90.4%
+-commutative90.4%
associate-*l*89.6%
associate-*l*84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in b around inf 50.4%
*-commutative50.4%
Simplified50.4%
clear-num50.3%
inv-pow50.3%
Applied egg-rr50.3%
unpow-150.3%
associate-/l*52.7%
Simplified52.7%
if 2.20000000000000001e32 < z Initial program 61.5%
+-commutative61.5%
associate-+r-61.5%
*-commutative61.5%
associate-*r*64.3%
*-commutative64.3%
associate-+r-64.3%
+-commutative64.3%
associate-*l*64.3%
associate-*l*65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in x around 0 75.7%
Taylor expanded in z around inf 47.3%
associate-*r/47.3%
*-commutative47.3%
associate-*r/47.3%
associate-*r*58.8%
Simplified58.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 (<= z -1.4e-61)
(* (/ (* a t) c_m) -4.0)
(if (<= z 1.75e+32) (* b (/ 1.0 (* c_m z))) (* a (* t (/ -4.0 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.4e-61) {
tmp = ((a * t) / c_m) * -4.0;
} else if (z <= 1.75e+32) {
tmp = b * (1.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)
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.4d-61)) then
tmp = ((a * t) / c_m) * (-4.0d0)
else if (z <= 1.75d+32) then
tmp = b * (1.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);
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.4e-61) {
tmp = ((a * t) / c_m) * -4.0;
} else if (z <= 1.75e+32) {
tmp = b * (1.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) [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.4e-61: tmp = ((a * t) / c_m) * -4.0 elif z <= 1.75e+32: tmp = b * (1.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) 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.4e-61) tmp = Float64(Float64(Float64(a * t) / c_m) * -4.0); elseif (z <= 1.75e+32) tmp = Float64(b * Float64(1.0 / Float64(c_m * z))); else tmp = Float64(a * Float64(t * Float64(-4.0 / 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.4e-61)
tmp = ((a * t) / c_m) * -4.0;
elseif (z <= 1.75e+32)
tmp = b * (1.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]
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.4e-61], N[(N[(N[(a * t), $MachinePrecision] / c$95$m), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[z, 1.75e+32], N[(b * N[(1.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(t * N[(-4.0 / 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.4 \cdot 10^{-61}:\\
\;\;\;\;\frac{a \cdot t}{c\_m} \cdot -4\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+32}:\\
\;\;\;\;b \cdot \frac{1}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c\_m}\right)\\
\end{array}
\end{array}
if z < -1.4000000000000001e-61Initial program 67.9%
+-commutative67.9%
associate-+r-67.9%
*-commutative67.9%
associate-*r*70.3%
*-commutative70.3%
associate-+r-70.3%
+-commutative70.3%
associate-*l*70.3%
associate-*l*73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in z around inf 57.3%
*-commutative57.3%
Simplified57.3%
if -1.4000000000000001e-61 < z < 1.75e32Initial program 90.1%
+-commutative90.1%
associate-+r-90.1%
*-commutative90.1%
associate-*r*90.4%
*-commutative90.4%
associate-+r-90.4%
+-commutative90.4%
associate-*l*89.6%
associate-*l*84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in b around inf 50.4%
*-commutative50.4%
Simplified50.4%
div-inv51.3%
Applied egg-rr51.3%
if 1.75e32 < z Initial program 61.5%
+-commutative61.5%
associate-+r-61.5%
*-commutative61.5%
associate-*r*64.3%
*-commutative64.3%
associate-+r-64.3%
+-commutative64.3%
associate-*l*64.3%
associate-*l*65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in x around 0 75.7%
Taylor expanded in z around inf 47.3%
associate-*r/47.3%
*-commutative47.3%
associate-*r/47.3%
associate-*r*58.8%
Simplified58.8%
Final simplification55.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 (/ b (* c_m 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) {
return c_s * (b / (c_m * z));
}
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 / (c_m * z))
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 / (c_m * z));
}
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 / (c_m * z))
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(c_m * z))) 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 / (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]
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[(c$95$m * z), $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}{c\_m \cdot z}
\end{array}
Initial program 75.6%
+-commutative75.6%
associate-+r-75.6%
*-commutative75.6%
associate-*r*77.3%
*-commutative77.3%
associate-+r-77.3%
+-commutative77.3%
associate-*l*76.9%
associate-*l*76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in b around inf 34.5%
*-commutative34.5%
Simplified34.5%
Final simplification34.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t\_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t\_4}{z \cdot c}\\
t_6 := \frac{\left(t\_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 0:\\
\;\;\;\;\frac{\frac{t\_4}{z}}{c}\\
\mathbf{elif}\;t\_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t\_1\right) - t\_2\\
\mathbf{elif}\;t\_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t\_1\right) - t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024123
(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)))