
(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 15 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 (if (or (<= c -1.1e+54) (not (<= c 1.3e+211))) (+ (/ b (* c z)) (fma -4.0 (/ a (/ c t)) (* 9.0 (/ y (/ (* c z) x))))) (/ (fma t (* -4.0 a) (/ (fma x (* 9.0 y) b) z)) c)))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((c <= -1.1e+54) || !(c <= 1.3e+211)) {
tmp = (b / (c * z)) + fma(-4.0, (a / (c / t)), (9.0 * (y / ((c * z) / x))));
} else {
tmp = fma(t, (-4.0 * a), (fma(x, (9.0 * y), b) / z)) / c;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((c <= -1.1e+54) || !(c <= 1.3e+211)) tmp = Float64(Float64(b / Float64(c * z)) + fma(-4.0, Float64(a / Float64(c / t)), Float64(9.0 * Float64(y / Float64(Float64(c * z) / x))))); else tmp = Float64(fma(t, Float64(-4.0 * a), Float64(fma(x, Float64(9.0 * y), b) / z)) / c); 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_] := If[Or[LessEqual[c, -1.1e+54], N[Not[LessEqual[c, 1.3e+211]], $MachinePrecision]], N[(N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(y / N[(N[(c * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(-4.0 * a), $MachinePrecision] + N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.1 \cdot 10^{+54} \lor \neg \left(c \leq 1.3 \cdot 10^{+211}\right):\\
\;\;\;\;\frac{b}{c \cdot z} + \mathsf{fma}\left(-4, \frac{a}{\frac{c}{t}}, 9 \cdot \frac{y}{\frac{c \cdot z}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, -4 \cdot a, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z}\right)}{c}\\
\end{array}
\end{array}
if c < -1.09999999999999995e54 or 1.2999999999999999e211 < c Initial program 57.8%
associate-/r*48.5%
Simplified66.4%
Taylor expanded in t around 0 76.5%
*-commutative76.5%
fma-def76.5%
associate-/l*85.1%
associate-/l*87.9%
*-commutative87.9%
Simplified87.9%
if -1.09999999999999995e54 < c < 1.2999999999999999e211Initial program 82.3%
associate-/r*86.4%
Simplified96.3%
Final simplification94.2%
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 (<= c -1.4e+54) (not (<= c 1.75e+211))) (+ (/ b (* c z)) (fma -4.0 (/ a (/ c t)) (* 9.0 (/ y (/ (* c z) x))))) (/ (+ (* (+ b (* x (* 9.0 y))) (/ 1.0 z)) (* t (* -4.0 a))) c)))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((c <= -1.4e+54) || !(c <= 1.75e+211)) {
tmp = (b / (c * z)) + fma(-4.0, (a / (c / t)), (9.0 * (y / ((c * z) / x))));
} else {
tmp = (((b + (x * (9.0 * y))) * (1.0 / z)) + (t * (-4.0 * a))) / c;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((c <= -1.4e+54) || !(c <= 1.75e+211)) tmp = Float64(Float64(b / Float64(c * z)) + fma(-4.0, Float64(a / Float64(c / t)), Float64(9.0 * Float64(y / Float64(Float64(c * z) / x))))); else tmp = Float64(Float64(Float64(Float64(b + Float64(x * Float64(9.0 * y))) * Float64(1.0 / z)) + Float64(t * Float64(-4.0 * a))) / c); 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_] := If[Or[LessEqual[c, -1.4e+54], N[Not[LessEqual[c, 1.75e+211]], $MachinePrecision]], N[(N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(y / N[(N[(c * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.4 \cdot 10^{+54} \lor \neg \left(c \leq 1.75 \cdot 10^{+211}\right):\\
\;\;\;\;\frac{b}{c \cdot z} + \mathsf{fma}\left(-4, \frac{a}{\frac{c}{t}}, 9 \cdot \frac{y}{\frac{c \cdot z}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + x \cdot \left(9 \cdot y\right)\right) \cdot \frac{1}{z} + t \cdot \left(-4 \cdot a\right)}{c}\\
\end{array}
\end{array}
if c < -1.40000000000000008e54 or 1.74999999999999998e211 < c Initial program 57.8%
associate-/r*48.5%
Simplified66.4%
Taylor expanded in t around 0 76.5%
*-commutative76.5%
fma-def76.5%
associate-/l*85.1%
associate-/l*87.9%
*-commutative87.9%
Simplified87.9%
if -1.40000000000000008e54 < c < 1.74999999999999998e211Initial program 82.3%
associate-/r*86.4%
Simplified95.8%
div-inv95.8%
Applied egg-rr95.8%
fma-udef95.8%
Applied egg-rr95.8%
Final simplification93.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
(let* ((t_1 (* y (* 9.0 x))))
(if (or (<= t_1 -5e+295) (not (<= t_1 2e+287)))
(* 9.0 (* (/ y z) (/ x c)))
(/ (+ (* (+ b (* x (* 9.0 y))) (/ 1.0 z)) (* t (* -4.0 a))) c))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (9.0 * x);
double tmp;
if ((t_1 <= -5e+295) || !(t_1 <= 2e+287)) {
tmp = 9.0 * ((y / z) * (x / c));
} else {
tmp = (((b + (x * (9.0 * y))) * (1.0 / z)) + (t * (-4.0 * 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) :: t_1
real(8) :: tmp
t_1 = y * (9.0d0 * x)
if ((t_1 <= (-5d+295)) .or. (.not. (t_1 <= 2d+287))) then
tmp = 9.0d0 * ((y / z) * (x / c))
else
tmp = (((b + (x * (9.0d0 * y))) * (1.0d0 / z)) + (t * ((-4.0d0) * 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 t_1 = y * (9.0 * x);
double tmp;
if ((t_1 <= -5e+295) || !(t_1 <= 2e+287)) {
tmp = 9.0 * ((y / z) * (x / c));
} else {
tmp = (((b + (x * (9.0 * y))) * (1.0 / z)) + (t * (-4.0 * a))) / c;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = y * (9.0 * x) tmp = 0 if (t_1 <= -5e+295) or not (t_1 <= 2e+287): tmp = 9.0 * ((y / z) * (x / c)) else: tmp = (((b + (x * (9.0 * y))) * (1.0 / z)) + (t * (-4.0 * a))) / c return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(y * Float64(9.0 * x)) tmp = 0.0 if ((t_1 <= -5e+295) || !(t_1 <= 2e+287)) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); else tmp = Float64(Float64(Float64(Float64(b + Float64(x * Float64(9.0 * y))) * Float64(1.0 / z)) + Float64(t * Float64(-4.0 * a))) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = y * (9.0 * x);
tmp = 0.0;
if ((t_1 <= -5e+295) || ~((t_1 <= 2e+287)))
tmp = 9.0 * ((y / z) * (x / c));
else
tmp = (((b + (x * (9.0 * y))) * (1.0 / z)) + (t * (-4.0 * 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_] := Block[{t$95$1 = N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+295], N[Not[LessEqual[t$95$1, 2e+287]], $MachinePrecision]], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(9 \cdot x\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+295} \lor \neg \left(t_1 \leq 2 \cdot 10^{+287}\right):\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + x \cdot \left(9 \cdot y\right)\right) \cdot \frac{1}{z} + t \cdot \left(-4 \cdot a\right)}{c}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < -4.99999999999999991e295 or 2.0000000000000002e287 < (*.f64 (*.f64 x 9) y) Initial program 59.8%
associate-/r*58.0%
Simplified60.8%
Taylor expanded in x around inf 62.5%
*-commutative62.5%
times-frac78.7%
Simplified78.7%
if -4.99999999999999991e295 < (*.f64 (*.f64 x 9) y) < 2.0000000000000002e287Initial program 78.7%
associate-/r*79.9%
Simplified93.3%
div-inv93.3%
Applied egg-rr93.3%
fma-udef93.3%
Applied egg-rr93.3%
Final simplification91.2%
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 (<= c 3e+210) (/ (+ (* (+ b (* x (* 9.0 y))) (/ 1.0 z)) (* t (* -4.0 a))) c) (- (/ (+ (/ b c) (/ (* 9.0 (* y x)) 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 (c <= 3e+210) {
tmp = (((b + (x * (9.0 * y))) * (1.0 / z)) + (t * (-4.0 * a))) / c;
} else {
tmp = (((b / c) + ((9.0 * (y * x)) / c)) / z) - (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 (c <= 3d+210) then
tmp = (((b + (x * (9.0d0 * y))) * (1.0d0 / z)) + (t * ((-4.0d0) * a))) / c
else
tmp = (((b / c) + ((9.0d0 * (y * x)) / c)) / z) - (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 (c <= 3e+210) {
tmp = (((b + (x * (9.0 * y))) * (1.0 / z)) + (t * (-4.0 * a))) / c;
} else {
tmp = (((b / c) + ((9.0 * (y * x)) / c)) / z) - (4.0 * ((a * t) / c));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if c <= 3e+210: tmp = (((b + (x * (9.0 * y))) * (1.0 / z)) + (t * (-4.0 * a))) / c else: tmp = (((b / c) + ((9.0 * (y * x)) / c)) / z) - (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 (c <= 3e+210) tmp = Float64(Float64(Float64(Float64(b + Float64(x * Float64(9.0 * y))) * Float64(1.0 / z)) + Float64(t * Float64(-4.0 * a))) / c); else tmp = Float64(Float64(Float64(Float64(b / c) + Float64(Float64(9.0 * Float64(y * x)) / c)) / z) - Float64(4.0 * Float64(Float64(a * 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 (c <= 3e+210)
tmp = (((b + (x * (9.0 * y))) * (1.0 / z)) + (t * (-4.0 * a))) / c;
else
tmp = (((b / c) + ((9.0 * (y * x)) / c)) / z) - (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[c, 3e+210], N[(N[(N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(N[(b / c), $MachinePrecision] + N[(N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq 3 \cdot 10^{+210}:\\
\;\;\;\;\frac{\left(b + x \cdot \left(9 \cdot y\right)\right) \cdot \frac{1}{z} + t \cdot \left(-4 \cdot a\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c} + \frac{9 \cdot \left(y \cdot x\right)}{c}}{z} - 4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if c < 3.00000000000000022e210Initial program 76.8%
associate-/r*79.0%
Simplified91.0%
div-inv91.0%
Applied egg-rr91.0%
fma-udef91.0%
Applied egg-rr91.0%
if 3.00000000000000022e210 < c Initial program 67.0%
associate-*l*67.0%
associate-*l*67.0%
Simplified67.0%
Taylor expanded in x around 0 73.1%
Taylor expanded in z around 0 83.7%
associate-*r/83.8%
Simplified83.8%
Final simplification90.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
(let* ((t_1 (* t (* -4.0 a))))
(if (or (<= b -1300000.0) (not (<= b 9e-85)))
(/ (+ t_1 (/ b z)) c)
(/ (+ t_1 (/ (* 9.0 (* y x)) z)) c))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (-4.0 * a);
double tmp;
if ((b <= -1300000.0) || !(b <= 9e-85)) {
tmp = (t_1 + (b / z)) / c;
} else {
tmp = (t_1 + ((9.0 * (y * x)) / z)) / 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 = t * ((-4.0d0) * a)
if ((b <= (-1300000.0d0)) .or. (.not. (b <= 9d-85))) then
tmp = (t_1 + (b / z)) / c
else
tmp = (t_1 + ((9.0d0 * (y * x)) / z)) / 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 = t * (-4.0 * a);
double tmp;
if ((b <= -1300000.0) || !(b <= 9e-85)) {
tmp = (t_1 + (b / z)) / c;
} else {
tmp = (t_1 + ((9.0 * (y * x)) / z)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = t * (-4.0 * a) tmp = 0 if (b <= -1300000.0) or not (b <= 9e-85): tmp = (t_1 + (b / z)) / c else: tmp = (t_1 + ((9.0 * (y * x)) / z)) / c return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(-4.0 * a)) tmp = 0.0 if ((b <= -1300000.0) || !(b <= 9e-85)) tmp = Float64(Float64(t_1 + Float64(b / z)) / c); else tmp = Float64(Float64(t_1 + Float64(Float64(9.0 * Float64(y * x)) / z)) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * (-4.0 * a);
tmp = 0.0;
if ((b <= -1300000.0) || ~((b <= 9e-85)))
tmp = (t_1 + (b / z)) / c;
else
tmp = (t_1 + ((9.0 * (y * x)) / z)) / 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[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[b, -1300000.0], N[Not[LessEqual[b, 9e-85]], $MachinePrecision]], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(t$95$1 + N[(N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-4 \cdot a\right)\\
\mathbf{if}\;b \leq -1300000 \lor \neg \left(b \leq 9 \cdot 10^{-85}\right):\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + \frac{9 \cdot \left(y \cdot x\right)}{z}}{c}\\
\end{array}
\end{array}
if b < -1.3e6 or 9.00000000000000008e-85 < b Initial program 76.5%
associate-/r*76.8%
Simplified86.7%
Taylor expanded in x around 0 74.2%
if -1.3e6 < b < 9.00000000000000008e-85Initial program 75.5%
associate-/r*76.7%
Simplified90.4%
Taylor expanded in x around inf 84.5%
Final simplification78.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 (/ (+ (* t (* -4.0 a)) (/ (+ b (* x (* 9.0 y))) z)) c))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((t * (-4.0 * a)) + ((b + (x * (9.0 * y))) / z)) / c;
}
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 = ((t * ((-4.0d0) * a)) + ((b + (x * (9.0d0 * y))) / z)) / c
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((t * (-4.0 * a)) + ((b + (x * (9.0 * y))) / z)) / c;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): return ((t * (-4.0 * a)) + ((b + (x * (9.0 * y))) / z)) / c
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(t * Float64(-4.0 * a)) + Float64(Float64(b + Float64(x * Float64(9.0 * y))) / z)) / c) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = ((t * (-4.0 * a)) + ((b + (x * (9.0 * y))) / z)) / c;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] + N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{t \cdot \left(-4 \cdot a\right) + \frac{b + x \cdot \left(9 \cdot y\right)}{z}}{c}
\end{array}
Initial program 76.1%
associate-/r*76.8%
Simplified88.3%
fma-udef88.3%
Applied egg-rr88.3%
Final simplification88.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 (* t (/ a c)))))
(if (<= b -2.2e+154)
(/ b (* c z))
(if (<= b -3.5e-139)
t_1
(if (<= b -1.5e-184)
(* 9.0 (* (/ y z) (/ x c)))
(if (<= b 2.3e-16) t_1 (/ (/ b c) 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 * (t * (a / c));
double tmp;
if (b <= -2.2e+154) {
tmp = b / (c * z);
} else if (b <= -3.5e-139) {
tmp = t_1;
} else if (b <= -1.5e-184) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (b <= 2.3e-16) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (t * (a / c))
if (b <= (-2.2d+154)) then
tmp = b / (c * z)
else if (b <= (-3.5d-139)) then
tmp = t_1
else if (b <= (-1.5d-184)) then
tmp = 9.0d0 * ((y / z) * (x / c))
else if (b <= 2.3d-16) then
tmp = t_1
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 t_1 = -4.0 * (t * (a / c));
double tmp;
if (b <= -2.2e+154) {
tmp = b / (c * z);
} else if (b <= -3.5e-139) {
tmp = t_1;
} else if (b <= -1.5e-184) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (b <= 2.3e-16) {
tmp = t_1;
} else {
tmp = (b / c) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (t * (a / c)) tmp = 0 if b <= -2.2e+154: tmp = b / (c * z) elif b <= -3.5e-139: tmp = t_1 elif b <= -1.5e-184: tmp = 9.0 * ((y / z) * (x / c)) elif b <= 2.3e-16: tmp = t_1 else: tmp = (b / c) / z return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(t * Float64(a / c))) tmp = 0.0 if (b <= -2.2e+154) tmp = Float64(b / Float64(c * z)); elseif (b <= -3.5e-139) tmp = t_1; elseif (b <= -1.5e-184) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); elseif (b <= 2.3e-16) tmp = t_1; else tmp = Float64(Float64(b / c) / 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 * (t * (a / c));
tmp = 0.0;
if (b <= -2.2e+154)
tmp = b / (c * z);
elseif (b <= -3.5e-139)
tmp = t_1;
elseif (b <= -1.5e-184)
tmp = 9.0 * ((y / z) * (x / c));
elseif (b <= 2.3e-16)
tmp = t_1;
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_] := Block[{t$95$1 = N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.2e+154], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.5e-139], t$95$1, If[LessEqual[b, -1.5e-184], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e-16], t$95$1, N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{if}\;b \leq -2.2 \cdot 10^{+154}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq -3.5 \cdot 10^{-139}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.5 \cdot 10^{-184}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -2.2000000000000001e154Initial program 77.4%
associate-/r*66.2%
Simplified77.7%
Taylor expanded in b around inf 65.6%
*-commutative65.6%
Simplified65.6%
if -2.2000000000000001e154 < b < -3.50000000000000001e-139 or -1.49999999999999996e-184 < b < 2.2999999999999999e-16Initial program 71.7%
associate-/r*74.8%
Simplified92.4%
Taylor expanded in t around inf 57.1%
associate-/l*57.7%
associate-/r/58.2%
Simplified58.2%
if -3.50000000000000001e-139 < b < -1.49999999999999996e-184Initial program 91.9%
associate-/r*84.0%
Simplified84.1%
Taylor expanded in x around inf 68.5%
*-commutative68.5%
times-frac76.3%
Simplified76.3%
if 2.2999999999999999e-16 < b Initial program 81.2%
associate-/r*82.7%
Simplified86.3%
div-inv86.3%
Applied egg-rr86.3%
Taylor expanded in b around inf 57.1%
associate-/r*60.1%
Simplified60.1%
Final simplification60.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 (* t (/ a c)))))
(if (<= b -1.45e+161)
(/ b (* c z))
(if (<= b -6e-142)
t_1
(if (<= b -3.6e-184)
(* 9.0 (/ y (/ z (/ x c))))
(if (<= b 1.05e-13) t_1 (/ (/ b c) 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 * (t * (a / c));
double tmp;
if (b <= -1.45e+161) {
tmp = b / (c * z);
} else if (b <= -6e-142) {
tmp = t_1;
} else if (b <= -3.6e-184) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (b <= 1.05e-13) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (t * (a / c))
if (b <= (-1.45d+161)) then
tmp = b / (c * z)
else if (b <= (-6d-142)) then
tmp = t_1
else if (b <= (-3.6d-184)) then
tmp = 9.0d0 * (y / (z / (x / c)))
else if (b <= 1.05d-13) then
tmp = t_1
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 t_1 = -4.0 * (t * (a / c));
double tmp;
if (b <= -1.45e+161) {
tmp = b / (c * z);
} else if (b <= -6e-142) {
tmp = t_1;
} else if (b <= -3.6e-184) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (b <= 1.05e-13) {
tmp = t_1;
} else {
tmp = (b / c) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (t * (a / c)) tmp = 0 if b <= -1.45e+161: tmp = b / (c * z) elif b <= -6e-142: tmp = t_1 elif b <= -3.6e-184: tmp = 9.0 * (y / (z / (x / c))) elif b <= 1.05e-13: tmp = t_1 else: tmp = (b / c) / z return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(t * Float64(a / c))) tmp = 0.0 if (b <= -1.45e+161) tmp = Float64(b / Float64(c * z)); elseif (b <= -6e-142) tmp = t_1; elseif (b <= -3.6e-184) tmp = Float64(9.0 * Float64(y / Float64(z / Float64(x / c)))); elseif (b <= 1.05e-13) tmp = t_1; else tmp = Float64(Float64(b / c) / 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 * (t * (a / c));
tmp = 0.0;
if (b <= -1.45e+161)
tmp = b / (c * z);
elseif (b <= -6e-142)
tmp = t_1;
elseif (b <= -3.6e-184)
tmp = 9.0 * (y / (z / (x / c)));
elseif (b <= 1.05e-13)
tmp = t_1;
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_] := Block[{t$95$1 = N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.45e+161], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6e-142], t$95$1, If[LessEqual[b, -3.6e-184], N[(9.0 * N[(y / N[(z / N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.05e-13], t$95$1, N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{if}\;b \leq -1.45 \cdot 10^{+161}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq -6 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -3.6 \cdot 10^{-184}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{z}{\frac{x}{c}}}\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -1.45000000000000008e161Initial program 77.4%
associate-/r*66.2%
Simplified77.7%
Taylor expanded in b around inf 65.6%
*-commutative65.6%
Simplified65.6%
if -1.45000000000000008e161 < b < -6.0000000000000002e-142 or -3.6000000000000001e-184 < b < 1.04999999999999994e-13Initial program 71.7%
associate-/r*74.8%
Simplified92.4%
Taylor expanded in t around inf 57.1%
associate-/l*57.7%
associate-/r/58.2%
Simplified58.2%
if -6.0000000000000002e-142 < b < -3.6000000000000001e-184Initial program 91.9%
associate-/r*84.0%
Simplified84.1%
Taylor expanded in x around inf 68.5%
associate-/l*75.9%
*-commutative75.9%
Simplified75.9%
expm1-log1p-u50.5%
expm1-udef18.1%
associate-/l*18.0%
Applied egg-rr18.0%
expm1-def50.6%
expm1-log1p76.0%
Simplified76.0%
if 1.04999999999999994e-13 < b Initial program 81.2%
associate-/r*82.7%
Simplified86.3%
div-inv86.3%
Applied egg-rr86.3%
Taylor expanded in b around inf 57.1%
associate-/r*60.1%
Simplified60.1%
Final simplification60.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 (* t (/ a c)))))
(if (<= b -1.25e+161)
(/ b (* c z))
(if (<= b -3.8e-143)
t_1
(if (<= b -1.62e-183)
(* 9.0 (/ y (/ (* c z) x)))
(if (<= b 5.2e-13) t_1 (/ (/ b c) 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 * (t * (a / c));
double tmp;
if (b <= -1.25e+161) {
tmp = b / (c * z);
} else if (b <= -3.8e-143) {
tmp = t_1;
} else if (b <= -1.62e-183) {
tmp = 9.0 * (y / ((c * z) / x));
} else if (b <= 5.2e-13) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (t * (a / c))
if (b <= (-1.25d+161)) then
tmp = b / (c * z)
else if (b <= (-3.8d-143)) then
tmp = t_1
else if (b <= (-1.62d-183)) then
tmp = 9.0d0 * (y / ((c * z) / x))
else if (b <= 5.2d-13) then
tmp = t_1
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 t_1 = -4.0 * (t * (a / c));
double tmp;
if (b <= -1.25e+161) {
tmp = b / (c * z);
} else if (b <= -3.8e-143) {
tmp = t_1;
} else if (b <= -1.62e-183) {
tmp = 9.0 * (y / ((c * z) / x));
} else if (b <= 5.2e-13) {
tmp = t_1;
} else {
tmp = (b / c) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (t * (a / c)) tmp = 0 if b <= -1.25e+161: tmp = b / (c * z) elif b <= -3.8e-143: tmp = t_1 elif b <= -1.62e-183: tmp = 9.0 * (y / ((c * z) / x)) elif b <= 5.2e-13: tmp = t_1 else: tmp = (b / c) / z return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(t * Float64(a / c))) tmp = 0.0 if (b <= -1.25e+161) tmp = Float64(b / Float64(c * z)); elseif (b <= -3.8e-143) tmp = t_1; elseif (b <= -1.62e-183) tmp = Float64(9.0 * Float64(y / Float64(Float64(c * z) / x))); elseif (b <= 5.2e-13) tmp = t_1; else tmp = Float64(Float64(b / c) / 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 * (t * (a / c));
tmp = 0.0;
if (b <= -1.25e+161)
tmp = b / (c * z);
elseif (b <= -3.8e-143)
tmp = t_1;
elseif (b <= -1.62e-183)
tmp = 9.0 * (y / ((c * z) / x));
elseif (b <= 5.2e-13)
tmp = t_1;
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_] := Block[{t$95$1 = N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.25e+161], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.8e-143], t$95$1, If[LessEqual[b, -1.62e-183], N[(9.0 * N[(y / N[(N[(c * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e-13], t$95$1, N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{if}\;b \leq -1.25 \cdot 10^{+161}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq -3.8 \cdot 10^{-143}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.62 \cdot 10^{-183}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{c \cdot z}{x}}\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -1.2499999999999999e161Initial program 77.4%
associate-/r*66.2%
Simplified77.7%
Taylor expanded in b around inf 65.6%
*-commutative65.6%
Simplified65.6%
if -1.2499999999999999e161 < b < -3.79999999999999981e-143 or -1.62e-183 < b < 5.2000000000000001e-13Initial program 71.7%
associate-/r*74.8%
Simplified92.4%
Taylor expanded in t around inf 57.1%
associate-/l*57.7%
associate-/r/58.2%
Simplified58.2%
if -3.79999999999999981e-143 < b < -1.62e-183Initial program 91.9%
associate-/r*84.0%
Simplified84.1%
Taylor expanded in x around inf 68.5%
associate-/l*75.9%
*-commutative75.9%
Simplified75.9%
if 5.2000000000000001e-13 < b Initial program 81.2%
associate-/r*82.7%
Simplified86.3%
div-inv86.3%
Applied egg-rr86.3%
Taylor expanded in b around inf 57.1%
associate-/r*60.1%
Simplified60.1%
Final simplification60.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 (if (or (<= z -3.1e+119) (not (<= z 2.45e+36))) (* -4.0 (* t (/ a c))) (/ (+ b (* 9.0 (* y x))) (* 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 <= -3.1e+119) || !(z <= 2.45e+36)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b + (9.0 * (y * x))) / (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 <= (-3.1d+119)) .or. (.not. (z <= 2.45d+36))) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = (b + (9.0d0 * (y * x))) / (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 <= -3.1e+119) || !(z <= 2.45e+36)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b + (9.0 * (y * x))) / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -3.1e+119) or not (z <= 2.45e+36): tmp = -4.0 * (t * (a / c)) else: tmp = (b + (9.0 * (y * x))) / (c * z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -3.1e+119) || !(z <= 2.45e+36)) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / 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 <= -3.1e+119) || ~((z <= 2.45e+36)))
tmp = -4.0 * (t * (a / c));
else
tmp = (b + (9.0 * (y * x))) / (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, -3.1e+119], N[Not[LessEqual[z, 2.45e+36]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+119} \lor \neg \left(z \leq 2.45 \cdot 10^{+36}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -3.09999999999999995e119 or 2.4499999999999999e36 < z Initial program 53.9%
associate-/r*62.0%
Simplified90.4%
Taylor expanded in t around inf 61.7%
associate-/l*64.9%
associate-/r/65.0%
Simplified65.0%
if -3.09999999999999995e119 < z < 2.4499999999999999e36Initial program 90.5%
associate-/r*86.4%
Simplified87.7%
Taylor expanded in z around 0 75.8%
Final simplification71.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 -0.8) (not (<= z 3e-42))) (/ (+ (* t (* -4.0 a)) (/ b z)) c) (/ (+ b (* 9.0 (* y x))) (* 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 <= -0.8) || !(z <= 3e-42)) {
tmp = ((t * (-4.0 * a)) + (b / z)) / c;
} else {
tmp = (b + (9.0 * (y * x))) / (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 <= (-0.8d0)) .or. (.not. (z <= 3d-42))) then
tmp = ((t * ((-4.0d0) * a)) + (b / z)) / c
else
tmp = (b + (9.0d0 * (y * x))) / (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 <= -0.8) || !(z <= 3e-42)) {
tmp = ((t * (-4.0 * a)) + (b / z)) / c;
} else {
tmp = (b + (9.0 * (y * x))) / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -0.8) or not (z <= 3e-42): tmp = ((t * (-4.0 * a)) + (b / z)) / c else: tmp = (b + (9.0 * (y * x))) / (c * z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -0.8) || !(z <= 3e-42)) tmp = Float64(Float64(Float64(t * Float64(-4.0 * a)) + Float64(b / z)) / c); else tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / 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 <= -0.8) || ~((z <= 3e-42)))
tmp = ((t * (-4.0 * a)) + (b / z)) / c;
else
tmp = (b + (9.0 * (y * x))) / (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, -0.8], N[Not[LessEqual[z, 3e-42]], $MachinePrecision]], N[(N[(N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.8 \lor \neg \left(z \leq 3 \cdot 10^{-42}\right):\\
\;\;\;\;\frac{t \cdot \left(-4 \cdot a\right) + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -0.80000000000000004 or 3.00000000000000027e-42 < z Initial program 59.9%
associate-/r*67.3%
Simplified88.7%
Taylor expanded in x around 0 77.0%
if -0.80000000000000004 < z < 3.00000000000000027e-42Initial program 95.0%
associate-/r*87.8%
Simplified87.9%
Taylor expanded in z around 0 82.0%
Final simplification79.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 (* t (* -4.0 a))))
(if (<= z -0.85)
(/ (+ t_1 (* b (/ 1.0 z))) c)
(if (<= z 1.4e-37)
(/ (+ b (* 9.0 (* y x))) (* c z))
(/ (+ t_1 (/ b z)) c)))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (-4.0 * a);
double tmp;
if (z <= -0.85) {
tmp = (t_1 + (b * (1.0 / z))) / c;
} else if (z <= 1.4e-37) {
tmp = (b + (9.0 * (y * x))) / (c * z);
} else {
tmp = (t_1 + (b / z)) / 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 = t * ((-4.0d0) * a)
if (z <= (-0.85d0)) then
tmp = (t_1 + (b * (1.0d0 / z))) / c
else if (z <= 1.4d-37) then
tmp = (b + (9.0d0 * (y * x))) / (c * z)
else
tmp = (t_1 + (b / z)) / 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 = t * (-4.0 * a);
double tmp;
if (z <= -0.85) {
tmp = (t_1 + (b * (1.0 / z))) / c;
} else if (z <= 1.4e-37) {
tmp = (b + (9.0 * (y * x))) / (c * z);
} else {
tmp = (t_1 + (b / z)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): t_1 = t * (-4.0 * a) tmp = 0 if z <= -0.85: tmp = (t_1 + (b * (1.0 / z))) / c elif z <= 1.4e-37: tmp = (b + (9.0 * (y * x))) / (c * z) else: tmp = (t_1 + (b / z)) / c return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(-4.0 * a)) tmp = 0.0 if (z <= -0.85) tmp = Float64(Float64(t_1 + Float64(b * Float64(1.0 / z))) / c); elseif (z <= 1.4e-37) tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / Float64(c * z)); else tmp = Float64(Float64(t_1 + Float64(b / z)) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * (-4.0 * a);
tmp = 0.0;
if (z <= -0.85)
tmp = (t_1 + (b * (1.0 / z))) / c;
elseif (z <= 1.4e-37)
tmp = (b + (9.0 * (y * x))) / (c * z);
else
tmp = (t_1 + (b / z)) / 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[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.85], N[(N[(t$95$1 + N[(b * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.4e-37], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-4 \cdot a\right)\\
\mathbf{if}\;z \leq -0.85:\\
\;\;\;\;\frac{t_1 + b \cdot \frac{1}{z}}{c}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-37}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if z < -0.849999999999999978Initial program 52.6%
associate-/r*58.8%
Simplified84.7%
div-inv84.8%
Applied egg-rr84.8%
Taylor expanded in x around 0 74.1%
if -0.849999999999999978 < z < 1.4000000000000001e-37Initial program 95.0%
associate-/r*87.8%
Simplified87.9%
Taylor expanded in z around 0 82.0%
if 1.4000000000000001e-37 < z Initial program 67.5%
associate-/r*76.1%
Simplified92.8%
Taylor expanded in x around 0 80.0%
Final simplification79.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 (if (<= b -1.5e+154) (/ b (* c z)) (if (<= b 9.5e-14) (* -4.0 (* t (/ a 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 (b <= -1.5e+154) {
tmp = b / (c * z);
} else if (b <= 9.5e-14) {
tmp = -4.0 * (t * (a / 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 (b <= (-1.5d+154)) then
tmp = b / (c * z)
else if (b <= 9.5d-14) then
tmp = (-4.0d0) * (t * (a / 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 (b <= -1.5e+154) {
tmp = b / (c * z);
} else if (b <= 9.5e-14) {
tmp = -4.0 * (t * (a / 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 b <= -1.5e+154: tmp = b / (c * z) elif b <= 9.5e-14: tmp = -4.0 * (t * (a / 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 (b <= -1.5e+154) tmp = Float64(b / Float64(c * z)); elseif (b <= 9.5e-14) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(Float64(b / 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 (b <= -1.5e+154)
tmp = b / (c * z);
elseif (b <= 9.5e-14)
tmp = -4.0 * (t * (a / 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[LessEqual[b, -1.5e+154], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.5e-14], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.5 \cdot 10^{+154}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{-14}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -1.50000000000000013e154Initial program 77.4%
associate-/r*66.2%
Simplified77.7%
Taylor expanded in b around inf 65.6%
*-commutative65.6%
Simplified65.6%
if -1.50000000000000013e154 < b < 9.4999999999999999e-14Initial program 73.3%
associate-/r*75.5%
Simplified91.8%
Taylor expanded in t around inf 56.0%
associate-/l*56.5%
associate-/r/56.4%
Simplified56.4%
if 9.4999999999999999e-14 < b Initial program 81.2%
associate-/r*82.7%
Simplified86.3%
div-inv86.3%
Applied egg-rr86.3%
Taylor expanded in b around inf 57.1%
associate-/r*60.1%
Simplified60.1%
Final simplification58.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 (<= y 4e-177) (/ (/ b c) z) (/ 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 (y <= 4e-177) {
tmp = (b / c) / z;
} 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 (y <= 4d-177) then
tmp = (b / c) / z
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 (y <= 4e-177) {
tmp = (b / c) / z;
} else {
tmp = b / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b, c): tmp = 0 if y <= 4e-177: tmp = (b / c) / z 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 (y <= 4e-177) tmp = Float64(Float64(b / c) / z); 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 (y <= 4e-177)
tmp = (b / c) / z;
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[LessEqual[y, 4e-177], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{-177}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\end{array}
\end{array}
if y < 3.99999999999999981e-177Initial program 78.2%
associate-/r*78.0%
Simplified89.5%
div-inv89.5%
Applied egg-rr89.5%
Taylor expanded in b around inf 39.8%
associate-/r*41.0%
Simplified41.0%
if 3.99999999999999981e-177 < y Initial program 72.7%
associate-/r*74.8%
Simplified86.4%
Taylor expanded in b around inf 33.3%
*-commutative33.3%
Simplified33.3%
Final simplification38.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 (/ 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 76.1%
associate-/r*76.8%
Simplified88.7%
Taylor expanded in b around inf 37.3%
*-commutative37.3%
Simplified37.3%
Final simplification37.3%
(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 2023229
(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)))