
(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 17 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}
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* y (* x 9.0))))
(if (<= t_1 (- INFINITY))
(* 9.0 (/ (* x (/ y c)) z))
(if (<= t_1 2e+19)
(* (- (+ (/ b z) (* 9.0 (/ (* x y) z))) (* 4.0 (* a t))) (/ 1.0 c))
(if (<= t_1 5e+258)
(pow (/ (* c z) (+ b (- (* x (* 9.0 y)) (* (* a t) (* z 4.0))))) -1.0)
(/ (* (/ y c) (* x 9.0)) z))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 9.0 * ((x * (y / c)) / z);
} else if (t_1 <= 2e+19) {
tmp = (((b / z) + (9.0 * ((x * y) / z))) - (4.0 * (a * t))) * (1.0 / c);
} else if (t_1 <= 5e+258) {
tmp = pow(((c * z) / (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0))))), -1.0);
} else {
tmp = ((y / c) * (x * 9.0)) / z;
}
return tmp;
}
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = 9.0 * ((x * (y / c)) / z);
} else if (t_1 <= 2e+19) {
tmp = (((b / z) + (9.0 * ((x * y) / z))) - (4.0 * (a * t))) * (1.0 / c);
} else if (t_1 <= 5e+258) {
tmp = Math.pow(((c * z) / (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0))))), -1.0);
} else {
tmp = ((y / c) * (x * 9.0)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = y * (x * 9.0) tmp = 0 if t_1 <= -math.inf: tmp = 9.0 * ((x * (y / c)) / z) elif t_1 <= 2e+19: tmp = (((b / z) + (9.0 * ((x * y) / z))) - (4.0 * (a * t))) * (1.0 / c) elif t_1 <= 5e+258: tmp = math.pow(((c * z) / (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0))))), -1.0) else: tmp = ((y / c) * (x * 9.0)) / z return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(y * Float64(x * 9.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(9.0 * Float64(Float64(x * Float64(y / c)) / z)); elseif (t_1 <= 2e+19) tmp = Float64(Float64(Float64(Float64(b / z) + Float64(9.0 * Float64(Float64(x * y) / z))) - Float64(4.0 * Float64(a * t))) * Float64(1.0 / c)); elseif (t_1 <= 5e+258) tmp = Float64(Float64(c * z) / Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(a * t) * Float64(z * 4.0))))) ^ -1.0; else tmp = Float64(Float64(Float64(y / c) * Float64(x * 9.0)) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = y * (x * 9.0);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = 9.0 * ((x * (y / c)) / z);
elseif (t_1 <= 2e+19)
tmp = (((b / z) + (9.0 * ((x * y) / z))) - (4.0 * (a * t))) * (1.0 / c);
elseif (t_1 <= 5e+258)
tmp = ((c * z) / (b + ((x * (9.0 * y)) - ((a * t) * (z * 4.0))))) ^ -1.0;
else
tmp = ((y / c) * (x * 9.0)) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(9.0 * N[(N[(x * N[(y / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+19], N[(N[(N[(N[(b / z), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+258], N[Power[N[(N[(c * z), $MachinePrecision] / N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * t), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], N[(N[(N[(y / c), $MachinePrecision] * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 9\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;9 \cdot \frac{x \cdot \frac{y}{c}}{z}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+19}:\\
\;\;\;\;\left(\left(\frac{b}{z} + 9 \cdot \frac{x \cdot y}{z}\right) - 4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+258}:\\
\;\;\;\;{\left(\frac{c \cdot z}{b + \left(x \cdot \left(9 \cdot y\right) - \left(a \cdot t\right) \cdot \left(z \cdot 4\right)\right)}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{c} \cdot \left(x \cdot 9\right)}{z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < -inf.0Initial program 68.2%
associate-+l-68.2%
*-commutative68.2%
associate-*r*68.2%
*-commutative68.2%
associate-+l-68.2%
Simplified68.2%
Taylor expanded in x around inf 68.2%
times-frac95.5%
Simplified95.5%
associate-*r/99.9%
Applied egg-rr99.9%
if -inf.0 < (*.f64 (*.f64 x 9) y) < 2e19Initial program 83.8%
associate-+l-83.8%
*-commutative83.8%
associate-*r*83.8%
*-commutative83.8%
associate-+l-83.8%
Simplified83.7%
associate-/r*88.2%
div-inv88.1%
associate-+l-88.1%
associate-*r*85.3%
associate-+l-85.3%
associate-*l*85.3%
associate-*r*88.1%
Applied egg-rr88.1%
Taylor expanded in x around 0 93.5%
if 2e19 < (*.f64 (*.f64 x 9) y) < 5e258Initial program 92.0%
associate-+l-92.0%
*-commutative92.0%
associate-*r*89.3%
*-commutative89.3%
associate-+l-89.3%
Simplified92.1%
clear-num92.1%
inv-pow92.1%
associate-+l-92.1%
associate-*r*92.1%
associate-+l-92.1%
associate-*l*92.1%
associate-*r*92.1%
Applied egg-rr92.1%
if 5e258 < (*.f64 (*.f64 x 9) y) Initial program 70.8%
associate-+l-70.8%
*-commutative70.8%
associate-*r*70.8%
*-commutative70.8%
associate-+l-70.8%
Simplified70.8%
*-un-lft-identity70.8%
times-frac70.9%
associate-+l-70.9%
associate-*r*70.9%
associate-+l-70.9%
associate-*l*70.9%
associate-*r*70.9%
Applied egg-rr70.9%
Taylor expanded in x around inf 70.9%
associate-*l/92.2%
*-commutative92.2%
Simplified92.2%
associate-*l/92.3%
*-un-lft-identity92.3%
associate-*r*92.2%
Applied egg-rr92.2%
Final simplification93.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* y (* x 9.0))))
(if (<= t_1 (- INFINITY))
(* 9.0 (/ (* x (/ y c)) z))
(if (<= t_1 2e+19)
(* (- (+ (/ b z) (* 9.0 (/ (* x y) z))) (* 4.0 (* a t))) (/ 1.0 c))
(if (<= t_1 5e+258)
(/ (fma x (* 9.0 y) (+ b (* t (* a (* z -4.0))))) (* c z))
(/ (* (/ y c) (* x 9.0)) z))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 9.0 * ((x * (y / c)) / z);
} else if (t_1 <= 2e+19) {
tmp = (((b / z) + (9.0 * ((x * y) / z))) - (4.0 * (a * t))) * (1.0 / c);
} else if (t_1 <= 5e+258) {
tmp = fma(x, (9.0 * y), (b + (t * (a * (z * -4.0))))) / (c * z);
} else {
tmp = ((y / c) * (x * 9.0)) / z;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(y * Float64(x * 9.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(9.0 * Float64(Float64(x * Float64(y / c)) / z)); elseif (t_1 <= 2e+19) tmp = Float64(Float64(Float64(Float64(b / z) + Float64(9.0 * Float64(Float64(x * y) / z))) - Float64(4.0 * Float64(a * t))) * Float64(1.0 / c)); elseif (t_1 <= 5e+258) tmp = Float64(fma(x, Float64(9.0 * y), Float64(b + Float64(t * Float64(a * Float64(z * -4.0))))) / Float64(c * z)); else tmp = Float64(Float64(Float64(y / c) * Float64(x * 9.0)) / z); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(9.0 * N[(N[(x * N[(y / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+19], N[(N[(N[(N[(b / z), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+258], N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(b + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / c), $MachinePrecision] * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 9\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;9 \cdot \frac{x \cdot \frac{y}{c}}{z}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+19}:\\
\;\;\;\;\left(\left(\frac{b}{z} + 9 \cdot \frac{x \cdot y}{z}\right) - 4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+258}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 9 \cdot y, b + t \cdot \left(a \cdot \left(z \cdot -4\right)\right)\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{c} \cdot \left(x \cdot 9\right)}{z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < -inf.0Initial program 68.2%
associate-+l-68.2%
*-commutative68.2%
associate-*r*68.2%
*-commutative68.2%
associate-+l-68.2%
Simplified68.2%
Taylor expanded in x around inf 68.2%
times-frac95.5%
Simplified95.5%
associate-*r/99.9%
Applied egg-rr99.9%
if -inf.0 < (*.f64 (*.f64 x 9) y) < 2e19Initial program 83.8%
associate-+l-83.8%
*-commutative83.8%
associate-*r*83.8%
*-commutative83.8%
associate-+l-83.8%
Simplified83.7%
associate-/r*88.2%
div-inv88.1%
associate-+l-88.1%
associate-*r*85.3%
associate-+l-85.3%
associate-*l*85.3%
associate-*r*88.1%
Applied egg-rr88.1%
Taylor expanded in x around 0 93.5%
if 2e19 < (*.f64 (*.f64 x 9) y) < 5e258Initial program 92.0%
associate-+l-92.0%
associate-*l*92.0%
fma-neg92.0%
neg-sub092.0%
associate-+l-92.0%
neg-sub092.0%
+-commutative92.0%
distribute-rgt-neg-out92.0%
*-commutative92.0%
associate-*l*89.3%
distribute-rgt-neg-in89.3%
*-commutative89.3%
distribute-rgt-neg-in89.3%
distribute-rgt-neg-in89.3%
metadata-eval89.3%
Simplified89.3%
if 5e258 < (*.f64 (*.f64 x 9) y) Initial program 70.8%
associate-+l-70.8%
*-commutative70.8%
associate-*r*70.8%
*-commutative70.8%
associate-+l-70.8%
Simplified70.8%
*-un-lft-identity70.8%
times-frac70.9%
associate-+l-70.9%
associate-*r*70.9%
associate-+l-70.9%
associate-*l*70.9%
associate-*r*70.9%
Applied egg-rr70.9%
Taylor expanded in x around inf 70.9%
associate-*l/92.2%
*-commutative92.2%
Simplified92.2%
associate-*l/92.3%
*-un-lft-identity92.3%
associate-*r*92.2%
Applied egg-rr92.2%
Final simplification93.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* y (* x 9.0))))
(if (<= t_1 (- INFINITY))
(* 9.0 (/ (* x (/ y c)) z))
(if (<= t_1 2e+19)
(* (- (+ (/ b z) (* 9.0 (/ (* x y) z))) (* 4.0 (* a t))) (/ 1.0 c))
(if (<= t_1 5e+258)
(/ (+ b (- t_1 (* (* a t) (* z 4.0)))) (* c z))
(/ (* (/ y c) (* x 9.0)) z))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 9.0 * ((x * (y / c)) / z);
} else if (t_1 <= 2e+19) {
tmp = (((b / z) + (9.0 * ((x * y) / z))) - (4.0 * (a * t))) * (1.0 / c);
} else if (t_1 <= 5e+258) {
tmp = (b + (t_1 - ((a * t) * (z * 4.0)))) / (c * z);
} else {
tmp = ((y / c) * (x * 9.0)) / z;
}
return tmp;
}
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = 9.0 * ((x * (y / c)) / z);
} else if (t_1 <= 2e+19) {
tmp = (((b / z) + (9.0 * ((x * y) / z))) - (4.0 * (a * t))) * (1.0 / c);
} else if (t_1 <= 5e+258) {
tmp = (b + (t_1 - ((a * t) * (z * 4.0)))) / (c * z);
} else {
tmp = ((y / c) * (x * 9.0)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = y * (x * 9.0) tmp = 0 if t_1 <= -math.inf: tmp = 9.0 * ((x * (y / c)) / z) elif t_1 <= 2e+19: tmp = (((b / z) + (9.0 * ((x * y) / z))) - (4.0 * (a * t))) * (1.0 / c) elif t_1 <= 5e+258: tmp = (b + (t_1 - ((a * t) * (z * 4.0)))) / (c * z) else: tmp = ((y / c) * (x * 9.0)) / z return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(y * Float64(x * 9.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(9.0 * Float64(Float64(x * Float64(y / c)) / z)); elseif (t_1 <= 2e+19) tmp = Float64(Float64(Float64(Float64(b / z) + Float64(9.0 * Float64(Float64(x * y) / z))) - Float64(4.0 * Float64(a * t))) * Float64(1.0 / c)); elseif (t_1 <= 5e+258) tmp = Float64(Float64(b + Float64(t_1 - Float64(Float64(a * t) * Float64(z * 4.0)))) / Float64(c * z)); else tmp = Float64(Float64(Float64(y / c) * Float64(x * 9.0)) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = y * (x * 9.0);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = 9.0 * ((x * (y / c)) / z);
elseif (t_1 <= 2e+19)
tmp = (((b / z) + (9.0 * ((x * y) / z))) - (4.0 * (a * t))) * (1.0 / c);
elseif (t_1 <= 5e+258)
tmp = (b + (t_1 - ((a * t) * (z * 4.0)))) / (c * z);
else
tmp = ((y / c) * (x * 9.0)) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(9.0 * N[(N[(x * N[(y / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+19], N[(N[(N[(N[(b / z), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+258], N[(N[(b + N[(t$95$1 - N[(N[(a * t), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / c), $MachinePrecision] * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 9\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;9 \cdot \frac{x \cdot \frac{y}{c}}{z}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+19}:\\
\;\;\;\;\left(\left(\frac{b}{z} + 9 \cdot \frac{x \cdot y}{z}\right) - 4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+258}:\\
\;\;\;\;\frac{b + \left(t_1 - \left(a \cdot t\right) \cdot \left(z \cdot 4\right)\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{c} \cdot \left(x \cdot 9\right)}{z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < -inf.0Initial program 68.2%
associate-+l-68.2%
*-commutative68.2%
associate-*r*68.2%
*-commutative68.2%
associate-+l-68.2%
Simplified68.2%
Taylor expanded in x around inf 68.2%
times-frac95.5%
Simplified95.5%
associate-*r/99.9%
Applied egg-rr99.9%
if -inf.0 < (*.f64 (*.f64 x 9) y) < 2e19Initial program 83.8%
associate-+l-83.8%
*-commutative83.8%
associate-*r*83.8%
*-commutative83.8%
associate-+l-83.8%
Simplified83.7%
associate-/r*88.2%
div-inv88.1%
associate-+l-88.1%
associate-*r*85.3%
associate-+l-85.3%
associate-*l*85.3%
associate-*r*88.1%
Applied egg-rr88.1%
Taylor expanded in x around 0 93.5%
if 2e19 < (*.f64 (*.f64 x 9) y) < 5e258Initial program 92.0%
associate-+l-92.0%
*-commutative92.0%
associate-*r*89.3%
*-commutative89.3%
associate-+l-89.3%
Simplified92.1%
if 5e258 < (*.f64 (*.f64 x 9) y) Initial program 70.8%
associate-+l-70.8%
*-commutative70.8%
associate-*r*70.8%
*-commutative70.8%
associate-+l-70.8%
Simplified70.8%
*-un-lft-identity70.8%
times-frac70.9%
associate-+l-70.9%
associate-*r*70.9%
associate-+l-70.9%
associate-*l*70.9%
associate-*r*70.9%
Applied egg-rr70.9%
Taylor expanded in x around inf 70.9%
associate-*l/92.2%
*-commutative92.2%
Simplified92.2%
associate-*l/92.3%
*-un-lft-identity92.3%
associate-*r*92.2%
Applied egg-rr92.2%
Final simplification93.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -1.3e+183) (not (<= z 5.1e+112))) (/ (- (/ b z) (* 4.0 (* a t))) c) (/ (+ b (+ (* x (* 9.0 y)) (* -4.0 (* a (* z t))))) (* c z))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.3e+183) || !(z <= 5.1e+112)) {
tmp = ((b / z) - (4.0 * (a * t))) / c;
} else {
tmp = (b + ((x * (9.0 * y)) + (-4.0 * (a * (z * t))))) / (c * z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-1.3d+183)) .or. (.not. (z <= 5.1d+112))) then
tmp = ((b / z) - (4.0d0 * (a * t))) / c
else
tmp = (b + ((x * (9.0d0 * y)) + ((-4.0d0) * (a * (z * t))))) / (c * z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.3e+183) || !(z <= 5.1e+112)) {
tmp = ((b / z) - (4.0 * (a * t))) / c;
} else {
tmp = (b + ((x * (9.0 * y)) + (-4.0 * (a * (z * t))))) / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1.3e+183) or not (z <= 5.1e+112): tmp = ((b / z) - (4.0 * (a * t))) / c else: tmp = (b + ((x * (9.0 * y)) + (-4.0 * (a * (z * t))))) / (c * z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1.3e+183) || !(z <= 5.1e+112)) tmp = Float64(Float64(Float64(b / z) - Float64(4.0 * Float64(a * t))) / c); else tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) + Float64(-4.0 * Float64(a * Float64(z * t))))) / Float64(c * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -1.3e+183) || ~((z <= 5.1e+112)))
tmp = ((b / z) - (4.0 * (a * t))) / c;
else
tmp = (b + ((x * (9.0 * y)) + (-4.0 * (a * (z * t))))) / (c * z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1.3e+183], N[Not[LessEqual[z, 5.1e+112]], $MachinePrecision]], N[(N[(N[(b / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+183} \lor \neg \left(z \leq 5.1 \cdot 10^{+112}\right):\\
\;\;\;\;\frac{\frac{b}{z} - 4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) + -4 \cdot \left(a \cdot \left(z \cdot t\right)\right)\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -1.3e183 or 5.10000000000000011e112 < z Initial program 55.8%
associate-+l-55.8%
*-commutative55.8%
associate-*r*55.7%
*-commutative55.7%
associate-+l-55.7%
Simplified62.7%
associate-/r*73.5%
div-inv73.4%
associate-+l-73.4%
associate-*r*65.8%
associate-+l-65.8%
associate-*l*65.8%
associate-*r*73.4%
Applied egg-rr73.4%
Taylor expanded in x around 0 88.2%
Taylor expanded in y around 0 85.4%
if -1.3e183 < z < 5.10000000000000011e112Initial program 91.0%
associate-+l-91.0%
*-commutative91.0%
associate-*r*90.4%
*-commutative90.4%
associate-+l-90.4%
Simplified88.6%
associate-*r*91.0%
cancel-sign-sub-inv91.0%
associate-*l*90.9%
associate-*l*90.9%
Applied egg-rr90.9%
Taylor expanded in z around 0 90.9%
Final simplification89.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* a (/ t c)))) (t_2 (* 9.0 (* (/ y c) (/ x z)))))
(if (<= x -1.55e+111)
t_2
(if (<= x -1.05e+55)
(* -4.0 (/ (* a t) c))
(if (<= x -155000000.0)
(/ b (* c z))
(if (<= x -5.8e-204)
t_1
(if (<= x -8.5e-304)
(/ (/ b c) z)
(if (<= x 3.1e-35) t_1 t_2))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double t_2 = 9.0 * ((y / c) * (x / z));
double tmp;
if (x <= -1.55e+111) {
tmp = t_2;
} else if (x <= -1.05e+55) {
tmp = -4.0 * ((a * t) / c);
} else if (x <= -155000000.0) {
tmp = b / (c * z);
} else if (x <= -5.8e-204) {
tmp = t_1;
} else if (x <= -8.5e-304) {
tmp = (b / c) / z;
} else if (x <= 3.1e-35) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * (a * (t / c))
t_2 = 9.0d0 * ((y / c) * (x / z))
if (x <= (-1.55d+111)) then
tmp = t_2
else if (x <= (-1.05d+55)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (x <= (-155000000.0d0)) then
tmp = b / (c * z)
else if (x <= (-5.8d-204)) then
tmp = t_1
else if (x <= (-8.5d-304)) then
tmp = (b / c) / z
else if (x <= 3.1d-35) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double t_2 = 9.0 * ((y / c) * (x / z));
double tmp;
if (x <= -1.55e+111) {
tmp = t_2;
} else if (x <= -1.05e+55) {
tmp = -4.0 * ((a * t) / c);
} else if (x <= -155000000.0) {
tmp = b / (c * z);
} else if (x <= -5.8e-204) {
tmp = t_1;
} else if (x <= -8.5e-304) {
tmp = (b / c) / z;
} else if (x <= 3.1e-35) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * (t / c)) t_2 = 9.0 * ((y / c) * (x / z)) tmp = 0 if x <= -1.55e+111: tmp = t_2 elif x <= -1.05e+55: tmp = -4.0 * ((a * t) / c) elif x <= -155000000.0: tmp = b / (c * z) elif x <= -5.8e-204: tmp = t_1 elif x <= -8.5e-304: tmp = (b / c) / z elif x <= 3.1e-35: tmp = t_1 else: tmp = t_2 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a * Float64(t / c))) t_2 = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))) tmp = 0.0 if (x <= -1.55e+111) tmp = t_2; elseif (x <= -1.05e+55) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (x <= -155000000.0) tmp = Float64(b / Float64(c * z)); elseif (x <= -5.8e-204) tmp = t_1; elseif (x <= -8.5e-304) tmp = Float64(Float64(b / c) / z); elseif (x <= 3.1e-35) tmp = t_1; else tmp = t_2; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (a * (t / c));
t_2 = 9.0 * ((y / c) * (x / z));
tmp = 0.0;
if (x <= -1.55e+111)
tmp = t_2;
elseif (x <= -1.05e+55)
tmp = -4.0 * ((a * t) / c);
elseif (x <= -155000000.0)
tmp = b / (c * z);
elseif (x <= -5.8e-204)
tmp = t_1;
elseif (x <= -8.5e-304)
tmp = (b / c) / z;
elseif (x <= 3.1e-35)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.55e+111], t$95$2, If[LessEqual[x, -1.05e+55], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -155000000.0], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.8e-204], t$95$1, If[LessEqual[x, -8.5e-304], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 3.1e-35], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot \frac{t}{c}\right)\\
t_2 := 9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+111}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{+55}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;x \leq -155000000:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-204}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-304}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-35}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.55e111 or 3.10000000000000012e-35 < x Initial program 80.8%
associate-+l-80.8%
*-commutative80.8%
associate-*r*79.1%
*-commutative79.1%
associate-+l-79.1%
Simplified79.6%
Taylor expanded in x around inf 56.8%
times-frac61.7%
Simplified61.7%
if -1.55e111 < x < -1.05e55Initial program 79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*68.8%
*-commutative68.8%
associate-+l-68.8%
Simplified79.2%
Taylor expanded in z around inf 45.4%
if -1.05e55 < x < -1.55e8Initial program 86.6%
associate-+l-86.6%
associate-*l*86.4%
fma-neg86.4%
neg-sub086.4%
associate-+l-86.4%
neg-sub086.4%
+-commutative86.4%
distribute-rgt-neg-out86.4%
*-commutative86.4%
associate-*l*86.4%
distribute-rgt-neg-in86.4%
*-commutative86.4%
distribute-rgt-neg-in86.4%
distribute-rgt-neg-in86.4%
metadata-eval86.4%
Simplified86.4%
Taylor expanded in b around inf 44.2%
if -1.55e8 < x < -5.80000000000000018e-204 or -8.5e-304 < x < 3.10000000000000012e-35Initial program 83.2%
associate-+l-83.2%
*-commutative83.2%
associate-*r*85.0%
*-commutative85.0%
associate-+l-85.0%
Simplified85.2%
associate-/r*86.3%
div-inv86.2%
associate-+l-86.2%
associate-*r*81.6%
associate-+l-81.6%
associate-*l*81.6%
associate-*r*86.2%
Applied egg-rr86.2%
Taylor expanded in x around 0 91.6%
Taylor expanded in z around inf 54.5%
*-commutative54.5%
associate-/l*55.5%
Simplified55.5%
Taylor expanded in a around 0 54.5%
associate-/l*55.5%
*-rgt-identity55.5%
associate-*r/55.4%
associate-/r/55.4%
associate-*l/55.4%
*-lft-identity55.4%
Simplified55.4%
if -5.80000000000000018e-204 < x < -8.5e-304Initial program 87.9%
associate-+l-87.9%
*-commutative87.9%
associate-*r*88.0%
*-commutative88.0%
associate-+l-88.0%
Simplified82.0%
Taylor expanded in b around inf 51.7%
associate-/r*51.6%
Simplified51.6%
Final simplification57.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* a (/ t c)))) (t_2 (* 9.0 (/ y (/ z (/ x c))))))
(if (<= x -6e+110)
t_2
(if (<= x -2.4e+55)
(* -4.0 (/ (* a t) c))
(if (<= x -1.15e+34)
t_2
(if (<= x -2.1e-203)
t_1
(if (<= x 1.9e-307)
(/ (/ b c) z)
(if (<= x 1.85e-34) t_1 (* 9.0 (* (/ y c) (/ x z)))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double t_2 = 9.0 * (y / (z / (x / c)));
double tmp;
if (x <= -6e+110) {
tmp = t_2;
} else if (x <= -2.4e+55) {
tmp = -4.0 * ((a * t) / c);
} else if (x <= -1.15e+34) {
tmp = t_2;
} else if (x <= -2.1e-203) {
tmp = t_1;
} else if (x <= 1.9e-307) {
tmp = (b / c) / z;
} else if (x <= 1.85e-34) {
tmp = t_1;
} else {
tmp = 9.0 * ((y / c) * (x / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * (a * (t / c))
t_2 = 9.0d0 * (y / (z / (x / c)))
if (x <= (-6d+110)) then
tmp = t_2
else if (x <= (-2.4d+55)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (x <= (-1.15d+34)) then
tmp = t_2
else if (x <= (-2.1d-203)) then
tmp = t_1
else if (x <= 1.9d-307) then
tmp = (b / c) / z
else if (x <= 1.85d-34) then
tmp = t_1
else
tmp = 9.0d0 * ((y / c) * (x / z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double t_2 = 9.0 * (y / (z / (x / c)));
double tmp;
if (x <= -6e+110) {
tmp = t_2;
} else if (x <= -2.4e+55) {
tmp = -4.0 * ((a * t) / c);
} else if (x <= -1.15e+34) {
tmp = t_2;
} else if (x <= -2.1e-203) {
tmp = t_1;
} else if (x <= 1.9e-307) {
tmp = (b / c) / z;
} else if (x <= 1.85e-34) {
tmp = t_1;
} else {
tmp = 9.0 * ((y / c) * (x / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * (t / c)) t_2 = 9.0 * (y / (z / (x / c))) tmp = 0 if x <= -6e+110: tmp = t_2 elif x <= -2.4e+55: tmp = -4.0 * ((a * t) / c) elif x <= -1.15e+34: tmp = t_2 elif x <= -2.1e-203: tmp = t_1 elif x <= 1.9e-307: tmp = (b / c) / z elif x <= 1.85e-34: tmp = t_1 else: tmp = 9.0 * ((y / c) * (x / z)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a * Float64(t / c))) t_2 = Float64(9.0 * Float64(y / Float64(z / Float64(x / c)))) tmp = 0.0 if (x <= -6e+110) tmp = t_2; elseif (x <= -2.4e+55) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (x <= -1.15e+34) tmp = t_2; elseif (x <= -2.1e-203) tmp = t_1; elseif (x <= 1.9e-307) tmp = Float64(Float64(b / c) / z); elseif (x <= 1.85e-34) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (a * (t / c));
t_2 = 9.0 * (y / (z / (x / c)));
tmp = 0.0;
if (x <= -6e+110)
tmp = t_2;
elseif (x <= -2.4e+55)
tmp = -4.0 * ((a * t) / c);
elseif (x <= -1.15e+34)
tmp = t_2;
elseif (x <= -2.1e-203)
tmp = t_1;
elseif (x <= 1.9e-307)
tmp = (b / c) / z;
elseif (x <= 1.85e-34)
tmp = t_1;
else
tmp = 9.0 * ((y / c) * (x / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(y / N[(z / N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e+110], t$95$2, If[LessEqual[x, -2.4e+55], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.15e+34], t$95$2, If[LessEqual[x, -2.1e-203], t$95$1, If[LessEqual[x, 1.9e-307], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 1.85e-34], t$95$1, N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot \frac{t}{c}\right)\\
t_2 := 9 \cdot \frac{y}{\frac{z}{\frac{x}{c}}}\\
\mathbf{if}\;x \leq -6 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{+55}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-203}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-307}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-34}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if x < -6.00000000000000014e110 or -2.3999999999999999e55 < x < -1.1499999999999999e34Initial program 82.3%
associate-+l-82.3%
*-commutative82.3%
associate-*r*78.2%
*-commutative78.2%
associate-+l-78.2%
Simplified80.3%
associate-/r*78.8%
div-inv78.8%
associate-+l-78.8%
associate-*r*78.7%
associate-+l-78.7%
associate-*l*78.7%
associate-*r*78.8%
Applied egg-rr78.8%
Taylor expanded in x around inf 56.5%
times-frac54.4%
associate-/r/58.1%
associate-/l*63.9%
*-commutative63.9%
associate-/l*64.2%
Simplified64.2%
if -6.00000000000000014e110 < x < -2.3999999999999999e55Initial program 79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*68.8%
*-commutative68.8%
associate-+l-68.8%
Simplified79.2%
Taylor expanded in z around inf 45.4%
if -1.1499999999999999e34 < x < -2.10000000000000002e-203 or 1.89999999999999993e-307 < x < 1.84999999999999994e-34Initial program 81.8%
associate-+l-81.8%
*-commutative81.8%
associate-*r*83.5%
*-commutative83.5%
associate-+l-83.5%
Simplified83.7%
associate-/r*86.6%
div-inv86.5%
associate-+l-86.5%
associate-*r*82.0%
associate-+l-82.0%
associate-*l*82.0%
associate-*r*86.5%
Applied egg-rr86.5%
Taylor expanded in x around 0 92.7%
Taylor expanded in z around inf 54.5%
*-commutative54.5%
associate-/l*55.4%
Simplified55.4%
Taylor expanded in a around 0 54.5%
associate-/l*55.4%
*-rgt-identity55.4%
associate-*r/55.3%
associate-/r/55.3%
associate-*l/55.4%
*-lft-identity55.4%
Simplified55.4%
if -2.10000000000000002e-203 < x < 1.89999999999999993e-307Initial program 88.5%
associate-+l-88.5%
*-commutative88.5%
associate-*r*88.6%
*-commutative88.6%
associate-+l-88.6%
Simplified83.0%
Taylor expanded in b around inf 54.4%
associate-/r*54.4%
Simplified54.4%
if 1.84999999999999994e-34 < x Initial program 82.1%
associate-+l-82.1%
*-commutative82.1%
associate-*r*82.1%
*-commutative82.1%
associate-+l-82.1%
Simplified81.5%
Taylor expanded in x around inf 56.8%
times-frac64.7%
Simplified64.7%
Final simplification59.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* a (/ t c)))))
(if (<= x -7e+110)
(* 9.0 (/ (* x (/ y c)) z))
(if (<= x -2.8e+55)
(* -4.0 (/ (* a t) c))
(if (<= x -4.8e+33)
(* 9.0 (/ y (/ z (/ x c))))
(if (<= x -3.5e-204)
t_1
(if (<= x -5e-305)
(/ (/ b c) z)
(if (<= x 6.6e-34) t_1 (* 9.0 (* (/ y c) (/ x z)))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double tmp;
if (x <= -7e+110) {
tmp = 9.0 * ((x * (y / c)) / z);
} else if (x <= -2.8e+55) {
tmp = -4.0 * ((a * t) / c);
} else if (x <= -4.8e+33) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (x <= -3.5e-204) {
tmp = t_1;
} else if (x <= -5e-305) {
tmp = (b / c) / z;
} else if (x <= 6.6e-34) {
tmp = t_1;
} else {
tmp = 9.0 * ((y / c) * (x / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (a * (t / c))
if (x <= (-7d+110)) then
tmp = 9.0d0 * ((x * (y / c)) / z)
else if (x <= (-2.8d+55)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (x <= (-4.8d+33)) then
tmp = 9.0d0 * (y / (z / (x / c)))
else if (x <= (-3.5d-204)) then
tmp = t_1
else if (x <= (-5d-305)) then
tmp = (b / c) / z
else if (x <= 6.6d-34) then
tmp = t_1
else
tmp = 9.0d0 * ((y / c) * (x / z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double tmp;
if (x <= -7e+110) {
tmp = 9.0 * ((x * (y / c)) / z);
} else if (x <= -2.8e+55) {
tmp = -4.0 * ((a * t) / c);
} else if (x <= -4.8e+33) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (x <= -3.5e-204) {
tmp = t_1;
} else if (x <= -5e-305) {
tmp = (b / c) / z;
} else if (x <= 6.6e-34) {
tmp = t_1;
} else {
tmp = 9.0 * ((y / c) * (x / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * (t / c)) tmp = 0 if x <= -7e+110: tmp = 9.0 * ((x * (y / c)) / z) elif x <= -2.8e+55: tmp = -4.0 * ((a * t) / c) elif x <= -4.8e+33: tmp = 9.0 * (y / (z / (x / c))) elif x <= -3.5e-204: tmp = t_1 elif x <= -5e-305: tmp = (b / c) / z elif x <= 6.6e-34: tmp = t_1 else: tmp = 9.0 * ((y / c) * (x / z)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a * Float64(t / c))) tmp = 0.0 if (x <= -7e+110) tmp = Float64(9.0 * Float64(Float64(x * Float64(y / c)) / z)); elseif (x <= -2.8e+55) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (x <= -4.8e+33) tmp = Float64(9.0 * Float64(y / Float64(z / Float64(x / c)))); elseif (x <= -3.5e-204) tmp = t_1; elseif (x <= -5e-305) tmp = Float64(Float64(b / c) / z); elseif (x <= 6.6e-34) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (a * (t / c));
tmp = 0.0;
if (x <= -7e+110)
tmp = 9.0 * ((x * (y / c)) / z);
elseif (x <= -2.8e+55)
tmp = -4.0 * ((a * t) / c);
elseif (x <= -4.8e+33)
tmp = 9.0 * (y / (z / (x / c)));
elseif (x <= -3.5e-204)
tmp = t_1;
elseif (x <= -5e-305)
tmp = (b / c) / z;
elseif (x <= 6.6e-34)
tmp = t_1;
else
tmp = 9.0 * ((y / c) * (x / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7e+110], N[(9.0 * N[(N[(x * N[(y / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.8e+55], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.8e+33], N[(9.0 * N[(y / N[(z / N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.5e-204], t$95$1, If[LessEqual[x, -5e-305], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 6.6e-34], t$95$1, N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{if}\;x \leq -7 \cdot 10^{+110}:\\
\;\;\;\;9 \cdot \frac{x \cdot \frac{y}{c}}{z}\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{+55}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{+33}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{z}{\frac{x}{c}}}\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-204}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-305}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-34}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if x < -6.9999999999999998e110Initial program 80.2%
associate-+l-80.2%
*-commutative80.2%
associate-*r*75.7%
*-commutative75.7%
associate-+l-75.7%
Simplified78.1%
Taylor expanded in x around inf 58.1%
times-frac57.9%
Simplified57.9%
associate-*r/66.3%
Applied egg-rr66.3%
if -6.9999999999999998e110 < x < -2.8000000000000001e55Initial program 79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*68.8%
*-commutative68.8%
associate-+l-68.8%
Simplified79.2%
Taylor expanded in z around inf 45.4%
if -2.8000000000000001e55 < x < -4.8e33Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-+l-100.0%
Simplified100.0%
associate-/r*99.7%
div-inv100.0%
associate-+l-100.0%
associate-*r*100.0%
associate-+l-100.0%
associate-*l*100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 42.2%
times-frac23.7%
associate-/r/61.3%
associate-/l*61.3%
*-commutative61.3%
associate-/l*61.3%
Simplified61.3%
if -4.8e33 < x < -3.50000000000000027e-204 or -4.99999999999999985e-305 < x < 6.59999999999999965e-34Initial program 81.9%
associate-+l-81.9%
*-commutative81.9%
associate-*r*83.7%
*-commutative83.7%
associate-+l-83.7%
Simplified83.8%
associate-/r*85.8%
div-inv85.7%
associate-+l-85.7%
associate-*r*81.3%
associate-+l-81.3%
associate-*l*81.3%
associate-*r*85.7%
Applied egg-rr85.7%
Taylor expanded in x around 0 91.8%
Taylor expanded in z around inf 54.0%
*-commutative54.0%
associate-/l*54.9%
Simplified54.9%
Taylor expanded in a around 0 54.0%
associate-/l*54.9%
*-rgt-identity54.9%
associate-*r/54.9%
associate-/r/54.8%
associate-*l/54.9%
*-lft-identity54.9%
Simplified54.9%
if -3.50000000000000027e-204 < x < -4.99999999999999985e-305Initial program 87.9%
associate-+l-87.9%
*-commutative87.9%
associate-*r*88.0%
*-commutative88.0%
associate-+l-88.0%
Simplified82.0%
Taylor expanded in b around inf 51.7%
associate-/r*51.6%
Simplified51.6%
if 6.59999999999999965e-34 < x Initial program 82.1%
associate-+l-82.1%
*-commutative82.1%
associate-*r*82.1%
*-commutative82.1%
associate-+l-82.1%
Simplified81.5%
Taylor expanded in x around inf 56.8%
times-frac64.7%
Simplified64.7%
Final simplification59.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* a (/ t c)))))
(if (<= x -1.55e+111)
(/ (* x (* 9.0 (/ y c))) z)
(if (<= x -2.9e+55)
(* -4.0 (/ (* a t) c))
(if (<= x -4.5e+32)
(* 9.0 (/ y (/ z (/ x c))))
(if (<= x -4.8e-204)
t_1
(if (<= x 3.1e-301)
(/ (/ b c) z)
(if (<= x 1e-35) t_1 (* 9.0 (* (/ y c) (/ x z)))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double tmp;
if (x <= -1.55e+111) {
tmp = (x * (9.0 * (y / c))) / z;
} else if (x <= -2.9e+55) {
tmp = -4.0 * ((a * t) / c);
} else if (x <= -4.5e+32) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (x <= -4.8e-204) {
tmp = t_1;
} else if (x <= 3.1e-301) {
tmp = (b / c) / z;
} else if (x <= 1e-35) {
tmp = t_1;
} else {
tmp = 9.0 * ((y / c) * (x / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (a * (t / c))
if (x <= (-1.55d+111)) then
tmp = (x * (9.0d0 * (y / c))) / z
else if (x <= (-2.9d+55)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (x <= (-4.5d+32)) then
tmp = 9.0d0 * (y / (z / (x / c)))
else if (x <= (-4.8d-204)) then
tmp = t_1
else if (x <= 3.1d-301) then
tmp = (b / c) / z
else if (x <= 1d-35) then
tmp = t_1
else
tmp = 9.0d0 * ((y / c) * (x / z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double tmp;
if (x <= -1.55e+111) {
tmp = (x * (9.0 * (y / c))) / z;
} else if (x <= -2.9e+55) {
tmp = -4.0 * ((a * t) / c);
} else if (x <= -4.5e+32) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (x <= -4.8e-204) {
tmp = t_1;
} else if (x <= 3.1e-301) {
tmp = (b / c) / z;
} else if (x <= 1e-35) {
tmp = t_1;
} else {
tmp = 9.0 * ((y / c) * (x / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * (t / c)) tmp = 0 if x <= -1.55e+111: tmp = (x * (9.0 * (y / c))) / z elif x <= -2.9e+55: tmp = -4.0 * ((a * t) / c) elif x <= -4.5e+32: tmp = 9.0 * (y / (z / (x / c))) elif x <= -4.8e-204: tmp = t_1 elif x <= 3.1e-301: tmp = (b / c) / z elif x <= 1e-35: tmp = t_1 else: tmp = 9.0 * ((y / c) * (x / z)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a * Float64(t / c))) tmp = 0.0 if (x <= -1.55e+111) tmp = Float64(Float64(x * Float64(9.0 * Float64(y / c))) / z); elseif (x <= -2.9e+55) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (x <= -4.5e+32) tmp = Float64(9.0 * Float64(y / Float64(z / Float64(x / c)))); elseif (x <= -4.8e-204) tmp = t_1; elseif (x <= 3.1e-301) tmp = Float64(Float64(b / c) / z); elseif (x <= 1e-35) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (a * (t / c));
tmp = 0.0;
if (x <= -1.55e+111)
tmp = (x * (9.0 * (y / c))) / z;
elseif (x <= -2.9e+55)
tmp = -4.0 * ((a * t) / c);
elseif (x <= -4.5e+32)
tmp = 9.0 * (y / (z / (x / c)));
elseif (x <= -4.8e-204)
tmp = t_1;
elseif (x <= 3.1e-301)
tmp = (b / c) / z;
elseif (x <= 1e-35)
tmp = t_1;
else
tmp = 9.0 * ((y / c) * (x / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.55e+111], N[(N[(x * N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, -2.9e+55], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e+32], N[(9.0 * N[(y / N[(z / N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.8e-204], t$95$1, If[LessEqual[x, 3.1e-301], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 1e-35], t$95$1, N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+111}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot \frac{y}{c}\right)}{z}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{+55}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+32}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{z}{\frac{x}{c}}}\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-204}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-301}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 10^{-35}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if x < -1.55e111Initial program 80.2%
associate-+l-80.2%
*-commutative80.2%
associate-*r*75.7%
*-commutative75.7%
associate-+l-75.7%
Simplified78.1%
associate-/r*76.4%
div-inv76.4%
associate-+l-76.4%
associate-*r*76.3%
associate-+l-76.3%
associate-*l*76.3%
associate-*r*76.3%
Applied egg-rr76.3%
Taylor expanded in x around inf 58.1%
times-frac57.9%
associate-*r*57.8%
Simplified57.8%
associate-*r/66.5%
Applied egg-rr66.5%
if -1.55e111 < x < -2.8999999999999999e55Initial program 79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*68.8%
*-commutative68.8%
associate-+l-68.8%
Simplified79.2%
Taylor expanded in z around inf 45.4%
if -2.8999999999999999e55 < x < -4.5000000000000003e32Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-+l-100.0%
Simplified100.0%
associate-/r*99.7%
div-inv100.0%
associate-+l-100.0%
associate-*r*100.0%
associate-+l-100.0%
associate-*l*100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 42.2%
times-frac23.7%
associate-/r/61.3%
associate-/l*61.3%
*-commutative61.3%
associate-/l*61.3%
Simplified61.3%
if -4.5000000000000003e32 < x < -4.8e-204 or 3.10000000000000014e-301 < x < 1.00000000000000001e-35Initial program 82.7%
associate-+l-82.7%
*-commutative82.7%
associate-*r*84.4%
*-commutative84.4%
associate-+l-84.4%
Simplified84.6%
associate-/r*86.6%
div-inv86.5%
associate-+l-86.5%
associate-*r*82.0%
associate-+l-82.0%
associate-*l*82.0%
associate-*r*86.5%
Applied egg-rr86.5%
Taylor expanded in x around 0 91.8%
Taylor expanded in z around inf 53.6%
*-commutative53.6%
associate-/l*54.5%
Simplified54.5%
Taylor expanded in a around 0 53.6%
associate-/l*54.5%
*-rgt-identity54.5%
associate-*r/54.5%
associate-/r/54.4%
associate-*l/54.5%
*-lft-identity54.5%
Simplified54.5%
if -4.8e-204 < x < 3.10000000000000014e-301Initial program 87.9%
associate-+l-87.9%
*-commutative87.9%
associate-*r*88.0%
*-commutative88.0%
associate-+l-88.0%
Simplified82.0%
Taylor expanded in b around inf 51.7%
associate-/r*51.6%
Simplified51.6%
if 1.00000000000000001e-35 < x Initial program 81.1%
associate-+l-81.1%
*-commutative81.1%
associate-*r*81.1%
*-commutative81.1%
associate-+l-81.1%
Simplified80.5%
Taylor expanded in x around inf 56.1%
times-frac63.9%
Simplified63.9%
Final simplification58.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* a (/ t c)))))
(if (<= x -7e+110)
(* (/ 1.0 z) (* 9.0 (* x (/ y c))))
(if (<= x -2.15e+55)
(* -4.0 (/ (* a t) c))
(if (<= x -4.8e+32)
(* 9.0 (/ y (/ z (/ x c))))
(if (<= x -1.1e-204)
t_1
(if (<= x -5.6e-308)
(/ (/ b c) z)
(if (<= x 2.9e-36) t_1 (* 9.0 (* (/ y c) (/ x z)))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double tmp;
if (x <= -7e+110) {
tmp = (1.0 / z) * (9.0 * (x * (y / c)));
} else if (x <= -2.15e+55) {
tmp = -4.0 * ((a * t) / c);
} else if (x <= -4.8e+32) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (x <= -1.1e-204) {
tmp = t_1;
} else if (x <= -5.6e-308) {
tmp = (b / c) / z;
} else if (x <= 2.9e-36) {
tmp = t_1;
} else {
tmp = 9.0 * ((y / c) * (x / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (a * (t / c))
if (x <= (-7d+110)) then
tmp = (1.0d0 / z) * (9.0d0 * (x * (y / c)))
else if (x <= (-2.15d+55)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (x <= (-4.8d+32)) then
tmp = 9.0d0 * (y / (z / (x / c)))
else if (x <= (-1.1d-204)) then
tmp = t_1
else if (x <= (-5.6d-308)) then
tmp = (b / c) / z
else if (x <= 2.9d-36) then
tmp = t_1
else
tmp = 9.0d0 * ((y / c) * (x / z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double tmp;
if (x <= -7e+110) {
tmp = (1.0 / z) * (9.0 * (x * (y / c)));
} else if (x <= -2.15e+55) {
tmp = -4.0 * ((a * t) / c);
} else if (x <= -4.8e+32) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (x <= -1.1e-204) {
tmp = t_1;
} else if (x <= -5.6e-308) {
tmp = (b / c) / z;
} else if (x <= 2.9e-36) {
tmp = t_1;
} else {
tmp = 9.0 * ((y / c) * (x / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * (t / c)) tmp = 0 if x <= -7e+110: tmp = (1.0 / z) * (9.0 * (x * (y / c))) elif x <= -2.15e+55: tmp = -4.0 * ((a * t) / c) elif x <= -4.8e+32: tmp = 9.0 * (y / (z / (x / c))) elif x <= -1.1e-204: tmp = t_1 elif x <= -5.6e-308: tmp = (b / c) / z elif x <= 2.9e-36: tmp = t_1 else: tmp = 9.0 * ((y / c) * (x / z)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a * Float64(t / c))) tmp = 0.0 if (x <= -7e+110) tmp = Float64(Float64(1.0 / z) * Float64(9.0 * Float64(x * Float64(y / c)))); elseif (x <= -2.15e+55) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (x <= -4.8e+32) tmp = Float64(9.0 * Float64(y / Float64(z / Float64(x / c)))); elseif (x <= -1.1e-204) tmp = t_1; elseif (x <= -5.6e-308) tmp = Float64(Float64(b / c) / z); elseif (x <= 2.9e-36) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (a * (t / c));
tmp = 0.0;
if (x <= -7e+110)
tmp = (1.0 / z) * (9.0 * (x * (y / c)));
elseif (x <= -2.15e+55)
tmp = -4.0 * ((a * t) / c);
elseif (x <= -4.8e+32)
tmp = 9.0 * (y / (z / (x / c)));
elseif (x <= -1.1e-204)
tmp = t_1;
elseif (x <= -5.6e-308)
tmp = (b / c) / z;
elseif (x <= 2.9e-36)
tmp = t_1;
else
tmp = 9.0 * ((y / c) * (x / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7e+110], N[(N[(1.0 / z), $MachinePrecision] * N[(9.0 * N[(x * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.15e+55], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.8e+32], N[(9.0 * N[(y / N[(z / N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.1e-204], t$95$1, If[LessEqual[x, -5.6e-308], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 2.9e-36], t$95$1, N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{if}\;x \leq -7 \cdot 10^{+110}:\\
\;\;\;\;\frac{1}{z} \cdot \left(9 \cdot \left(x \cdot \frac{y}{c}\right)\right)\\
\mathbf{elif}\;x \leq -2.15 \cdot 10^{+55}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{+32}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{z}{\frac{x}{c}}}\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{-204}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{-308}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-36}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if x < -6.9999999999999998e110Initial program 80.2%
associate-+l-80.2%
*-commutative80.2%
associate-*r*75.7%
*-commutative75.7%
associate-+l-75.7%
Simplified78.1%
*-un-lft-identity78.1%
times-frac80.5%
associate-+l-80.5%
associate-*r*82.7%
associate-+l-82.7%
associate-*l*82.6%
associate-*r*80.5%
Applied egg-rr80.5%
Taylor expanded in x around inf 58.1%
associate-*l/66.5%
*-commutative66.5%
Simplified66.5%
if -6.9999999999999998e110 < x < -2.1499999999999999e55Initial program 79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*68.8%
*-commutative68.8%
associate-+l-68.8%
Simplified79.2%
Taylor expanded in z around inf 45.4%
if -2.1499999999999999e55 < x < -4.79999999999999983e32Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-+l-100.0%
Simplified100.0%
associate-/r*99.7%
div-inv100.0%
associate-+l-100.0%
associate-*r*100.0%
associate-+l-100.0%
associate-*l*100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 42.2%
times-frac23.7%
associate-/r/61.3%
associate-/l*61.3%
*-commutative61.3%
associate-/l*61.3%
Simplified61.3%
if -4.79999999999999983e32 < x < -1.0999999999999999e-204 or -5.59999999999999969e-308 < x < 2.90000000000000013e-36Initial program 82.8%
associate-+l-82.8%
*-commutative82.8%
associate-*r*84.5%
*-commutative84.5%
associate-+l-84.5%
Simplified84.7%
associate-/r*86.7%
div-inv86.6%
associate-+l-86.6%
associate-*r*82.1%
associate-+l-82.1%
associate-*l*82.1%
associate-*r*86.6%
Applied egg-rr86.6%
Taylor expanded in x around 0 91.8%
Taylor expanded in z around inf 54.0%
*-commutative54.0%
associate-/l*54.9%
Simplified54.9%
Taylor expanded in a around 0 54.0%
associate-/l*54.9%
*-rgt-identity54.9%
associate-*r/54.9%
associate-/r/54.8%
associate-*l/54.9%
*-lft-identity54.9%
Simplified54.9%
if -1.0999999999999999e-204 < x < -5.59999999999999969e-308Initial program 87.2%
associate-+l-87.2%
*-commutative87.2%
associate-*r*87.2%
*-commutative87.2%
associate-+l-87.2%
Simplified80.8%
Taylor expanded in b around inf 54.6%
associate-/r*54.6%
Simplified54.6%
if 2.90000000000000013e-36 < x Initial program 81.1%
associate-+l-81.1%
*-commutative81.1%
associate-*r*81.1%
*-commutative81.1%
associate-+l-81.1%
Simplified80.5%
Taylor expanded in x around inf 56.1%
times-frac63.9%
Simplified63.9%
Final simplification59.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 4.0 (* a t))))
(if (<= z -3.8e-96)
(/ (- (* 9.0 (/ (* x y) z)) t_1) c)
(if (<= z 1.5e+62)
(/ (+ b (* 9.0 (* x y))) (* c z))
(/ (- (/ b z) t_1) c)))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 4.0 * (a * t);
double tmp;
if (z <= -3.8e-96) {
tmp = ((9.0 * ((x * y) / z)) - t_1) / c;
} else if (z <= 1.5e+62) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else {
tmp = ((b / z) - t_1) / c;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 4.0d0 * (a * t)
if (z <= (-3.8d-96)) then
tmp = ((9.0d0 * ((x * y) / z)) - t_1) / c
else if (z <= 1.5d+62) then
tmp = (b + (9.0d0 * (x * y))) / (c * z)
else
tmp = ((b / z) - t_1) / c
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 4.0 * (a * t);
double tmp;
if (z <= -3.8e-96) {
tmp = ((9.0 * ((x * y) / z)) - t_1) / c;
} else if (z <= 1.5e+62) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else {
tmp = ((b / z) - t_1) / c;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = 4.0 * (a * t) tmp = 0 if z <= -3.8e-96: tmp = ((9.0 * ((x * y) / z)) - t_1) / c elif z <= 1.5e+62: tmp = (b + (9.0 * (x * y))) / (c * z) else: tmp = ((b / z) - t_1) / c return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(4.0 * Float64(a * t)) tmp = 0.0 if (z <= -3.8e-96) tmp = Float64(Float64(Float64(9.0 * Float64(Float64(x * y) / z)) - t_1) / c); elseif (z <= 1.5e+62) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c * z)); else tmp = Float64(Float64(Float64(b / z) - t_1) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 4.0 * (a * t);
tmp = 0.0;
if (z <= -3.8e-96)
tmp = ((9.0 * ((x * y) / z)) - t_1) / c;
elseif (z <= 1.5e+62)
tmp = (b + (9.0 * (x * y))) / (c * z);
else
tmp = ((b / z) - t_1) / c;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e-96], N[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.5e+62], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] - t$95$1), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{-96}:\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z} - t_1}{c}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+62}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} - t_1}{c}\\
\end{array}
\end{array}
if z < -3.8000000000000001e-96Initial program 83.4%
associate-+l-83.4%
*-commutative83.4%
associate-*r*79.9%
*-commutative79.9%
associate-+l-79.9%
Simplified85.7%
associate-/r*87.2%
div-inv87.2%
associate-+l-87.2%
associate-*r*84.8%
associate-+l-84.8%
associate-*l*84.8%
associate-*r*87.2%
Applied egg-rr87.2%
Taylor expanded in x around 0 91.8%
Taylor expanded in b around 0 75.3%
if -3.8000000000000001e-96 < z < 1.5e62Initial program 91.3%
associate-+l-91.3%
*-commutative91.3%
associate-*r*91.3%
*-commutative91.3%
associate-+l-91.3%
Simplified87.5%
Taylor expanded in x around inf 81.5%
if 1.5e62 < z Initial program 59.7%
associate-+l-59.7%
*-commutative59.7%
associate-*r*63.2%
*-commutative63.2%
associate-+l-63.2%
Simplified64.4%
associate-/r*75.3%
div-inv75.2%
associate-+l-75.2%
associate-*r*69.6%
associate-+l-69.6%
associate-*l*69.6%
associate-*r*75.2%
Applied egg-rr75.2%
Taylor expanded in x around 0 89.4%
Taylor expanded in y around 0 84.2%
Final simplification80.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* a (/ t c)))))
(if (<= t -1.05e+114)
t_1
(if (<= t -2.3e-20)
(/ b (* c z))
(if (<= t -1.25e-59)
(* -4.0 (/ (* a t) c))
(if (<= t 5.6e-28) (* b (/ 1.0 (* c z))) t_1))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double tmp;
if (t <= -1.05e+114) {
tmp = t_1;
} else if (t <= -2.3e-20) {
tmp = b / (c * z);
} else if (t <= -1.25e-59) {
tmp = -4.0 * ((a * t) / c);
} else if (t <= 5.6e-28) {
tmp = b * (1.0 / (c * z));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (a * (t / c))
if (t <= (-1.05d+114)) then
tmp = t_1
else if (t <= (-2.3d-20)) then
tmp = b / (c * z)
else if (t <= (-1.25d-59)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (t <= 5.6d-28) then
tmp = b * (1.0d0 / (c * z))
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * (t / c));
double tmp;
if (t <= -1.05e+114) {
tmp = t_1;
} else if (t <= -2.3e-20) {
tmp = b / (c * z);
} else if (t <= -1.25e-59) {
tmp = -4.0 * ((a * t) / c);
} else if (t <= 5.6e-28) {
tmp = b * (1.0 / (c * z));
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * (t / c)) tmp = 0 if t <= -1.05e+114: tmp = t_1 elif t <= -2.3e-20: tmp = b / (c * z) elif t <= -1.25e-59: tmp = -4.0 * ((a * t) / c) elif t <= 5.6e-28: tmp = b * (1.0 / (c * z)) else: tmp = t_1 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a * Float64(t / c))) tmp = 0.0 if (t <= -1.05e+114) tmp = t_1; elseif (t <= -2.3e-20) tmp = Float64(b / Float64(c * z)); elseif (t <= -1.25e-59) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (t <= 5.6e-28) tmp = Float64(b * Float64(1.0 / Float64(c * z))); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (a * (t / c));
tmp = 0.0;
if (t <= -1.05e+114)
tmp = t_1;
elseif (t <= -2.3e-20)
tmp = b / (c * z);
elseif (t <= -1.25e-59)
tmp = -4.0 * ((a * t) / c);
elseif (t <= 5.6e-28)
tmp = b * (1.0 / (c * z));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.05e+114], t$95$1, If[LessEqual[t, -2.3e-20], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.25e-59], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e-28], N[(b * N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{+114}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-20}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{-59}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{-28}:\\
\;\;\;\;b \cdot \frac{1}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.05e114 or 5.5999999999999996e-28 < t Initial program 73.9%
associate-+l-73.9%
*-commutative73.9%
associate-*r*78.4%
*-commutative78.4%
associate-+l-78.4%
Simplified74.0%
associate-/r*75.9%
div-inv75.8%
associate-+l-75.8%
associate-*r*71.3%
associate-+l-71.3%
associate-*l*71.3%
associate-*r*75.8%
Applied egg-rr75.8%
Taylor expanded in x around 0 83.6%
Taylor expanded in z around inf 54.9%
*-commutative54.9%
associate-/l*60.2%
Simplified60.2%
Taylor expanded in a around 0 54.9%
associate-/l*60.2%
*-rgt-identity60.2%
associate-*r/59.3%
associate-/r/59.3%
associate-*l/59.4%
*-lft-identity59.4%
Simplified59.4%
if -1.05e114 < t < -2.2999999999999999e-20Initial program 79.2%
associate-+l-79.2%
associate-*l*79.3%
fma-neg79.3%
neg-sub079.3%
associate-+l-79.3%
neg-sub079.3%
+-commutative79.3%
distribute-rgt-neg-out79.3%
*-commutative79.3%
associate-*l*79.3%
distribute-rgt-neg-in79.3%
*-commutative79.3%
distribute-rgt-neg-in79.3%
distribute-rgt-neg-in79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in b around inf 38.2%
if -2.2999999999999999e-20 < t < -1.25e-59Initial program 91.9%
associate-+l-91.9%
*-commutative91.9%
associate-*r*92.1%
*-commutative92.1%
associate-+l-92.1%
Simplified91.9%
Taylor expanded in z around inf 37.4%
if -1.25e-59 < t < 5.5999999999999996e-28Initial program 89.7%
associate-+l-89.7%
associate-*l*89.6%
fma-neg89.6%
neg-sub089.6%
associate-+l-89.6%
neg-sub089.6%
+-commutative89.6%
distribute-rgt-neg-out89.6%
*-commutative89.6%
associate-*l*84.5%
distribute-rgt-neg-in84.5%
*-commutative84.5%
distribute-rgt-neg-in84.5%
distribute-rgt-neg-in84.5%
metadata-eval84.5%
Simplified84.5%
Taylor expanded in b around inf 45.1%
div-inv45.1%
Applied egg-rr45.1%
Final simplification50.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -1.05e+114)
(* -4.0 (* a (/ t c)))
(if (<= t -1.3e-16)
(/ b (* c z))
(if (<= t -3.7e-59)
(* -4.0 (/ (* a t) c))
(if (<= t 6.6e-28) (* b (/ 1.0 (* c z))) (* -4.0 (* t (/ a c))))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -1.05e+114) {
tmp = -4.0 * (a * (t / c));
} else if (t <= -1.3e-16) {
tmp = b / (c * z);
} else if (t <= -3.7e-59) {
tmp = -4.0 * ((a * t) / c);
} else if (t <= 6.6e-28) {
tmp = b * (1.0 / (c * z));
} else {
tmp = -4.0 * (t * (a / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (t <= (-1.05d+114)) then
tmp = (-4.0d0) * (a * (t / c))
else if (t <= (-1.3d-16)) then
tmp = b / (c * z)
else if (t <= (-3.7d-59)) then
tmp = (-4.0d0) * ((a * t) / c)
else if (t <= 6.6d-28) then
tmp = b * (1.0d0 / (c * z))
else
tmp = (-4.0d0) * (t * (a / c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -1.05e+114) {
tmp = -4.0 * (a * (t / c));
} else if (t <= -1.3e-16) {
tmp = b / (c * z);
} else if (t <= -3.7e-59) {
tmp = -4.0 * ((a * t) / c);
} else if (t <= 6.6e-28) {
tmp = b * (1.0 / (c * z));
} else {
tmp = -4.0 * (t * (a / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -1.05e+114: tmp = -4.0 * (a * (t / c)) elif t <= -1.3e-16: tmp = b / (c * z) elif t <= -3.7e-59: tmp = -4.0 * ((a * t) / c) elif t <= 6.6e-28: tmp = b * (1.0 / (c * z)) else: tmp = -4.0 * (t * (a / c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -1.05e+114) tmp = Float64(-4.0 * Float64(a * Float64(t / c))); elseif (t <= -1.3e-16) tmp = Float64(b / Float64(c * z)); elseif (t <= -3.7e-59) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); elseif (t <= 6.6e-28) tmp = Float64(b * Float64(1.0 / Float64(c * z))); else tmp = Float64(-4.0 * Float64(t * Float64(a / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -1.05e+114)
tmp = -4.0 * (a * (t / c));
elseif (t <= -1.3e-16)
tmp = b / (c * z);
elseif (t <= -3.7e-59)
tmp = -4.0 * ((a * t) / c);
elseif (t <= 6.6e-28)
tmp = b * (1.0 / (c * z));
else
tmp = -4.0 * (t * (a / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -1.05e+114], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.3e-16], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.7e-59], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e-28], N[(b * N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+114}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-16}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t \leq -3.7 \cdot 10^{-59}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{-28}:\\
\;\;\;\;b \cdot \frac{1}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if t < -1.05e114Initial program 80.4%
associate-+l-80.4%
*-commutative80.4%
associate-*r*82.7%
*-commutative82.7%
associate-+l-82.7%
Simplified78.0%
associate-/r*76.1%
div-inv76.1%
associate-+l-76.1%
associate-*r*73.6%
associate-+l-73.6%
associate-*l*73.6%
associate-*r*76.1%
Applied egg-rr76.1%
Taylor expanded in x around 0 80.6%
Taylor expanded in z around inf 66.2%
*-commutative66.2%
associate-/l*75.3%
Simplified75.3%
Taylor expanded in a around 0 66.2%
associate-/l*75.3%
*-rgt-identity75.3%
associate-*r/73.1%
associate-/r/73.1%
associate-*l/73.1%
*-lft-identity73.1%
Simplified73.1%
if -1.05e114 < t < -1.2999999999999999e-16Initial program 79.2%
associate-+l-79.2%
associate-*l*79.3%
fma-neg79.3%
neg-sub079.3%
associate-+l-79.3%
neg-sub079.3%
+-commutative79.3%
distribute-rgt-neg-out79.3%
*-commutative79.3%
associate-*l*79.3%
distribute-rgt-neg-in79.3%
*-commutative79.3%
distribute-rgt-neg-in79.3%
distribute-rgt-neg-in79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in b around inf 38.2%
if -1.2999999999999999e-16 < t < -3.6999999999999999e-59Initial program 91.9%
associate-+l-91.9%
*-commutative91.9%
associate-*r*92.1%
*-commutative92.1%
associate-+l-92.1%
Simplified91.9%
Taylor expanded in z around inf 37.4%
if -3.6999999999999999e-59 < t < 6.6000000000000003e-28Initial program 89.7%
associate-+l-89.7%
associate-*l*89.6%
fma-neg89.6%
neg-sub089.6%
associate-+l-89.6%
neg-sub089.6%
+-commutative89.6%
distribute-rgt-neg-out89.6%
*-commutative89.6%
associate-*l*84.5%
distribute-rgt-neg-in84.5%
*-commutative84.5%
distribute-rgt-neg-in84.5%
distribute-rgt-neg-in84.5%
metadata-eval84.5%
Simplified84.5%
Taylor expanded in b around inf 45.1%
div-inv45.1%
Applied egg-rr45.1%
if 6.6000000000000003e-28 < t Initial program 69.9%
associate-+l-69.9%
*-commutative69.9%
associate-*r*75.7%
*-commutative75.7%
associate-+l-75.7%
Simplified71.6%
Taylor expanded in z around inf 48.1%
*-commutative48.1%
associate-/l*51.0%
associate-/r/55.1%
Simplified55.1%
Final simplification51.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.2e+183)
(* -4.0 (* t (/ a c)))
(if (<= z 6.3e+63)
(/ (+ b (* 9.0 (* x y))) (* c z))
(* -4.0 (* a (/ t c))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.2e+183) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 6.3e+63) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else {
tmp = -4.0 * (a * (t / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (z <= (-1.2d+183)) then
tmp = (-4.0d0) * (t * (a / c))
else if (z <= 6.3d+63) then
tmp = (b + (9.0d0 * (x * y))) / (c * z)
else
tmp = (-4.0d0) * (a * (t / c))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.2e+183) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 6.3e+63) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else {
tmp = -4.0 * (a * (t / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -1.2e+183: tmp = -4.0 * (t * (a / c)) elif z <= 6.3e+63: tmp = (b + (9.0 * (x * y))) / (c * z) else: tmp = -4.0 * (a * (t / c)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.2e+183) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (z <= 6.3e+63) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c * z)); else tmp = Float64(-4.0 * Float64(a * Float64(t / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -1.2e+183)
tmp = -4.0 * (t * (a / c));
elseif (z <= 6.3e+63)
tmp = (b + (9.0 * (x * y))) / (c * z);
else
tmp = -4.0 * (a * (t / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.2e+183], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.3e+63], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+183}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;z \leq 6.3 \cdot 10^{+63}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\end{array}
\end{array}
if z < -1.2000000000000001e183Initial program 59.6%
associate-+l-59.6%
*-commutative59.6%
associate-*r*51.1%
*-commutative51.1%
associate-+l-51.1%
Simplified68.4%
Taylor expanded in z around inf 65.1%
*-commutative65.1%
associate-/l*69.2%
associate-/r/65.1%
Simplified65.1%
if -1.2000000000000001e183 < z < 6.2999999999999998e63Initial program 91.5%
associate-+l-91.5%
*-commutative91.5%
associate-*r*91.0%
*-commutative91.0%
associate-+l-91.0%
Simplified89.0%
Taylor expanded in x around inf 75.0%
if 6.2999999999999998e63 < z Initial program 59.7%
associate-+l-59.7%
*-commutative59.7%
associate-*r*63.2%
*-commutative63.2%
associate-+l-63.2%
Simplified64.4%
associate-/r*75.3%
div-inv75.2%
associate-+l-75.2%
associate-*r*69.6%
associate-+l-69.6%
associate-*l*69.6%
associate-*r*75.2%
Applied egg-rr75.2%
Taylor expanded in x around 0 89.4%
Taylor expanded in z around inf 72.1%
*-commutative72.1%
associate-/l*67.9%
Simplified67.9%
Taylor expanded in a around 0 72.1%
associate-/l*67.9%
*-rgt-identity67.9%
associate-*r/67.8%
associate-/r/68.6%
associate-*l/68.6%
*-lft-identity68.6%
Simplified68.6%
Final simplification72.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= x -7.2e+142)
(* 9.0 (/ y (/ z (/ x c))))
(if (<= x 0.82)
(/ (- (/ b z) (* 4.0 (* a t))) c)
(* 9.0 (* (/ y c) (/ x z))))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -7.2e+142) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (x <= 0.82) {
tmp = ((b / z) - (4.0 * (a * t))) / c;
} else {
tmp = 9.0 * ((y / c) * (x / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (x <= (-7.2d+142)) then
tmp = 9.0d0 * (y / (z / (x / c)))
else if (x <= 0.82d0) then
tmp = ((b / z) - (4.0d0 * (a * t))) / c
else
tmp = 9.0d0 * ((y / c) * (x / z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -7.2e+142) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (x <= 0.82) {
tmp = ((b / z) - (4.0 * (a * t))) / c;
} else {
tmp = 9.0 * ((y / c) * (x / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if x <= -7.2e+142: tmp = 9.0 * (y / (z / (x / c))) elif x <= 0.82: tmp = ((b / z) - (4.0 * (a * t))) / c else: tmp = 9.0 * ((y / c) * (x / z)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -7.2e+142) tmp = Float64(9.0 * Float64(y / Float64(z / Float64(x / c)))); elseif (x <= 0.82) tmp = Float64(Float64(Float64(b / z) - Float64(4.0 * Float64(a * t))) / c); else tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (x <= -7.2e+142)
tmp = 9.0 * (y / (z / (x / c)));
elseif (x <= 0.82)
tmp = ((b / z) - (4.0 * (a * t))) / c;
else
tmp = 9.0 * ((y / c) * (x / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -7.2e+142], N[(9.0 * N[(y / N[(z / N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.82], N[(N[(N[(b / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+142}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{z}{\frac{x}{c}}}\\
\mathbf{elif}\;x \leq 0.82:\\
\;\;\;\;\frac{\frac{b}{z} - 4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if x < -7.2000000000000003e142Initial program 84.0%
associate-+l-84.0%
*-commutative84.0%
associate-*r*78.5%
*-commutative78.5%
associate-+l-78.5%
Simplified81.4%
associate-/r*73.9%
div-inv73.9%
associate-+l-73.9%
associate-*r*73.8%
associate-+l-73.8%
associate-*l*73.8%
associate-*r*73.8%
Applied egg-rr73.8%
Taylor expanded in x around inf 64.7%
times-frac64.6%
associate-/r/64.3%
associate-/l*72.1%
*-commutative72.1%
associate-/l*72.6%
Simplified72.6%
if -7.2000000000000003e142 < x < 0.819999999999999951Initial program 81.4%
associate-+l-81.4%
*-commutative81.4%
associate-*r*82.0%
*-commutative82.0%
associate-+l-82.0%
Simplified81.9%
associate-/r*86.7%
div-inv86.6%
associate-+l-86.6%
associate-*r*83.5%
associate-+l-83.5%
associate-*l*83.5%
associate-*r*86.6%
Applied egg-rr86.6%
Taylor expanded in x around 0 92.7%
Taylor expanded in y around 0 78.3%
if 0.819999999999999951 < x Initial program 83.6%
associate-+l-83.6%
*-commutative83.6%
associate-*r*83.6%
*-commutative83.6%
associate-+l-83.6%
Simplified83.6%
Taylor expanded in x around inf 59.0%
times-frac66.6%
Simplified66.6%
Final simplification74.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -9e-99) (not (<= z 3.05e+44))) (* -4.0 (/ (* a t) c)) (/ b (* c z))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -9e-99) || !(z <= 3.05e+44)) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = b / (c * z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-9d-99)) .or. (.not. (z <= 3.05d+44))) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = b / (c * z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -9e-99) || !(z <= 3.05e+44)) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = b / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -9e-99) or not (z <= 3.05e+44): tmp = -4.0 * ((a * t) / c) else: tmp = b / (c * z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -9e-99) || !(z <= 3.05e+44)) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(b / Float64(c * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -9e-99) || ~((z <= 3.05e+44)))
tmp = -4.0 * ((a * t) / c);
else
tmp = b / (c * z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -9e-99], N[Not[LessEqual[z, 3.05e+44]], $MachinePrecision]], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-99} \lor \neg \left(z \leq 3.05 \cdot 10^{+44}\right):\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\end{array}
\end{array}
if z < -9.0000000000000006e-99 or 3.04999999999999991e44 < z Initial program 75.1%
associate-+l-75.1%
*-commutative75.1%
associate-*r*74.4%
*-commutative74.4%
associate-+l-74.4%
Simplified78.3%
Taylor expanded in z around inf 58.7%
if -9.0000000000000006e-99 < z < 3.04999999999999991e44Initial program 90.9%
associate-+l-90.9%
associate-*l*90.9%
fma-neg90.9%
neg-sub090.9%
associate-+l-90.9%
neg-sub090.9%
+-commutative90.9%
distribute-rgt-neg-out90.9%
*-commutative90.9%
associate-*l*90.9%
distribute-rgt-neg-in90.9%
*-commutative90.9%
distribute-rgt-neg-in90.9%
distribute-rgt-neg-in90.9%
metadata-eval90.9%
Simplified90.9%
Taylor expanded in b around inf 53.7%
Final simplification56.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -2.4e-95) (not (<= z 1.62e+49))) (* -4.0 (/ (* a t) c)) (* b (/ 1.0 (* c z)))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2.4e-95) || !(z <= 1.62e+49)) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = b * (1.0 / (c * z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-2.4d-95)) .or. (.not. (z <= 1.62d+49))) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = b * (1.0d0 / (c * z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2.4e-95) || !(z <= 1.62e+49)) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = b * (1.0 / (c * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -2.4e-95) or not (z <= 1.62e+49): tmp = -4.0 * ((a * t) / c) else: tmp = b * (1.0 / (c * z)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2.4e-95) || !(z <= 1.62e+49)) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(b * Float64(1.0 / Float64(c * z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -2.4e-95) || ~((z <= 1.62e+49)))
tmp = -4.0 * ((a * t) / c);
else
tmp = b * (1.0 / (c * z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -2.4e-95], N[Not[LessEqual[z, 1.62e+49]], $MachinePrecision]], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(b * N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-95} \lor \neg \left(z \leq 1.62 \cdot 10^{+49}\right):\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{1}{c \cdot z}\\
\end{array}
\end{array}
if z < -2.4e-95 or 1.62e49 < z Initial program 75.1%
associate-+l-75.1%
*-commutative75.1%
associate-*r*74.4%
*-commutative74.4%
associate-+l-74.4%
Simplified78.3%
Taylor expanded in z around inf 58.7%
if -2.4e-95 < z < 1.62e49Initial program 90.9%
associate-+l-90.9%
associate-*l*90.9%
fma-neg90.9%
neg-sub090.9%
associate-+l-90.9%
neg-sub090.9%
+-commutative90.9%
distribute-rgt-neg-out90.9%
*-commutative90.9%
associate-*l*90.9%
distribute-rgt-neg-in90.9%
*-commutative90.9%
distribute-rgt-neg-in90.9%
distribute-rgt-neg-in90.9%
metadata-eval90.9%
Simplified90.9%
Taylor expanded in b around inf 53.7%
div-inv54.5%
Applied egg-rr54.5%
Final simplification56.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* c z)))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b / (c * z)
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): return b / (c * z)
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(c * z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (c * z);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{b}{c \cdot z}
\end{array}
Initial program 82.3%
associate-+l-82.3%
associate-*l*82.3%
fma-neg82.3%
neg-sub082.3%
associate-+l-82.3%
neg-sub082.3%
+-commutative82.3%
distribute-rgt-neg-out82.3%
*-commutative82.3%
associate-*l*81.9%
distribute-rgt-neg-in81.9%
*-commutative81.9%
distribute-rgt-neg-in81.9%
distribute-rgt-neg-in81.9%
metadata-eval81.9%
Simplified81.9%
Taylor expanded in b around inf 36.8%
Final simplification36.8%
(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 2023274
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:herbie-target
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))