
(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. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= c -1.45e+203) (not (<= c 0.0024))) (+ (/ b (* c z)) (fma 9.0 (/ y (/ c (/ x z))) (* -4.0 (* (/ a c) t)))) (/ (fma t (* -4.0 a) (/ (fma x (* 9.0 y) b) z)) c)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((c <= -1.45e+203) || !(c <= 0.0024)) {
tmp = (b / (c * z)) + fma(9.0, (y / (c / (x / z))), (-4.0 * ((a / c) * t)));
} else {
tmp = fma(t, (-4.0 * a), (fma(x, (9.0 * y), b) / z)) / c;
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((c <= -1.45e+203) || !(c <= 0.0024)) tmp = Float64(Float64(b / Float64(c * z)) + fma(9.0, Float64(y / Float64(c / Float64(x / z))), Float64(-4.0 * Float64(Float64(a / c) * t)))); 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. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[c, -1.45e+203], N[Not[LessEqual[c, 0.0024]], $MachinePrecision]], N[(N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(y / N[(c / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(a / c), $MachinePrecision] * t), $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])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.45 \cdot 10^{+203} \lor \neg \left(c \leq 0.0024\right):\\
\;\;\;\;\frac{b}{c \cdot z} + \mathsf{fma}\left(9, \frac{y}{\frac{c}{\frac{x}{z}}}, -4 \cdot \left(\frac{a}{c} \cdot t\right)\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.45000000000000005e203 or 0.00239999999999999979 < c Initial program 55.2%
associate-/r*51.4%
Simplified65.3%
Taylor expanded in t around 0 64.8%
*-commutative64.8%
+-commutative64.8%
fma-def64.9%
associate-/l*71.8%
associate-/l*74.2%
associate-/l*78.6%
associate-/r/78.5%
Simplified78.5%
if -1.45000000000000005e203 < c < 0.00239999999999999979Initial program 83.5%
associate-/r*85.9%
Simplified95.4%
Final simplification89.8%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 (<= t_1 -2e+291)
(* (* 9.0 (/ y z)) (/ x c))
(if (<= t_1 2e+278)
(/ (+ (/ (fma x (* 9.0 y) b) z) (* t (* -4.0 a))) c)
(* 9.0 (/ y (/ c (/ x z))))))))assert(x < y);
assert(t < a);
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 <= -2e+291) {
tmp = (9.0 * (y / z)) * (x / c);
} else if (t_1 <= 2e+278) {
tmp = ((fma(x, (9.0 * y), b) / z) + (t * (-4.0 * a))) / c;
} else {
tmp = 9.0 * (y / (c / (x / z)));
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(y * Float64(9.0 * x)) tmp = 0.0 if (t_1 <= -2e+291) tmp = Float64(Float64(9.0 * Float64(y / z)) * Float64(x / c)); elseif (t_1 <= 2e+278) tmp = Float64(Float64(Float64(fma(x, Float64(9.0 * y), b) / z) + Float64(t * Float64(-4.0 * a))) / c); else tmp = Float64(9.0 * Float64(y / Float64(c / Float64(x / z)))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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[LessEqual[t$95$1, -2e+291], N[(N[(9.0 * N[(y / z), $MachinePrecision]), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+278], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(9.0 * N[(y / N[(c / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(9 \cdot x\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+291}:\\
\;\;\;\;\left(9 \cdot \frac{y}{z}\right) \cdot \frac{x}{c}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+278}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z} + t \cdot \left(-4 \cdot a\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{c}{\frac{x}{z}}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < -1.9999999999999999e291Initial program 60.2%
associate-/r*67.4%
Simplified71.4%
clear-num71.4%
fma-udef71.4%
+-commutative71.4%
inv-pow71.4%
+-commutative71.4%
fma-udef71.4%
Applied egg-rr71.4%
Taylor expanded in x around inf 63.9%
*-commutative63.9%
times-frac92.7%
Simplified92.7%
unpow-prod-down92.5%
metadata-eval92.5%
unpow-prod-down92.5%
inv-pow92.5%
clear-num92.6%
inv-pow92.6%
clear-num92.5%
*-commutative92.5%
associate-*r*92.6%
Applied egg-rr92.6%
if -1.9999999999999999e291 < (*.f64 (*.f64 x 9) y) < 1.99999999999999993e278Initial program 77.9%
associate-/r*77.3%
Simplified90.1%
if 1.99999999999999993e278 < (*.f64 (*.f64 x 9) y) Initial program 59.0%
associate-/r*59.4%
Simplified59.5%
Taylor expanded in x around inf 59.0%
associate-/l*74.2%
associate-/l*78.6%
Simplified78.6%
Final simplification89.2%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= c -2.9e+202) (not (<= c 0.0029))) (+ (/ b (* c z)) (fma 9.0 (/ y (/ c (/ x z))) (* -4.0 (* (/ a c) t)))) (/ (+ (/ (fma x (* 9.0 y) b) z) (* t (* -4.0 a))) c)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((c <= -2.9e+202) || !(c <= 0.0029)) {
tmp = (b / (c * z)) + fma(9.0, (y / (c / (x / z))), (-4.0 * ((a / c) * t)));
} else {
tmp = ((fma(x, (9.0 * y), b) / z) + (t * (-4.0 * a))) / c;
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((c <= -2.9e+202) || !(c <= 0.0029)) tmp = Float64(Float64(b / Float64(c * z)) + fma(9.0, Float64(y / Float64(c / Float64(x / z))), Float64(-4.0 * Float64(Float64(a / c) * t)))); else tmp = Float64(Float64(Float64(fma(x, Float64(9.0 * y), b) / 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. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[c, -2.9e+202], N[Not[LessEqual[c, 0.0029]], $MachinePrecision]], N[(N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(y / N[(c / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.9 \cdot 10^{+202} \lor \neg \left(c \leq 0.0029\right):\\
\;\;\;\;\frac{b}{c \cdot z} + \mathsf{fma}\left(9, \frac{y}{\frac{c}{\frac{x}{z}}}, -4 \cdot \left(\frac{a}{c} \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z} + t \cdot \left(-4 \cdot a\right)}{c}\\
\end{array}
\end{array}
if c < -2.8999999999999999e202 or 0.0029 < c Initial program 55.2%
associate-/r*51.4%
Simplified65.3%
Taylor expanded in t around 0 64.8%
*-commutative64.8%
+-commutative64.8%
fma-def64.9%
associate-/l*71.8%
associate-/l*74.2%
associate-/l*78.6%
associate-/r/78.5%
Simplified78.5%
if -2.8999999999999999e202 < c < 0.0029Initial program 83.5%
associate-/r*85.9%
Simplified94.8%
Final simplification89.4%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ 1.0 (/ c (/ b z))))
(t_2 (* 9.0 (* (/ y z) (/ x c))))
(t_3 (* -4.0 (* (/ a c) t))))
(if (<= x -3.2e+131)
t_2
(if (<= x -5e+97)
t_1
(if (<= x -1.75e+80)
(* (* a t) (/ -4.0 c))
(if (<= x -3.2e+16)
(/ (/ b c) z)
(if (<= x -5.2e-39)
t_3
(if (<= x -1.08e-58)
(/ b (* c z))
(if (<= x -3.6e-258) t_3 (if (<= x 3.5e-40) t_1 t_2))))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (c / (b / z));
double t_2 = 9.0 * ((y / z) * (x / c));
double t_3 = -4.0 * ((a / c) * t);
double tmp;
if (x <= -3.2e+131) {
tmp = t_2;
} else if (x <= -5e+97) {
tmp = t_1;
} else if (x <= -1.75e+80) {
tmp = (a * t) * (-4.0 / c);
} else if (x <= -3.2e+16) {
tmp = (b / c) / z;
} else if (x <= -5.2e-39) {
tmp = t_3;
} else if (x <= -1.08e-58) {
tmp = b / (c * z);
} else if (x <= -3.6e-258) {
tmp = t_3;
} else if (x <= 3.5e-40) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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) :: t_3
real(8) :: tmp
t_1 = 1.0d0 / (c / (b / z))
t_2 = 9.0d0 * ((y / z) * (x / c))
t_3 = (-4.0d0) * ((a / c) * t)
if (x <= (-3.2d+131)) then
tmp = t_2
else if (x <= (-5d+97)) then
tmp = t_1
else if (x <= (-1.75d+80)) then
tmp = (a * t) * ((-4.0d0) / c)
else if (x <= (-3.2d+16)) then
tmp = (b / c) / z
else if (x <= (-5.2d-39)) then
tmp = t_3
else if (x <= (-1.08d-58)) then
tmp = b / (c * z)
else if (x <= (-3.6d-258)) then
tmp = t_3
else if (x <= 3.5d-40) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (c / (b / z));
double t_2 = 9.0 * ((y / z) * (x / c));
double t_3 = -4.0 * ((a / c) * t);
double tmp;
if (x <= -3.2e+131) {
tmp = t_2;
} else if (x <= -5e+97) {
tmp = t_1;
} else if (x <= -1.75e+80) {
tmp = (a * t) * (-4.0 / c);
} else if (x <= -3.2e+16) {
tmp = (b / c) / z;
} else if (x <= -5.2e-39) {
tmp = t_3;
} else if (x <= -1.08e-58) {
tmp = b / (c * z);
} else if (x <= -3.6e-258) {
tmp = t_3;
} else if (x <= 3.5e-40) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 1.0 / (c / (b / z)) t_2 = 9.0 * ((y / z) * (x / c)) t_3 = -4.0 * ((a / c) * t) tmp = 0 if x <= -3.2e+131: tmp = t_2 elif x <= -5e+97: tmp = t_1 elif x <= -1.75e+80: tmp = (a * t) * (-4.0 / c) elif x <= -3.2e+16: tmp = (b / c) / z elif x <= -5.2e-39: tmp = t_3 elif x <= -1.08e-58: tmp = b / (c * z) elif x <= -3.6e-258: tmp = t_3 elif x <= 3.5e-40: tmp = t_1 else: tmp = t_2 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(1.0 / Float64(c / Float64(b / z))) t_2 = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))) t_3 = Float64(-4.0 * Float64(Float64(a / c) * t)) tmp = 0.0 if (x <= -3.2e+131) tmp = t_2; elseif (x <= -5e+97) tmp = t_1; elseif (x <= -1.75e+80) tmp = Float64(Float64(a * t) * Float64(-4.0 / c)); elseif (x <= -3.2e+16) tmp = Float64(Float64(b / c) / z); elseif (x <= -5.2e-39) tmp = t_3; elseif (x <= -1.08e-58) tmp = Float64(b / Float64(c * z)); elseif (x <= -3.6e-258) tmp = t_3; elseif (x <= 3.5e-40) tmp = t_1; else tmp = t_2; end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 1.0 / (c / (b / z));
t_2 = 9.0 * ((y / z) * (x / c));
t_3 = -4.0 * ((a / c) * t);
tmp = 0.0;
if (x <= -3.2e+131)
tmp = t_2;
elseif (x <= -5e+97)
tmp = t_1;
elseif (x <= -1.75e+80)
tmp = (a * t) * (-4.0 / c);
elseif (x <= -3.2e+16)
tmp = (b / c) / z;
elseif (x <= -5.2e-39)
tmp = t_3;
elseif (x <= -1.08e-58)
tmp = b / (c * z);
elseif (x <= -3.6e-258)
tmp = t_3;
elseif (x <= 3.5e-40)
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.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(1.0 / N[(c / N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-4.0 * N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e+131], t$95$2, If[LessEqual[x, -5e+97], t$95$1, If[LessEqual[x, -1.75e+80], N[(N[(a * t), $MachinePrecision] * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.2e+16], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, -5.2e-39], t$95$3, If[LessEqual[x, -1.08e-58], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.6e-258], t$95$3, If[LessEqual[x, 3.5e-40], t$95$1, t$95$2]]]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{c}{\frac{b}{z}}}\\
t_2 := 9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
t_3 := -4 \cdot \left(\frac{a}{c} \cdot t\right)\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+131}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -5 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{+80}:\\
\;\;\;\;\left(a \cdot t\right) \cdot \frac{-4}{c}\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-39}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -1.08 \cdot 10^{-58}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{-258}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-40}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -3.2000000000000002e131 or 3.5000000000000002e-40 < x Initial program 72.0%
associate-/r*74.0%
Simplified78.9%
Taylor expanded in x around inf 52.9%
*-commutative52.9%
Simplified52.9%
Taylor expanded in y around 0 52.9%
*-commutative52.9%
times-frac64.5%
Simplified64.5%
if -3.2000000000000002e131 < x < -4.99999999999999999e97 or -3.59999999999999979e-258 < x < 3.5000000000000002e-40Initial program 76.1%
associate-/r*77.6%
Simplified92.3%
Taylor expanded in b around inf 45.2%
*-commutative45.2%
Simplified45.2%
clear-num45.2%
inv-pow45.2%
*-commutative45.2%
Applied egg-rr45.2%
unpow-145.2%
associate-/l*46.6%
Simplified46.6%
if -4.99999999999999999e97 < x < -1.74999999999999997e80Initial program 53.5%
associate-/r*53.5%
Simplified99.2%
clear-num100.0%
fma-udef100.0%
+-commutative100.0%
inv-pow100.0%
+-commutative100.0%
fma-udef100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 100.0%
associate-*r/100.0%
Simplified100.0%
div-inv100.0%
unpow-prod-down98.4%
*-commutative98.4%
Applied egg-rr98.4%
*-commutative98.4%
unpow-198.4%
remove-double-div99.2%
unpow-199.2%
*-commutative99.2%
associate-/r*99.2%
metadata-eval99.2%
Simplified99.2%
if -1.74999999999999997e80 < x < -3.2e16Initial program 67.3%
associate-/r*62.9%
Simplified73.6%
div-inv73.6%
Applied egg-rr73.6%
Taylor expanded in b around inf 30.7%
associate-/r*36.1%
Simplified36.1%
if -3.2e16 < x < -5.2e-39 or -1.08e-58 < x < -3.59999999999999979e-258Initial program 75.9%
associate-/r*74.1%
Simplified91.4%
Taylor expanded in t around inf 45.9%
associate-/l*45.8%
associate-/r/52.1%
Simplified52.1%
if -5.2e-39 < x < -1.08e-58Initial program 99.7%
associate-/r*80.9%
Simplified80.9%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
Final simplification54.6%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ 1.0 (/ c (/ b z))))
(t_2 (* 9.0 (/ (* y (/ x c)) z)))
(t_3 (* -4.0 (* (/ a c) t))))
(if (<= x -3.2e+131)
t_2
(if (<= x -9.2e+98)
t_1
(if (<= x -1.55e+80)
(* (* a t) (/ -4.0 c))
(if (<= x -760000000000.0)
(/ (/ b c) z)
(if (<= x -2.75e-39)
t_3
(if (<= x -1.65e-58)
(/ b (* c z))
(if (<= x -1.8e-260) t_3 (if (<= x 1.9e-121) t_1 t_2))))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (c / (b / z));
double t_2 = 9.0 * ((y * (x / c)) / z);
double t_3 = -4.0 * ((a / c) * t);
double tmp;
if (x <= -3.2e+131) {
tmp = t_2;
} else if (x <= -9.2e+98) {
tmp = t_1;
} else if (x <= -1.55e+80) {
tmp = (a * t) * (-4.0 / c);
} else if (x <= -760000000000.0) {
tmp = (b / c) / z;
} else if (x <= -2.75e-39) {
tmp = t_3;
} else if (x <= -1.65e-58) {
tmp = b / (c * z);
} else if (x <= -1.8e-260) {
tmp = t_3;
} else if (x <= 1.9e-121) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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) :: t_3
real(8) :: tmp
t_1 = 1.0d0 / (c / (b / z))
t_2 = 9.0d0 * ((y * (x / c)) / z)
t_3 = (-4.0d0) * ((a / c) * t)
if (x <= (-3.2d+131)) then
tmp = t_2
else if (x <= (-9.2d+98)) then
tmp = t_1
else if (x <= (-1.55d+80)) then
tmp = (a * t) * ((-4.0d0) / c)
else if (x <= (-760000000000.0d0)) then
tmp = (b / c) / z
else if (x <= (-2.75d-39)) then
tmp = t_3
else if (x <= (-1.65d-58)) then
tmp = b / (c * z)
else if (x <= (-1.8d-260)) then
tmp = t_3
else if (x <= 1.9d-121) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (c / (b / z));
double t_2 = 9.0 * ((y * (x / c)) / z);
double t_3 = -4.0 * ((a / c) * t);
double tmp;
if (x <= -3.2e+131) {
tmp = t_2;
} else if (x <= -9.2e+98) {
tmp = t_1;
} else if (x <= -1.55e+80) {
tmp = (a * t) * (-4.0 / c);
} else if (x <= -760000000000.0) {
tmp = (b / c) / z;
} else if (x <= -2.75e-39) {
tmp = t_3;
} else if (x <= -1.65e-58) {
tmp = b / (c * z);
} else if (x <= -1.8e-260) {
tmp = t_3;
} else if (x <= 1.9e-121) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 1.0 / (c / (b / z)) t_2 = 9.0 * ((y * (x / c)) / z) t_3 = -4.0 * ((a / c) * t) tmp = 0 if x <= -3.2e+131: tmp = t_2 elif x <= -9.2e+98: tmp = t_1 elif x <= -1.55e+80: tmp = (a * t) * (-4.0 / c) elif x <= -760000000000.0: tmp = (b / c) / z elif x <= -2.75e-39: tmp = t_3 elif x <= -1.65e-58: tmp = b / (c * z) elif x <= -1.8e-260: tmp = t_3 elif x <= 1.9e-121: tmp = t_1 else: tmp = t_2 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(1.0 / Float64(c / Float64(b / z))) t_2 = Float64(9.0 * Float64(Float64(y * Float64(x / c)) / z)) t_3 = Float64(-4.0 * Float64(Float64(a / c) * t)) tmp = 0.0 if (x <= -3.2e+131) tmp = t_2; elseif (x <= -9.2e+98) tmp = t_1; elseif (x <= -1.55e+80) tmp = Float64(Float64(a * t) * Float64(-4.0 / c)); elseif (x <= -760000000000.0) tmp = Float64(Float64(b / c) / z); elseif (x <= -2.75e-39) tmp = t_3; elseif (x <= -1.65e-58) tmp = Float64(b / Float64(c * z)); elseif (x <= -1.8e-260) tmp = t_3; elseif (x <= 1.9e-121) tmp = t_1; else tmp = t_2; end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 1.0 / (c / (b / z));
t_2 = 9.0 * ((y * (x / c)) / z);
t_3 = -4.0 * ((a / c) * t);
tmp = 0.0;
if (x <= -3.2e+131)
tmp = t_2;
elseif (x <= -9.2e+98)
tmp = t_1;
elseif (x <= -1.55e+80)
tmp = (a * t) * (-4.0 / c);
elseif (x <= -760000000000.0)
tmp = (b / c) / z;
elseif (x <= -2.75e-39)
tmp = t_3;
elseif (x <= -1.65e-58)
tmp = b / (c * z);
elseif (x <= -1.8e-260)
tmp = t_3;
elseif (x <= 1.9e-121)
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.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(1.0 / N[(c / N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(y * N[(x / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-4.0 * N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e+131], t$95$2, If[LessEqual[x, -9.2e+98], t$95$1, If[LessEqual[x, -1.55e+80], N[(N[(a * t), $MachinePrecision] * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -760000000000.0], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, -2.75e-39], t$95$3, If[LessEqual[x, -1.65e-58], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.8e-260], t$95$3, If[LessEqual[x, 1.9e-121], t$95$1, t$95$2]]]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{c}{\frac{b}{z}}}\\
t_2 := 9 \cdot \frac{y \cdot \frac{x}{c}}{z}\\
t_3 := -4 \cdot \left(\frac{a}{c} \cdot t\right)\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+131}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -9.2 \cdot 10^{+98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{+80}:\\
\;\;\;\;\left(a \cdot t\right) \cdot \frac{-4}{c}\\
\mathbf{elif}\;x \leq -760000000000:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq -2.75 \cdot 10^{-39}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-58}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-260}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-121}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -3.2000000000000002e131 or 1.9e-121 < x Initial program 71.5%
associate-/r*73.2%
Simplified79.7%
Taylor expanded in x around inf 47.7%
*-commutative47.7%
Simplified47.7%
Taylor expanded in y around 0 47.7%
*-commutative47.7%
times-frac56.8%
Simplified56.8%
associate-*l/60.8%
Applied egg-rr60.8%
if -3.2000000000000002e131 < x < -9.20000000000000053e98 or -1.8e-260 < x < 1.9e-121Initial program 79.1%
associate-/r*79.8%
Simplified94.4%
Taylor expanded in b around inf 48.2%
*-commutative48.2%
Simplified48.2%
clear-num48.2%
inv-pow48.2%
*-commutative48.2%
Applied egg-rr48.2%
unpow-148.2%
associate-/l*48.6%
Simplified48.6%
if -9.20000000000000053e98 < x < -1.54999999999999994e80Initial program 53.5%
associate-/r*53.5%
Simplified99.2%
clear-num100.0%
fma-udef100.0%
+-commutative100.0%
inv-pow100.0%
+-commutative100.0%
fma-udef100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 100.0%
associate-*r/100.0%
Simplified100.0%
div-inv100.0%
unpow-prod-down98.4%
*-commutative98.4%
Applied egg-rr98.4%
*-commutative98.4%
unpow-198.4%
remove-double-div99.2%
unpow-199.2%
*-commutative99.2%
associate-/r*99.2%
metadata-eval99.2%
Simplified99.2%
if -1.54999999999999994e80 < x < -7.6e11Initial program 67.3%
associate-/r*62.9%
Simplified73.6%
div-inv73.6%
Applied egg-rr73.6%
Taylor expanded in b around inf 30.7%
associate-/r*36.1%
Simplified36.1%
if -7.6e11 < x < -2.75000000000000009e-39 or -1.65000000000000013e-58 < x < -1.8e-260Initial program 74.5%
associate-/r*74.7%
Simplified91.6%
Taylor expanded in t around inf 47.0%
associate-/l*45.0%
associate-/r/53.1%
Simplified53.1%
if -2.75000000000000009e-39 < x < -1.65000000000000013e-58Initial program 99.7%
associate-/r*80.9%
Simplified80.9%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
Final simplification54.8%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ 1.0 (/ c (/ b z)))) (t_2 (* -4.0 (* (/ a c) t))))
(if (<= x -3.2e+131)
(/ (* 9.0 (/ y (/ c x))) z)
(if (<= x -4.5e+97)
t_1
(if (<= x -1.45e+80)
(* (* a t) (/ -4.0 c))
(if (<= x -320000000000.0)
(/ (/ b c) z)
(if (<= x -1.16e-43)
t_2
(if (<= x -6.6e-59)
(/ b (* c z))
(if (<= x -3.7e-256)
t_2
(if (<= x 1.4e-112) t_1 (* 9.0 (/ (* y (/ x c)) z))))))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (c / (b / z));
double t_2 = -4.0 * ((a / c) * t);
double tmp;
if (x <= -3.2e+131) {
tmp = (9.0 * (y / (c / x))) / z;
} else if (x <= -4.5e+97) {
tmp = t_1;
} else if (x <= -1.45e+80) {
tmp = (a * t) * (-4.0 / c);
} else if (x <= -320000000000.0) {
tmp = (b / c) / z;
} else if (x <= -1.16e-43) {
tmp = t_2;
} else if (x <= -6.6e-59) {
tmp = b / (c * z);
} else if (x <= -3.7e-256) {
tmp = t_2;
} else if (x <= 1.4e-112) {
tmp = t_1;
} else {
tmp = 9.0 * ((y * (x / c)) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 = 1.0d0 / (c / (b / z))
t_2 = (-4.0d0) * ((a / c) * t)
if (x <= (-3.2d+131)) then
tmp = (9.0d0 * (y / (c / x))) / z
else if (x <= (-4.5d+97)) then
tmp = t_1
else if (x <= (-1.45d+80)) then
tmp = (a * t) * ((-4.0d0) / c)
else if (x <= (-320000000000.0d0)) then
tmp = (b / c) / z
else if (x <= (-1.16d-43)) then
tmp = t_2
else if (x <= (-6.6d-59)) then
tmp = b / (c * z)
else if (x <= (-3.7d-256)) then
tmp = t_2
else if (x <= 1.4d-112) then
tmp = t_1
else
tmp = 9.0d0 * ((y * (x / c)) / z)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (c / (b / z));
double t_2 = -4.0 * ((a / c) * t);
double tmp;
if (x <= -3.2e+131) {
tmp = (9.0 * (y / (c / x))) / z;
} else if (x <= -4.5e+97) {
tmp = t_1;
} else if (x <= -1.45e+80) {
tmp = (a * t) * (-4.0 / c);
} else if (x <= -320000000000.0) {
tmp = (b / c) / z;
} else if (x <= -1.16e-43) {
tmp = t_2;
} else if (x <= -6.6e-59) {
tmp = b / (c * z);
} else if (x <= -3.7e-256) {
tmp = t_2;
} else if (x <= 1.4e-112) {
tmp = t_1;
} else {
tmp = 9.0 * ((y * (x / c)) / z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 1.0 / (c / (b / z)) t_2 = -4.0 * ((a / c) * t) tmp = 0 if x <= -3.2e+131: tmp = (9.0 * (y / (c / x))) / z elif x <= -4.5e+97: tmp = t_1 elif x <= -1.45e+80: tmp = (a * t) * (-4.0 / c) elif x <= -320000000000.0: tmp = (b / c) / z elif x <= -1.16e-43: tmp = t_2 elif x <= -6.6e-59: tmp = b / (c * z) elif x <= -3.7e-256: tmp = t_2 elif x <= 1.4e-112: tmp = t_1 else: tmp = 9.0 * ((y * (x / c)) / z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(1.0 / Float64(c / Float64(b / z))) t_2 = Float64(-4.0 * Float64(Float64(a / c) * t)) tmp = 0.0 if (x <= -3.2e+131) tmp = Float64(Float64(9.0 * Float64(y / Float64(c / x))) / z); elseif (x <= -4.5e+97) tmp = t_1; elseif (x <= -1.45e+80) tmp = Float64(Float64(a * t) * Float64(-4.0 / c)); elseif (x <= -320000000000.0) tmp = Float64(Float64(b / c) / z); elseif (x <= -1.16e-43) tmp = t_2; elseif (x <= -6.6e-59) tmp = Float64(b / Float64(c * z)); elseif (x <= -3.7e-256) tmp = t_2; elseif (x <= 1.4e-112) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(y * Float64(x / c)) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 1.0 / (c / (b / z));
t_2 = -4.0 * ((a / c) * t);
tmp = 0.0;
if (x <= -3.2e+131)
tmp = (9.0 * (y / (c / x))) / z;
elseif (x <= -4.5e+97)
tmp = t_1;
elseif (x <= -1.45e+80)
tmp = (a * t) * (-4.0 / c);
elseif (x <= -320000000000.0)
tmp = (b / c) / z;
elseif (x <= -1.16e-43)
tmp = t_2;
elseif (x <= -6.6e-59)
tmp = b / (c * z);
elseif (x <= -3.7e-256)
tmp = t_2;
elseif (x <= 1.4e-112)
tmp = t_1;
else
tmp = 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.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(1.0 / N[(c / N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e+131], N[(N[(9.0 * N[(y / N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, -4.5e+97], t$95$1, If[LessEqual[x, -1.45e+80], N[(N[(a * t), $MachinePrecision] * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -320000000000.0], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, -1.16e-43], t$95$2, If[LessEqual[x, -6.6e-59], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.7e-256], t$95$2, If[LessEqual[x, 1.4e-112], t$95$1, N[(9.0 * N[(N[(y * N[(x / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{c}{\frac{b}{z}}}\\
t_2 := -4 \cdot \left(\frac{a}{c} \cdot t\right)\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+131}:\\
\;\;\;\;\frac{9 \cdot \frac{y}{\frac{c}{x}}}{z}\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{+80}:\\
\;\;\;\;\left(a \cdot t\right) \cdot \frac{-4}{c}\\
\mathbf{elif}\;x \leq -320000000000:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq -1.16 \cdot 10^{-43}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{-59}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-256}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-112}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{y \cdot \frac{x}{c}}{z}\\
\end{array}
\end{array}
if x < -3.2000000000000002e131Initial program 74.6%
associate-/r*80.3%
Simplified83.3%
clear-num83.2%
fma-udef83.2%
+-commutative83.2%
inv-pow83.2%
+-commutative83.2%
fma-udef83.2%
Applied egg-rr83.2%
Taylor expanded in x around inf 69.4%
associate-*r/69.3%
*-commutative69.3%
associate-/r*72.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in y around 0 72.8%
associate-/l*89.3%
Simplified89.3%
if -3.2000000000000002e131 < x < -4.49999999999999976e97 or -3.70000000000000029e-256 < x < 1.40000000000000011e-112Initial program 78.1%
associate-/r*80.1%
Simplified94.5%
Taylor expanded in b around inf 47.5%
*-commutative47.5%
Simplified47.5%
clear-num47.5%
inv-pow47.5%
*-commutative47.5%
Applied egg-rr47.5%
unpow-147.5%
associate-/l*47.9%
Simplified47.9%
if -4.49999999999999976e97 < x < -1.44999999999999993e80Initial program 53.5%
associate-/r*53.5%
Simplified99.2%
clear-num100.0%
fma-udef100.0%
+-commutative100.0%
inv-pow100.0%
+-commutative100.0%
fma-udef100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 100.0%
associate-*r/100.0%
Simplified100.0%
div-inv100.0%
unpow-prod-down98.4%
*-commutative98.4%
Applied egg-rr98.4%
*-commutative98.4%
unpow-198.4%
remove-double-div99.2%
unpow-199.2%
*-commutative99.2%
associate-/r*99.2%
metadata-eval99.2%
Simplified99.2%
if -1.44999999999999993e80 < x < -3.2e11Initial program 67.3%
associate-/r*62.9%
Simplified73.6%
div-inv73.6%
Applied egg-rr73.6%
Taylor expanded in b around inf 30.7%
associate-/r*36.1%
Simplified36.1%
if -3.2e11 < x < -1.1600000000000001e-43 or -6.59999999999999964e-59 < x < -3.70000000000000029e-256Initial program 75.9%
associate-/r*74.1%
Simplified91.4%
Taylor expanded in t around inf 45.9%
associate-/l*45.8%
associate-/r/52.1%
Simplified52.1%
if -1.1600000000000001e-43 < x < -6.59999999999999964e-59Initial program 99.7%
associate-/r*80.9%
Simplified80.9%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
if 1.40000000000000011e-112 < x Initial program 70.2%
associate-/r*70.2%
Simplified78.2%
Taylor expanded in x around inf 38.7%
*-commutative38.7%
Simplified38.7%
Taylor expanded in y around 0 38.7%
*-commutative38.7%
times-frac44.5%
Simplified44.5%
associate-*l/49.0%
Applied egg-rr49.0%
Final simplification54.5%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 -7e+99)
(/ (+ t_1 (* 9.0 (/ (* y x) z))) c)
(if (<= z 1.42e+206)
(/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* a t)))) (* c z))
(/ (+ t_1 (/ b z)) c)))))assert(x < y);
assert(t < a);
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 <= -7e+99) {
tmp = (t_1 + (9.0 * ((y * x) / z))) / c;
} else if (z <= 1.42e+206) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (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.
NOTE: t and a 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 <= (-7d+99)) then
tmp = (t_1 + (9.0d0 * ((y * x) / z))) / c
else if (z <= 1.42d+206) then
tmp = (b + ((x * (9.0d0 * y)) - ((z * 4.0d0) * (a * t)))) / (c * z)
else
tmp = (t_1 + (b / z)) / c
end if
code = tmp
end function
assert x < y;
assert t < a;
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 <= -7e+99) {
tmp = (t_1 + (9.0 * ((y * x) / z))) / c;
} else if (z <= 1.42e+206) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (c * z);
} else {
tmp = (t_1 + (b / z)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = t * (-4.0 * a) tmp = 0 if z <= -7e+99: tmp = (t_1 + (9.0 * ((y * x) / z))) / c elif z <= 1.42e+206: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (c * z) else: tmp = (t_1 + (b / z)) / c return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(-4.0 * a)) tmp = 0.0 if (z <= -7e+99) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(Float64(y * x) / z))) / c); elseif (z <= 1.42e+206) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(a * t)))) / Float64(c * z)); else tmp = Float64(Float64(t_1 + Float64(b / z)) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * (-4.0 * a);
tmp = 0.0;
if (z <= -7e+99)
tmp = (t_1 + (9.0 * ((y * x) / z))) / c;
elseif (z <= 1.42e+206)
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (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.
NOTE: t and a 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, -7e+99], N[(N[(t$95$1 + N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.42e+206], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $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])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-4 \cdot a\right)\\
\mathbf{if}\;z \leq -7 \cdot 10^{+99}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{y \cdot x}{z}}{c}\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{+206}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if z < -6.9999999999999995e99Initial program 35.3%
associate-/r*47.3%
Simplified83.6%
Taylor expanded in x around inf 72.6%
if -6.9999999999999995e99 < z < 1.42000000000000005e206Initial program 89.4%
associate-*l*89.4%
associate-*l*87.9%
Simplified87.9%
if 1.42000000000000005e206 < z Initial program 29.1%
associate-/r*47.5%
Simplified82.0%
Taylor expanded in x around 0 86.7%
Final simplification84.9%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 -1.25e+101)
(/ (+ t_1 (* 9.0 (/ (* y x) z))) c)
(if (<= z 1.45e+206)
(/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* c z))
(/ (+ t_1 (/ b z)) c)))))assert(x < y);
assert(t < a);
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 <= -1.25e+101) {
tmp = (t_1 + (9.0 * ((y * x) / z))) / c;
} else if (z <= 1.45e+206) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (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.
NOTE: t and a 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 <= (-1.25d+101)) then
tmp = (t_1 + (9.0d0 * ((y * x) / z))) / c
else if (z <= 1.45d+206) then
tmp = (b + ((y * (9.0d0 * x)) - (a * (t * (z * 4.0d0))))) / (c * z)
else
tmp = (t_1 + (b / z)) / c
end if
code = tmp
end function
assert x < y;
assert t < a;
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 <= -1.25e+101) {
tmp = (t_1 + (9.0 * ((y * x) / z))) / c;
} else if (z <= 1.45e+206) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
} else {
tmp = (t_1 + (b / z)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = t * (-4.0 * a) tmp = 0 if z <= -1.25e+101: tmp = (t_1 + (9.0 * ((y * x) / z))) / c elif z <= 1.45e+206: tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z) else: tmp = (t_1 + (b / z)) / c return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(-4.0 * a)) tmp = 0.0 if (z <= -1.25e+101) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(Float64(y * x) / z))) / c); elseif (z <= 1.45e+206) tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)); else tmp = Float64(Float64(t_1 + Float64(b / z)) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * (-4.0 * a);
tmp = 0.0;
if (z <= -1.25e+101)
tmp = (t_1 + (9.0 * ((y * x) / z))) / c;
elseif (z <= 1.45e+206)
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (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.
NOTE: t and a 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, -1.25e+101], N[(N[(t$95$1 + N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.45e+206], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-4 \cdot a\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+101}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{y \cdot x}{z}}{c}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+206}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if z < -1.24999999999999997e101Initial program 35.3%
associate-/r*47.3%
Simplified83.6%
Taylor expanded in x around inf 72.6%
if -1.24999999999999997e101 < z < 1.45e206Initial program 89.4%
if 1.45e206 < z Initial program 29.1%
associate-/r*47.5%
Simplified82.0%
Taylor expanded in x around 0 86.7%
Final simplification86.0%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (+ b (* 9.0 (* y x))) (* c z))) (t_2 (/ (* t (* -4.0 a)) c)))
(if (<= z -1.8e+120)
t_2
(if (<= z 7.2e+59)
t_1
(if (<= z 1.65e+180)
(/ 1.0 (* (/ -0.25 a) (/ c t)))
(if (<= z 1.42e+206) t_1 t_2))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (y * x))) / (c * z);
double t_2 = (t * (-4.0 * a)) / c;
double tmp;
if (z <= -1.8e+120) {
tmp = t_2;
} else if (z <= 7.2e+59) {
tmp = t_1;
} else if (z <= 1.65e+180) {
tmp = 1.0 / ((-0.25 / a) * (c / t));
} else if (z <= 1.42e+206) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 = (b + (9.0d0 * (y * x))) / (c * z)
t_2 = (t * ((-4.0d0) * a)) / c
if (z <= (-1.8d+120)) then
tmp = t_2
else if (z <= 7.2d+59) then
tmp = t_1
else if (z <= 1.65d+180) then
tmp = 1.0d0 / (((-0.25d0) / a) * (c / t))
else if (z <= 1.42d+206) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (y * x))) / (c * z);
double t_2 = (t * (-4.0 * a)) / c;
double tmp;
if (z <= -1.8e+120) {
tmp = t_2;
} else if (z <= 7.2e+59) {
tmp = t_1;
} else if (z <= 1.65e+180) {
tmp = 1.0 / ((-0.25 / a) * (c / t));
} else if (z <= 1.42e+206) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (b + (9.0 * (y * x))) / (c * z) t_2 = (t * (-4.0 * a)) / c tmp = 0 if z <= -1.8e+120: tmp = t_2 elif z <= 7.2e+59: tmp = t_1 elif z <= 1.65e+180: tmp = 1.0 / ((-0.25 / a) * (c / t)) elif z <= 1.42e+206: tmp = t_1 else: tmp = t_2 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / Float64(c * z)) t_2 = Float64(Float64(t * Float64(-4.0 * a)) / c) tmp = 0.0 if (z <= -1.8e+120) tmp = t_2; elseif (z <= 7.2e+59) tmp = t_1; elseif (z <= 1.65e+180) tmp = Float64(1.0 / Float64(Float64(-0.25 / a) * Float64(c / t))); elseif (z <= 1.42e+206) tmp = t_1; else tmp = t_2; end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + (9.0 * (y * x))) / (c * z);
t_2 = (t * (-4.0 * a)) / c;
tmp = 0.0;
if (z <= -1.8e+120)
tmp = t_2;
elseif (z <= 7.2e+59)
tmp = t_1;
elseif (z <= 1.65e+180)
tmp = 1.0 / ((-0.25 / a) * (c / t));
elseif (z <= 1.42e+206)
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.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1.8e+120], t$95$2, If[LessEqual[z, 7.2e+59], t$95$1, If[LessEqual[z, 1.65e+180], N[(1.0 / N[(N[(-0.25 / a), $MachinePrecision] * N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.42e+206], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b + 9 \cdot \left(y \cdot x\right)}{c \cdot z}\\
t_2 := \frac{t \cdot \left(-4 \cdot a\right)}{c}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+120}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+180}:\\
\;\;\;\;\frac{1}{\frac{-0.25}{a} \cdot \frac{c}{t}}\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{+206}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.80000000000000008e120 or 1.42000000000000005e206 < z Initial program 32.8%
associate-/r*47.3%
Simplified82.6%
Taylor expanded in t around inf 65.7%
associate-*r*65.7%
*-commutative65.7%
*-commutative65.7%
*-commutative65.7%
Simplified65.7%
if -1.80000000000000008e120 < z < 7.1999999999999997e59 or 1.64999999999999995e180 < z < 1.42000000000000005e206Initial program 92.4%
associate-/r*85.4%
Simplified87.2%
Taylor expanded in z around 0 80.0%
if 7.1999999999999997e59 < z < 1.64999999999999995e180Initial program 56.9%
associate-/r*72.9%
Simplified78.6%
clear-num78.8%
fma-udef78.8%
+-commutative78.8%
inv-pow78.8%
+-commutative78.8%
fma-udef78.8%
Applied egg-rr78.8%
Taylor expanded in t around inf 46.9%
associate-*r/46.9%
Simplified46.9%
unpow-146.9%
times-frac51.8%
Applied egg-rr51.8%
Final simplification74.2%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 -1.6e+70)
(/ (+ t_1 (* 9.0 (/ (* y x) z))) c)
(if (<= z 62000000000.0)
(/ (+ b (* 9.0 (* y x))) (* c z))
(/ (+ t_1 (/ b z)) c)))))assert(x < y);
assert(t < a);
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 <= -1.6e+70) {
tmp = (t_1 + (9.0 * ((y * x) / z))) / c;
} else if (z <= 62000000000.0) {
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.
NOTE: t and a 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 <= (-1.6d+70)) then
tmp = (t_1 + (9.0d0 * ((y * x) / z))) / c
else if (z <= 62000000000.0d0) 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;
assert t < a;
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 <= -1.6e+70) {
tmp = (t_1 + (9.0 * ((y * x) / z))) / c;
} else if (z <= 62000000000.0) {
tmp = (b + (9.0 * (y * x))) / (c * z);
} else {
tmp = (t_1 + (b / z)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = t * (-4.0 * a) tmp = 0 if z <= -1.6e+70: tmp = (t_1 + (9.0 * ((y * x) / z))) / c elif z <= 62000000000.0: tmp = (b + (9.0 * (y * x))) / (c * z) else: tmp = (t_1 + (b / z)) / c return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(-4.0 * a)) tmp = 0.0 if (z <= -1.6e+70) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(Float64(y * x) / z))) / c); elseif (z <= 62000000000.0) 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])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * (-4.0 * a);
tmp = 0.0;
if (z <= -1.6e+70)
tmp = (t_1 + (9.0 * ((y * x) / z))) / c;
elseif (z <= 62000000000.0)
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.
NOTE: t and a 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, -1.6e+70], N[(N[(t$95$1 + N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 62000000000.0], 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])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-4 \cdot a\right)\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+70}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{y \cdot x}{z}}{c}\\
\mathbf{elif}\;z \leq 62000000000:\\
\;\;\;\;\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 < -1.6000000000000001e70Initial program 40.6%
associate-/r*51.4%
Simplified83.7%
Taylor expanded in x around inf 72.9%
if -1.6000000000000001e70 < z < 6.2e10Initial program 94.5%
associate-/r*86.9%
Simplified87.7%
Taylor expanded in z around 0 83.5%
if 6.2e10 < z Initial program 53.8%
associate-/r*64.3%
Simplified81.2%
Taylor expanded in x around 0 74.4%
Final simplification79.2%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -1.45e+116) (not (<= z 960000000000.0))) (/ (+ (* t (* -4.0 a)) (/ b z)) c) (/ (+ b (* 9.0 (* y x))) (* c z))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.45e+116) || !(z <= 960000000000.0)) {
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.
NOTE: t and a 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.45d+116)) .or. (.not. (z <= 960000000000.0d0))) 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;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.45e+116) || !(z <= 960000000000.0)) {
tmp = ((t * (-4.0 * a)) + (b / z)) / c;
} else {
tmp = (b + (9.0 * (y * x))) / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1.45e+116) or not (z <= 960000000000.0): tmp = ((t * (-4.0 * a)) + (b / z)) / c else: tmp = (b + (9.0 * (y * x))) / (c * z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1.45e+116) || !(z <= 960000000000.0)) 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])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -1.45e+116) || ~((z <= 960000000000.0)))
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. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1.45e+116], N[Not[LessEqual[z, 960000000000.0]], $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])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+116} \lor \neg \left(z \leq 960000000000\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 < -1.4500000000000001e116 or 9.6e11 < z Initial program 45.2%
associate-/r*56.6%
Simplified81.9%
Taylor expanded in x around 0 73.9%
if -1.4500000000000001e116 < z < 9.6e11Initial program 93.5%
associate-/r*86.4%
Simplified87.7%
Taylor expanded in z around 0 81.8%
Final simplification78.7%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 c) t))))
(if (<= a -1.65e-162)
t_1
(if (<= a 1.3e-132)
(/ (/ b c) z)
(if (<= a 1.45e+111) (/ 1.0 (/ c (/ b z))) t_1)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * ((a / c) * t);
double tmp;
if (a <= -1.65e-162) {
tmp = t_1;
} else if (a <= 1.3e-132) {
tmp = (b / c) / z;
} else if (a <= 1.45e+111) {
tmp = 1.0 / (c / (b / z));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 / c) * t)
if (a <= (-1.65d-162)) then
tmp = t_1
else if (a <= 1.3d-132) then
tmp = (b / c) / z
else if (a <= 1.45d+111) then
tmp = 1.0d0 / (c / (b / z))
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * ((a / c) * t);
double tmp;
if (a <= -1.65e-162) {
tmp = t_1;
} else if (a <= 1.3e-132) {
tmp = (b / c) / z;
} else if (a <= 1.45e+111) {
tmp = 1.0 / (c / (b / z));
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * ((a / c) * t) tmp = 0 if a <= -1.65e-162: tmp = t_1 elif a <= 1.3e-132: tmp = (b / c) / z elif a <= 1.45e+111: tmp = 1.0 / (c / (b / z)) else: tmp = t_1 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(Float64(a / c) * t)) tmp = 0.0 if (a <= -1.65e-162) tmp = t_1; elseif (a <= 1.3e-132) tmp = Float64(Float64(b / c) / z); elseif (a <= 1.45e+111) tmp = Float64(1.0 / Float64(c / Float64(b / z))); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * ((a / c) * t);
tmp = 0.0;
if (a <= -1.65e-162)
tmp = t_1;
elseif (a <= 1.3e-132)
tmp = (b / c) / z;
elseif (a <= 1.45e+111)
tmp = 1.0 / (c / (b / z));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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[(N[(a / c), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.65e-162], t$95$1, If[LessEqual[a, 1.3e-132], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 1.45e+111], N[(1.0 / N[(c / N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(\frac{a}{c} \cdot t\right)\\
\mathbf{if}\;a \leq -1.65 \cdot 10^{-162}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-132}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+111}:\\
\;\;\;\;\frac{1}{\frac{c}{\frac{b}{z}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.65000000000000007e-162 or 1.45e111 < a Initial program 71.7%
associate-/r*72.9%
Simplified83.4%
Taylor expanded in t around inf 47.0%
associate-/l*48.9%
associate-/r/52.3%
Simplified52.3%
if -1.65000000000000007e-162 < a < 1.3e-132Initial program 73.1%
associate-/r*74.4%
Simplified89.0%
div-inv88.9%
Applied egg-rr88.9%
Taylor expanded in b around inf 41.3%
associate-/r*41.4%
Simplified41.4%
if 1.3e-132 < a < 1.45e111Initial program 84.7%
associate-/r*79.9%
Simplified85.0%
Taylor expanded in b around inf 41.6%
*-commutative41.6%
Simplified41.6%
clear-num41.6%
inv-pow41.6%
*-commutative41.6%
Applied egg-rr41.6%
unpow-141.6%
associate-/l*42.0%
Simplified42.0%
Final simplification47.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= a -1.65e-162) (not (<= a 5.5e+112))) (* -4.0 (* (/ a c) t)) (/ (/ b c) z)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -1.65e-162) || !(a <= 5.5e+112)) {
tmp = -4.0 * ((a / c) * t);
} else {
tmp = (b / c) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 ((a <= (-1.65d-162)) .or. (.not. (a <= 5.5d+112))) then
tmp = (-4.0d0) * ((a / c) * t)
else
tmp = (b / c) / z
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -1.65e-162) || !(a <= 5.5e+112)) {
tmp = -4.0 * ((a / c) * t);
} else {
tmp = (b / c) / z;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -1.65e-162) or not (a <= 5.5e+112): tmp = -4.0 * ((a / c) * t) else: tmp = (b / c) / z return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -1.65e-162) || !(a <= 5.5e+112)) tmp = Float64(-4.0 * Float64(Float64(a / c) * t)); else tmp = Float64(Float64(b / c) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((a <= -1.65e-162) || ~((a <= 5.5e+112)))
tmp = -4.0 * ((a / c) * t);
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -1.65e-162], N[Not[LessEqual[a, 5.5e+112]], $MachinePrecision]], N[(-4.0 * N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.65 \cdot 10^{-162} \lor \neg \left(a \leq 5.5 \cdot 10^{+112}\right):\\
\;\;\;\;-4 \cdot \left(\frac{a}{c} \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if a < -1.65000000000000007e-162 or 5.50000000000000026e112 < a Initial program 71.5%
associate-/r*72.7%
Simplified83.3%
Taylor expanded in t around inf 47.3%
associate-/l*49.3%
associate-/r/52.7%
Simplified52.7%
if -1.65000000000000007e-162 < a < 5.50000000000000026e112Initial program 77.1%
associate-/r*76.3%
Simplified86.9%
div-inv86.9%
Applied egg-rr86.9%
Taylor expanded in b around inf 41.0%
associate-/r*40.3%
Simplified40.3%
Final simplification46.9%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= t -2.4e-279) (/ (/ b c) z) (/ b (* c z))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -2.4e-279) {
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.
NOTE: t and a 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 <= (-2.4d-279)) then
tmp = (b / c) / z
else
tmp = b / (c * z)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -2.4e-279) {
tmp = (b / c) / z;
} else {
tmp = b / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -2.4e-279: tmp = (b / c) / z else: tmp = b / (c * z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -2.4e-279) tmp = Float64(Float64(b / c) / z); else tmp = Float64(b / Float64(c * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -2.4e-279)
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. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -2.4e-279], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-279}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\end{array}
\end{array}
if t < -2.3999999999999999e-279Initial program 74.8%
associate-/r*73.6%
Simplified83.4%
div-inv83.4%
Applied egg-rr83.4%
Taylor expanded in b around inf 32.0%
associate-/r*33.6%
Simplified33.6%
if -2.3999999999999999e-279 < t Initial program 73.5%
associate-/r*75.1%
Simplified86.3%
Taylor expanded in b around inf 35.4%
*-commutative35.4%
Simplified35.4%
Final simplification34.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a 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);
assert(t < a);
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.
NOTE: t and a 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;
assert t < a;
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]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return b / (c * z)
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(c * z)) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
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. NOTE: t and a 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])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{b}{c \cdot z}
\end{array}
Initial program 74.1%
associate-/r*74.4%
Simplified85.4%
Taylor expanded in b around inf 33.8%
*-commutative33.8%
Simplified33.8%
Final simplification33.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 2023252
(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)))