
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
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 (/ a (/ c t))) (t_2 (/ (/ b z) c)))
(if (<= z -1.85e+101)
(+ t_2 (fma -4.0 t_1 (* 9.0 (/ (/ y (/ z x)) c))))
(if (<= z 1.45e+38)
(/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* z c))
(+ t_2 (fma -4.0 t_1 (/ (/ 9.0 (/ (/ z x) y)) c)))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a / (c / t);
double t_2 = (b / z) / c;
double tmp;
if (z <= -1.85e+101) {
tmp = t_2 + fma(-4.0, t_1, (9.0 * ((y / (z / x)) / c)));
} else if (z <= 1.45e+38) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = t_2 + fma(-4.0, t_1, ((9.0 / ((z / x) / y)) / c));
}
return tmp;
}
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(a / Float64(c / t)) t_2 = Float64(Float64(b / z) / c) tmp = 0.0 if (z <= -1.85e+101) tmp = Float64(t_2 + fma(-4.0, t_1, Float64(9.0 * Float64(Float64(y / Float64(z / x)) / c)))); elseif (z <= 1.45e+38) tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(t_2 + fma(-4.0, t_1, Float64(Float64(9.0 / Float64(Float64(z / x) / y)) / c))); end return tmp end
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[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1.85e+101], N[(t$95$2 + N[(-4.0 * t$95$1 + N[(9.0 * N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+38], 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[(z * c), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(-4.0 * t$95$1 + N[(N[(9.0 / N[(N[(z / x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{c}{t}}\\
t_2 := \frac{\frac{b}{z}}{c}\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+101}:\\
\;\;\;\;t_2 + \mathsf{fma}\left(-4, t_1, 9 \cdot \frac{\frac{y}{\frac{z}{x}}}{c}\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+38}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t_2 + \mathsf{fma}\left(-4, t_1, \frac{\frac{9}{\frac{\frac{z}{x}}{y}}}{c}\right)\\
\end{array}
\end{array}
if z < -1.8499999999999999e101Initial program 58.2%
associate-/r*71.3%
Simplified88.4%
fma-udef88.4%
Applied egg-rr88.4%
clear-num88.4%
inv-pow88.4%
associate-*r*88.4%
fma-def88.4%
Applied egg-rr88.4%
Taylor expanded in z around 0 77.2%
associate-/l/79.1%
fma-def79.1%
associate-/l*73.5%
*-commutative73.5%
times-frac86.0%
associate-*r/86.4%
associate-*l/78.8%
associate-/l*86.9%
Simplified86.9%
if -1.8499999999999999e101 < z < 1.45000000000000003e38Initial program 92.5%
if 1.45000000000000003e38 < z Initial program 45.3%
associate-/r*55.6%
Simplified80.9%
fma-udef80.9%
Applied egg-rr80.9%
clear-num80.7%
inv-pow80.7%
associate-*r*80.7%
fma-def80.7%
Applied egg-rr80.7%
Taylor expanded in z around 0 76.8%
associate-/l/78.7%
fma-def78.7%
associate-/l*84.3%
*-commutative84.3%
times-frac90.5%
associate-*r/94.7%
associate-*l/86.5%
associate-/l*95.9%
Simplified95.9%
associate-*r/95.8%
clear-num95.8%
un-div-inv95.9%
Applied egg-rr95.9%
Final simplification92.1%
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 -2.65e+101) (not (<= z 1.56e+38))) (+ (/ (/ b z) c) (fma -4.0 (/ a (/ c t)) (* 9.0 (/ (/ y (/ z x)) c)))) (/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* z c))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2.65e+101) || !(z <= 1.56e+38)) {
tmp = ((b / z) / c) + fma(-4.0, (a / (c / t)), (9.0 * ((y / (z / x)) / c)));
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2.65e+101) || !(z <= 1.56e+38)) tmp = Float64(Float64(Float64(b / z) / c) + fma(-4.0, Float64(a / Float64(c / t)), Float64(9.0 * Float64(Float64(y / Float64(z / x)) / c)))); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); end return tmp end
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, -2.65e+101], N[Not[LessEqual[z, 1.56e+38]], $MachinePrecision]], N[(N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision] + N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{+101} \lor \neg \left(z \leq 1.56 \cdot 10^{+38}\right):\\
\;\;\;\;\frac{\frac{b}{z}}{c} + \mathsf{fma}\left(-4, \frac{a}{\frac{c}{t}}, 9 \cdot \frac{\frac{y}{\frac{z}{x}}}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -2.65000000000000003e101 or 1.5599999999999999e38 < z Initial program 51.7%
associate-/r*63.5%
Simplified84.6%
fma-udef84.6%
Applied egg-rr84.6%
clear-num84.6%
inv-pow84.6%
associate-*r*84.6%
fma-def84.6%
Applied egg-rr84.6%
Taylor expanded in z around 0 77.0%
associate-/l/78.9%
fma-def78.9%
associate-/l*78.9%
*-commutative78.9%
times-frac88.2%
associate-*r/90.5%
associate-*l/82.7%
associate-/l*91.4%
Simplified91.4%
if -2.65000000000000003e101 < z < 1.5599999999999999e38Initial program 92.5%
Final simplification92.1%
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 (<= (* y (* 9.0 x)) 5e+190) (/ (+ (/ (+ b (* x (* 9.0 y))) z) (* t (* -4.0 a))) c) (* 9.0 (/ y (* z (/ c x))))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y * (9.0 * x)) <= 5e+190) {
tmp = (((b + (x * (9.0 * y))) / z) + (t * (-4.0 * a))) / c;
} else {
tmp = 9.0 * (y / (z * (c / x)));
}
return tmp;
}
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 ((y * (9.0d0 * x)) <= 5d+190) then
tmp = (((b + (x * (9.0d0 * y))) / z) + (t * ((-4.0d0) * a))) / c
else
tmp = 9.0d0 * (y / (z * (c / x)))
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y * (9.0 * x)) <= 5e+190) {
tmp = (((b + (x * (9.0 * y))) / z) + (t * (-4.0 * a))) / c;
} else {
tmp = 9.0 * (y / (z * (c / x)));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (y * (9.0 * x)) <= 5e+190: tmp = (((b + (x * (9.0 * y))) / z) + (t * (-4.0 * a))) / c else: tmp = 9.0 * (y / (z * (c / x))) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(y * Float64(9.0 * x)) <= 5e+190) tmp = Float64(Float64(Float64(Float64(b + Float64(x * Float64(9.0 * y))) / z) + Float64(t * Float64(-4.0 * a))) / c); else tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((y * (9.0 * x)) <= 5e+190)
tmp = (((b + (x * (9.0 * y))) / z) + (t * (-4.0 * a))) / c;
else
tmp = 9.0 * (y / (z * (c / x)));
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision], 5e+190], N[(N[(N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \left(9 \cdot x\right) \leq 5 \cdot 10^{+190}:\\
\;\;\;\;\frac{\frac{b + x \cdot \left(9 \cdot y\right)}{z} + t \cdot \left(-4 \cdot a\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < 5.00000000000000036e190Initial program 77.3%
associate-/r*80.8%
Simplified90.2%
fma-udef90.2%
Applied egg-rr90.2%
if 5.00000000000000036e190 < (*.f64 (*.f64 x 9) y) Initial program 71.5%
associate-/r*63.0%
Simplified63.4%
Taylor expanded in x around inf 68.7%
*-commutative68.7%
times-frac90.2%
Simplified90.2%
*-commutative90.2%
clear-num90.2%
frac-times87.0%
*-un-lft-identity87.0%
Applied egg-rr87.0%
Final simplification89.8%
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 (* 9.0 (* y x)))
(t_2 (* t (* -4.0 a)))
(t_3 (/ (+ (/ b z) t_2) c)))
(if (<= z -2000000000000.0)
t_3
(if (<= z 1.95e-36)
(/ (+ b t_1) (* z c))
(if (<= z 2.8e+133) (/ (+ t_2 (/ t_1 z)) c) t_3)))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * (y * x);
double t_2 = t * (-4.0 * a);
double t_3 = ((b / z) + t_2) / c;
double tmp;
if (z <= -2000000000000.0) {
tmp = t_3;
} else if (z <= 1.95e-36) {
tmp = (b + t_1) / (z * c);
} else if (z <= 2.8e+133) {
tmp = (t_2 + (t_1 / z)) / c;
} else {
tmp = t_3;
}
return tmp;
}
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 = 9.0d0 * (y * x)
t_2 = t * ((-4.0d0) * a)
t_3 = ((b / z) + t_2) / c
if (z <= (-2000000000000.0d0)) then
tmp = t_3
else if (z <= 1.95d-36) then
tmp = (b + t_1) / (z * c)
else if (z <= 2.8d+133) then
tmp = (t_2 + (t_1 / z)) / c
else
tmp = t_3
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * (y * x);
double t_2 = t * (-4.0 * a);
double t_3 = ((b / z) + t_2) / c;
double tmp;
if (z <= -2000000000000.0) {
tmp = t_3;
} else if (z <= 1.95e-36) {
tmp = (b + t_1) / (z * c);
} else if (z <= 2.8e+133) {
tmp = (t_2 + (t_1 / z)) / c;
} else {
tmp = t_3;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * (y * x) t_2 = t * (-4.0 * a) t_3 = ((b / z) + t_2) / c tmp = 0 if z <= -2000000000000.0: tmp = t_3 elif z <= 1.95e-36: tmp = (b + t_1) / (z * c) elif z <= 2.8e+133: tmp = (t_2 + (t_1 / z)) / c else: tmp = t_3 return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(y * x)) t_2 = Float64(t * Float64(-4.0 * a)) t_3 = Float64(Float64(Float64(b / z) + t_2) / c) tmp = 0.0 if (z <= -2000000000000.0) tmp = t_3; elseif (z <= 1.95e-36) tmp = Float64(Float64(b + t_1) / Float64(z * c)); elseif (z <= 2.8e+133) tmp = Float64(Float64(t_2 + Float64(t_1 / z)) / c); else tmp = t_3; end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 9.0 * (y * x);
t_2 = t * (-4.0 * a);
t_3 = ((b / z) + t_2) / c;
tmp = 0.0;
if (z <= -2000000000000.0)
tmp = t_3;
elseif (z <= 1.95e-36)
tmp = (b + t_1) / (z * c);
elseif (z <= 2.8e+133)
tmp = (t_2 + (t_1 / z)) / c;
else
tmp = t_3;
end
tmp_2 = tmp;
end
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[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(b / z), $MachinePrecision] + t$95$2), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2000000000000.0], t$95$3, If[LessEqual[z, 1.95e-36], N[(N[(b + t$95$1), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+133], N[(N[(t$95$2 + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(y \cdot x\right)\\
t_2 := t \cdot \left(-4 \cdot a\right)\\
t_3 := \frac{\frac{b}{z} + t_2}{c}\\
\mathbf{if}\;z \leq -2000000000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-36}:\\
\;\;\;\;\frac{b + t_1}{z \cdot c}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+133}:\\
\;\;\;\;\frac{t_2 + \frac{t_1}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -2e12 or 2.80000000000000016e133 < z Initial program 57.9%
associate-/r*69.5%
Simplified87.5%
Taylor expanded in x around 0 80.0%
if -2e12 < z < 1.95e-36Initial program 93.7%
associate-/r*86.8%
Simplified86.8%
Taylor expanded in z around 0 83.8%
if 1.95e-36 < z < 2.80000000000000016e133Initial program 70.5%
associate-/r*76.4%
Simplified88.4%
Taylor expanded in x around inf 78.4%
Final simplification81.6%
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 (* 9.0 (* (/ x c) (/ y z)))))
(if (<= b -3.35e-15)
(/ b (* z c))
(if (<= b -4.6e-246)
(* -4.0 (* t (/ a c)))
(if (<= b 1.15e-257)
t_1
(if (<= b 1.6e-19)
(* -4.0 (/ a (/ c t)))
(if (<= b 6e+50) t_1 (/ (/ b c) z))))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * ((x / c) * (y / z));
double tmp;
if (b <= -3.35e-15) {
tmp = b / (z * c);
} else if (b <= -4.6e-246) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 1.15e-257) {
tmp = t_1;
} else if (b <= 1.6e-19) {
tmp = -4.0 * (a / (c / t));
} else if (b <= 6e+50) {
tmp = t_1;
} else {
tmp = (b / c) / z;
}
return tmp;
}
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 = 9.0d0 * ((x / c) * (y / z))
if (b <= (-3.35d-15)) then
tmp = b / (z * c)
else if (b <= (-4.6d-246)) then
tmp = (-4.0d0) * (t * (a / c))
else if (b <= 1.15d-257) then
tmp = t_1
else if (b <= 1.6d-19) then
tmp = (-4.0d0) * (a / (c / t))
else if (b <= 6d+50) then
tmp = t_1
else
tmp = (b / c) / z
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * ((x / c) * (y / z));
double tmp;
if (b <= -3.35e-15) {
tmp = b / (z * c);
} else if (b <= -4.6e-246) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 1.15e-257) {
tmp = t_1;
} else if (b <= 1.6e-19) {
tmp = -4.0 * (a / (c / t));
} else if (b <= 6e+50) {
tmp = t_1;
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * ((x / c) * (y / z)) tmp = 0 if b <= -3.35e-15: tmp = b / (z * c) elif b <= -4.6e-246: tmp = -4.0 * (t * (a / c)) elif b <= 1.15e-257: tmp = t_1 elif b <= 1.6e-19: tmp = -4.0 * (a / (c / t)) elif b <= 6e+50: tmp = t_1 else: tmp = (b / c) / z return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))) tmp = 0.0 if (b <= -3.35e-15) tmp = Float64(b / Float64(z * c)); elseif (b <= -4.6e-246) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (b <= 1.15e-257) tmp = t_1; elseif (b <= 1.6e-19) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (b <= 6e+50) tmp = t_1; else tmp = Float64(Float64(b / c) / z); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 9.0 * ((x / c) * (y / z));
tmp = 0.0;
if (b <= -3.35e-15)
tmp = b / (z * c);
elseif (b <= -4.6e-246)
tmp = -4.0 * (t * (a / c));
elseif (b <= 1.15e-257)
tmp = t_1;
elseif (b <= 1.6e-19)
tmp = -4.0 * (a / (c / t));
elseif (b <= 6e+50)
tmp = t_1;
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
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[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.35e-15], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4.6e-246], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.15e-257], t$95$1, If[LessEqual[b, 1.6e-19], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e+50], t$95$1, N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{if}\;b \leq -3.35 \cdot 10^{-15}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq -4.6 \cdot 10^{-246}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-257}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{-19}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+50}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -3.35e-15Initial program 83.8%
associate-/r*80.6%
Simplified86.5%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
if -3.35e-15 < b < -4.5999999999999995e-246Initial program 70.3%
associate-/r*79.3%
Simplified88.4%
Taylor expanded in t around inf 58.7%
associate-/l*63.1%
associate-/r/60.9%
Simplified60.9%
if -4.5999999999999995e-246 < b < 1.15e-257 or 1.59999999999999991e-19 < b < 5.9999999999999996e50Initial program 72.6%
associate-/r*83.6%
Simplified90.6%
Taylor expanded in x around inf 59.6%
*-commutative59.6%
times-frac68.0%
Simplified68.0%
if 1.15e-257 < b < 1.59999999999999991e-19Initial program 72.1%
associate-/r*70.8%
Simplified84.5%
Taylor expanded in t around inf 54.0%
associate-/l*57.8%
Simplified57.8%
if 5.9999999999999996e50 < b Initial program 78.0%
associate-/r*78.4%
Simplified88.0%
Taylor expanded in x around 0 77.1%
Taylor expanded in b around inf 57.6%
div-inv57.7%
Applied egg-rr57.7%
Taylor expanded in b around 0 55.2%
associate-/r*57.7%
Simplified57.7%
Final simplification61.1%
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 (<= b -1.55e-15)
(/ b (* z c))
(if (<= b -1.12e-242)
(* -4.0 (* t (/ a c)))
(if (<= b 9.8e-260)
(* 9.0 (* (/ x c) (/ y z)))
(if (<= b 9e-24)
(* -4.0 (/ a (/ c t)))
(if (<= b 1.05e+52) (* 9.0 (/ x (* c (/ z y)))) (/ (/ b c) z)))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1.55e-15) {
tmp = b / (z * c);
} else if (b <= -1.12e-242) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 9.8e-260) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (b <= 9e-24) {
tmp = -4.0 * (a / (c / t));
} else if (b <= 1.05e+52) {
tmp = 9.0 * (x / (c * (z / y)));
} else {
tmp = (b / c) / z;
}
return tmp;
}
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 (b <= (-1.55d-15)) then
tmp = b / (z * c)
else if (b <= (-1.12d-242)) then
tmp = (-4.0d0) * (t * (a / c))
else if (b <= 9.8d-260) then
tmp = 9.0d0 * ((x / c) * (y / z))
else if (b <= 9d-24) then
tmp = (-4.0d0) * (a / (c / t))
else if (b <= 1.05d+52) then
tmp = 9.0d0 * (x / (c * (z / y)))
else
tmp = (b / c) / z
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1.55e-15) {
tmp = b / (z * c);
} else if (b <= -1.12e-242) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 9.8e-260) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (b <= 9e-24) {
tmp = -4.0 * (a / (c / t));
} else if (b <= 1.05e+52) {
tmp = 9.0 * (x / (c * (z / y)));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -1.55e-15: tmp = b / (z * c) elif b <= -1.12e-242: tmp = -4.0 * (t * (a / c)) elif b <= 9.8e-260: tmp = 9.0 * ((x / c) * (y / z)) elif b <= 9e-24: tmp = -4.0 * (a / (c / t)) elif b <= 1.05e+52: tmp = 9.0 * (x / (c * (z / y))) else: tmp = (b / c) / z return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -1.55e-15) tmp = Float64(b / Float64(z * c)); elseif (b <= -1.12e-242) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (b <= 9.8e-260) tmp = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))); elseif (b <= 9e-24) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (b <= 1.05e+52) tmp = Float64(9.0 * Float64(x / Float64(c * Float64(z / y)))); else tmp = Float64(Float64(b / c) / z); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -1.55e-15)
tmp = b / (z * c);
elseif (b <= -1.12e-242)
tmp = -4.0 * (t * (a / c));
elseif (b <= 9.8e-260)
tmp = 9.0 * ((x / c) * (y / z));
elseif (b <= 9e-24)
tmp = -4.0 * (a / (c / t));
elseif (b <= 1.05e+52)
tmp = 9.0 * (x / (c * (z / y)));
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -1.55e-15], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.12e-242], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.8e-260], N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9e-24], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.05e+52], N[(9.0 * N[(x / N[(c * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.55 \cdot 10^{-15}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq -1.12 \cdot 10^{-242}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;b \leq 9.8 \cdot 10^{-260}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;b \leq 9 \cdot 10^{-24}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{+52}:\\
\;\;\;\;9 \cdot \frac{x}{c \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -1.5499999999999999e-15Initial program 83.8%
associate-/r*80.6%
Simplified86.5%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
if -1.5499999999999999e-15 < b < -1.11999999999999997e-242Initial program 70.3%
associate-/r*79.3%
Simplified88.4%
Taylor expanded in t around inf 58.7%
associate-/l*63.1%
associate-/r/60.9%
Simplified60.9%
if -1.11999999999999997e-242 < b < 9.8000000000000005e-260Initial program 70.7%
associate-/r*92.2%
Simplified92.3%
Taylor expanded in x around inf 57.2%
*-commutative57.2%
times-frac67.2%
Simplified67.2%
if 9.8000000000000005e-260 < b < 8.9999999999999995e-24Initial program 72.1%
associate-/r*70.8%
Simplified84.5%
Taylor expanded in t around inf 54.0%
associate-/l*57.8%
Simplified57.8%
if 8.9999999999999995e-24 < b < 1.05e52Initial program 75.5%
associate-/r*70.0%
Simplified88.1%
Taylor expanded in x around inf 63.3%
*-commutative63.3%
times-frac69.3%
Simplified69.3%
clear-num69.4%
frac-times69.4%
*-un-lft-identity69.4%
Applied egg-rr69.4%
if 1.05e52 < b Initial program 78.0%
associate-/r*78.4%
Simplified88.0%
Taylor expanded in x around 0 77.1%
Taylor expanded in b around inf 57.6%
div-inv57.7%
Applied egg-rr57.7%
Taylor expanded in b around 0 55.2%
associate-/r*57.7%
Simplified57.7%
Final simplification61.1%
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 (<= b -3.3e-16)
(/ b (* z c))
(if (<= b -9.6e-244)
(* -4.0 (* t (/ a c)))
(if (<= b 2e-258)
(* 9.0 (* (/ x c) (/ y z)))
(if (<= b 5e-25)
(* -4.0 (/ a (/ c t)))
(if (<= b 7.2e+52) (* 9.0 (/ x (/ z (/ y c)))) (/ (/ b c) z)))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -3.3e-16) {
tmp = b / (z * c);
} else if (b <= -9.6e-244) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 2e-258) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (b <= 5e-25) {
tmp = -4.0 * (a / (c / t));
} else if (b <= 7.2e+52) {
tmp = 9.0 * (x / (z / (y / c)));
} else {
tmp = (b / c) / z;
}
return tmp;
}
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 (b <= (-3.3d-16)) then
tmp = b / (z * c)
else if (b <= (-9.6d-244)) then
tmp = (-4.0d0) * (t * (a / c))
else if (b <= 2d-258) then
tmp = 9.0d0 * ((x / c) * (y / z))
else if (b <= 5d-25) then
tmp = (-4.0d0) * (a / (c / t))
else if (b <= 7.2d+52) then
tmp = 9.0d0 * (x / (z / (y / c)))
else
tmp = (b / c) / z
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -3.3e-16) {
tmp = b / (z * c);
} else if (b <= -9.6e-244) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 2e-258) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (b <= 5e-25) {
tmp = -4.0 * (a / (c / t));
} else if (b <= 7.2e+52) {
tmp = 9.0 * (x / (z / (y / c)));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -3.3e-16: tmp = b / (z * c) elif b <= -9.6e-244: tmp = -4.0 * (t * (a / c)) elif b <= 2e-258: tmp = 9.0 * ((x / c) * (y / z)) elif b <= 5e-25: tmp = -4.0 * (a / (c / t)) elif b <= 7.2e+52: tmp = 9.0 * (x / (z / (y / c))) else: tmp = (b / c) / z return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -3.3e-16) tmp = Float64(b / Float64(z * c)); elseif (b <= -9.6e-244) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (b <= 2e-258) tmp = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))); elseif (b <= 5e-25) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (b <= 7.2e+52) tmp = Float64(9.0 * Float64(x / Float64(z / Float64(y / c)))); else tmp = Float64(Float64(b / c) / z); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -3.3e-16)
tmp = b / (z * c);
elseif (b <= -9.6e-244)
tmp = -4.0 * (t * (a / c));
elseif (b <= 2e-258)
tmp = 9.0 * ((x / c) * (y / z));
elseif (b <= 5e-25)
tmp = -4.0 * (a / (c / t));
elseif (b <= 7.2e+52)
tmp = 9.0 * (x / (z / (y / c)));
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -3.3e-16], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -9.6e-244], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e-258], N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e-25], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.2e+52], N[(9.0 * N[(x / N[(z / N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.3 \cdot 10^{-16}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq -9.6 \cdot 10^{-244}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-258}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-25}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;b \leq 7.2 \cdot 10^{+52}:\\
\;\;\;\;9 \cdot \frac{x}{\frac{z}{\frac{y}{c}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -3.29999999999999988e-16Initial program 83.8%
associate-/r*80.6%
Simplified86.5%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
if -3.29999999999999988e-16 < b < -9.60000000000000063e-244Initial program 70.3%
associate-/r*79.3%
Simplified88.4%
Taylor expanded in t around inf 58.7%
associate-/l*63.1%
associate-/r/60.9%
Simplified60.9%
if -9.60000000000000063e-244 < b < 1.99999999999999991e-258Initial program 70.7%
associate-/r*92.2%
Simplified92.3%
Taylor expanded in x around inf 57.2%
*-commutative57.2%
times-frac67.2%
Simplified67.2%
if 1.99999999999999991e-258 < b < 4.99999999999999962e-25Initial program 72.1%
associate-/r*70.8%
Simplified84.5%
Taylor expanded in t around inf 54.0%
associate-/l*57.8%
Simplified57.8%
if 4.99999999999999962e-25 < b < 7.2e52Initial program 75.5%
associate-/r*70.0%
Simplified88.1%
Taylor expanded in x around inf 63.3%
*-commutative63.3%
times-frac69.3%
Simplified69.3%
clear-num69.4%
frac-times69.4%
*-un-lft-identity69.4%
Applied egg-rr69.4%
Taylor expanded in z around 0 63.5%
*-commutative63.5%
associate-/l*69.5%
Simplified69.5%
if 7.2e52 < b Initial program 78.0%
associate-/r*78.4%
Simplified88.0%
Taylor expanded in x around 0 77.1%
Taylor expanded in b around inf 57.6%
div-inv57.7%
Applied egg-rr57.7%
Taylor expanded in b around 0 55.2%
associate-/r*57.7%
Simplified57.7%
Final simplification61.1%
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 (<= b -2.3e-15)
(/ b (* z c))
(if (<= b -8.5e-241)
(* -4.0 (* t (/ a c)))
(if (<= b 9.8e-262)
(* 9.0 (/ y (* z (/ c x))))
(if (<= b 4e-19)
(* -4.0 (/ a (/ c t)))
(if (<= b 7.8e+51) (* 9.0 (/ x (/ z (/ y c)))) (/ (/ b c) z)))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -2.3e-15) {
tmp = b / (z * c);
} else if (b <= -8.5e-241) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 9.8e-262) {
tmp = 9.0 * (y / (z * (c / x)));
} else if (b <= 4e-19) {
tmp = -4.0 * (a / (c / t));
} else if (b <= 7.8e+51) {
tmp = 9.0 * (x / (z / (y / c)));
} else {
tmp = (b / c) / z;
}
return tmp;
}
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 (b <= (-2.3d-15)) then
tmp = b / (z * c)
else if (b <= (-8.5d-241)) then
tmp = (-4.0d0) * (t * (a / c))
else if (b <= 9.8d-262) then
tmp = 9.0d0 * (y / (z * (c / x)))
else if (b <= 4d-19) then
tmp = (-4.0d0) * (a / (c / t))
else if (b <= 7.8d+51) then
tmp = 9.0d0 * (x / (z / (y / c)))
else
tmp = (b / c) / z
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -2.3e-15) {
tmp = b / (z * c);
} else if (b <= -8.5e-241) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 9.8e-262) {
tmp = 9.0 * (y / (z * (c / x)));
} else if (b <= 4e-19) {
tmp = -4.0 * (a / (c / t));
} else if (b <= 7.8e+51) {
tmp = 9.0 * (x / (z / (y / c)));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -2.3e-15: tmp = b / (z * c) elif b <= -8.5e-241: tmp = -4.0 * (t * (a / c)) elif b <= 9.8e-262: tmp = 9.0 * (y / (z * (c / x))) elif b <= 4e-19: tmp = -4.0 * (a / (c / t)) elif b <= 7.8e+51: tmp = 9.0 * (x / (z / (y / c))) else: tmp = (b / c) / z return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -2.3e-15) tmp = Float64(b / Float64(z * c)); elseif (b <= -8.5e-241) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (b <= 9.8e-262) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))); elseif (b <= 4e-19) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (b <= 7.8e+51) tmp = Float64(9.0 * Float64(x / Float64(z / Float64(y / c)))); else tmp = Float64(Float64(b / c) / z); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -2.3e-15)
tmp = b / (z * c);
elseif (b <= -8.5e-241)
tmp = -4.0 * (t * (a / c));
elseif (b <= 9.8e-262)
tmp = 9.0 * (y / (z * (c / x)));
elseif (b <= 4e-19)
tmp = -4.0 * (a / (c / t));
elseif (b <= 7.8e+51)
tmp = 9.0 * (x / (z / (y / c)));
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -2.3e-15], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -8.5e-241], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.8e-262], N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4e-19], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.8e+51], N[(9.0 * N[(x / N[(z / N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{-15}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq -8.5 \cdot 10^{-241}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;b \leq 9.8 \cdot 10^{-262}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
\mathbf{elif}\;b \leq 4 \cdot 10^{-19}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;b \leq 7.8 \cdot 10^{+51}:\\
\;\;\;\;9 \cdot \frac{x}{\frac{z}{\frac{y}{c}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -2.2999999999999999e-15Initial program 83.8%
associate-/r*80.6%
Simplified86.5%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
if -2.2999999999999999e-15 < b < -8.49999999999999974e-241Initial program 70.3%
associate-/r*79.3%
Simplified88.4%
Taylor expanded in t around inf 58.7%
associate-/l*63.1%
associate-/r/60.9%
Simplified60.9%
if -8.49999999999999974e-241 < b < 9.8000000000000005e-262Initial program 70.7%
associate-/r*92.2%
Simplified92.3%
Taylor expanded in x around inf 57.2%
*-commutative57.2%
times-frac67.2%
Simplified67.2%
*-commutative67.2%
clear-num67.2%
frac-times68.4%
*-un-lft-identity68.4%
Applied egg-rr68.4%
if 9.8000000000000005e-262 < b < 3.9999999999999999e-19Initial program 72.1%
associate-/r*70.8%
Simplified84.5%
Taylor expanded in t around inf 54.0%
associate-/l*57.8%
Simplified57.8%
if 3.9999999999999999e-19 < b < 7.79999999999999968e51Initial program 75.5%
associate-/r*70.0%
Simplified88.1%
Taylor expanded in x around inf 63.3%
*-commutative63.3%
times-frac69.3%
Simplified69.3%
clear-num69.4%
frac-times69.4%
*-un-lft-identity69.4%
Applied egg-rr69.4%
Taylor expanded in z around 0 63.5%
*-commutative63.5%
associate-/l*69.5%
Simplified69.5%
if 7.79999999999999968e51 < b Initial program 78.0%
associate-/r*78.4%
Simplified88.0%
Taylor expanded in x around 0 77.1%
Taylor expanded in b around inf 57.6%
div-inv57.7%
Applied egg-rr57.7%
Taylor expanded in b around 0 55.2%
associate-/r*57.7%
Simplified57.7%
Final simplification61.2%
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 (<= b -2.15e-15)
(/ b (* z c))
(if (<= b -6.8e-242)
(* -4.0 (* t (/ a c)))
(if (<= b 9.8e-258)
(* 9.0 (/ (* y (/ x c)) z))
(if (<= b 3.3e-18)
(* -4.0 (/ a (/ c t)))
(if (<= b 5e+51) (* 9.0 (/ x (/ z (/ y c)))) (/ (/ b c) z)))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -2.15e-15) {
tmp = b / (z * c);
} else if (b <= -6.8e-242) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 9.8e-258) {
tmp = 9.0 * ((y * (x / c)) / z);
} else if (b <= 3.3e-18) {
tmp = -4.0 * (a / (c / t));
} else if (b <= 5e+51) {
tmp = 9.0 * (x / (z / (y / c)));
} else {
tmp = (b / c) / z;
}
return tmp;
}
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 (b <= (-2.15d-15)) then
tmp = b / (z * c)
else if (b <= (-6.8d-242)) then
tmp = (-4.0d0) * (t * (a / c))
else if (b <= 9.8d-258) then
tmp = 9.0d0 * ((y * (x / c)) / z)
else if (b <= 3.3d-18) then
tmp = (-4.0d0) * (a / (c / t))
else if (b <= 5d+51) then
tmp = 9.0d0 * (x / (z / (y / c)))
else
tmp = (b / c) / z
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -2.15e-15) {
tmp = b / (z * c);
} else if (b <= -6.8e-242) {
tmp = -4.0 * (t * (a / c));
} else if (b <= 9.8e-258) {
tmp = 9.0 * ((y * (x / c)) / z);
} else if (b <= 3.3e-18) {
tmp = -4.0 * (a / (c / t));
} else if (b <= 5e+51) {
tmp = 9.0 * (x / (z / (y / c)));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -2.15e-15: tmp = b / (z * c) elif b <= -6.8e-242: tmp = -4.0 * (t * (a / c)) elif b <= 9.8e-258: tmp = 9.0 * ((y * (x / c)) / z) elif b <= 3.3e-18: tmp = -4.0 * (a / (c / t)) elif b <= 5e+51: tmp = 9.0 * (x / (z / (y / c))) else: tmp = (b / c) / z return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -2.15e-15) tmp = Float64(b / Float64(z * c)); elseif (b <= -6.8e-242) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (b <= 9.8e-258) tmp = Float64(9.0 * Float64(Float64(y * Float64(x / c)) / z)); elseif (b <= 3.3e-18) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (b <= 5e+51) tmp = Float64(9.0 * Float64(x / Float64(z / Float64(y / c)))); else tmp = Float64(Float64(b / c) / z); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -2.15e-15)
tmp = b / (z * c);
elseif (b <= -6.8e-242)
tmp = -4.0 * (t * (a / c));
elseif (b <= 9.8e-258)
tmp = 9.0 * ((y * (x / c)) / z);
elseif (b <= 3.3e-18)
tmp = -4.0 * (a / (c / t));
elseif (b <= 5e+51)
tmp = 9.0 * (x / (z / (y / c)));
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -2.15e-15], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.8e-242], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.8e-258], N[(9.0 * N[(N[(y * N[(x / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.3e-18], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e+51], N[(9.0 * N[(x / N[(z / N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.15 \cdot 10^{-15}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq -6.8 \cdot 10^{-242}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;b \leq 9.8 \cdot 10^{-258}:\\
\;\;\;\;9 \cdot \frac{y \cdot \frac{x}{c}}{z}\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{-18}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;b \leq 5 \cdot 10^{+51}:\\
\;\;\;\;9 \cdot \frac{x}{\frac{z}{\frac{y}{c}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -2.1499999999999998e-15Initial program 83.8%
associate-/r*80.6%
Simplified86.5%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
if -2.1499999999999998e-15 < b < -6.8000000000000001e-242Initial program 70.3%
associate-/r*79.3%
Simplified88.4%
Taylor expanded in t around inf 58.7%
associate-/l*63.1%
associate-/r/60.9%
Simplified60.9%
if -6.8000000000000001e-242 < b < 9.8000000000000002e-258Initial program 70.7%
associate-/r*92.2%
Simplified92.3%
Taylor expanded in x around inf 57.2%
*-commutative57.2%
times-frac67.2%
Simplified67.2%
associate-*l/74.7%
Applied egg-rr74.7%
if 9.8000000000000002e-258 < b < 3.3000000000000002e-18Initial program 72.1%
associate-/r*70.8%
Simplified84.5%
Taylor expanded in t around inf 54.0%
associate-/l*57.8%
Simplified57.8%
if 3.3000000000000002e-18 < b < 5e51Initial program 75.5%
associate-/r*70.0%
Simplified88.1%
Taylor expanded in x around inf 63.3%
*-commutative63.3%
times-frac69.3%
Simplified69.3%
clear-num69.4%
frac-times69.4%
*-un-lft-identity69.4%
Applied egg-rr69.4%
Taylor expanded in z around 0 63.5%
*-commutative63.5%
associate-/l*69.5%
Simplified69.5%
if 5e51 < b Initial program 78.0%
associate-/r*78.4%
Simplified88.0%
Taylor expanded in x around 0 77.1%
Taylor expanded in b around inf 57.6%
div-inv57.7%
Applied egg-rr57.7%
Taylor expanded in b around 0 55.2%
associate-/r*57.7%
Simplified57.7%
Final simplification61.8%
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 -6500.0) (not (<= z 23000000000000.0))) (/ (+ (/ b z) (* t (* -4.0 a))) c) (/ (+ b (* 9.0 (* y x))) (* z c))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -6500.0) || !(z <= 23000000000000.0)) {
tmp = ((b / z) + (t * (-4.0 * a))) / c;
} else {
tmp = (b + (9.0 * (y * x))) / (z * c);
}
return tmp;
}
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 <= (-6500.0d0)) .or. (.not. (z <= 23000000000000.0d0))) then
tmp = ((b / z) + (t * ((-4.0d0) * a))) / c
else
tmp = (b + (9.0d0 * (y * x))) / (z * c)
end if
code = tmp
end function
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 <= -6500.0) || !(z <= 23000000000000.0)) {
tmp = ((b / z) + (t * (-4.0 * a))) / c;
} else {
tmp = (b + (9.0 * (y * x))) / (z * c);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -6500.0) or not (z <= 23000000000000.0): tmp = ((b / z) + (t * (-4.0 * a))) / c else: tmp = (b + (9.0 * (y * x))) / (z * c) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -6500.0) || !(z <= 23000000000000.0)) tmp = Float64(Float64(Float64(b / z) + Float64(t * Float64(-4.0 * a))) / c); else tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / Float64(z * c)); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -6500.0) || ~((z <= 23000000000000.0)))
tmp = ((b / z) + (t * (-4.0 * a))) / c;
else
tmp = (b + (9.0 * (y * x))) / (z * c);
end
tmp_2 = tmp;
end
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, -6500.0], N[Not[LessEqual[z, 23000000000000.0]], $MachinePrecision]], N[(N[(N[(b / z), $MachinePrecision] + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6500 \lor \neg \left(z \leq 23000000000000\right):\\
\;\;\;\;\frac{\frac{b}{z} + t \cdot \left(-4 \cdot a\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -6500 or 2.3e13 < z Initial program 59.1%
associate-/r*69.9%
Simplified86.9%
Taylor expanded in x around 0 76.2%
if -6500 < z < 2.3e13Initial program 93.3%
associate-/r*86.9%
Simplified87.7%
Taylor expanded in z around 0 83.3%
Final simplification79.8%
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 (<= z -3.3e+97)
(* -4.0 (/ a (/ c t)))
(if (<= z 1.25e+16)
(/ (+ b (* 9.0 (* y x))) (* z c))
(* a (* -4.0 (/ t c))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -3.3e+97) {
tmp = -4.0 * (a / (c / t));
} else if (z <= 1.25e+16) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = a * (-4.0 * (t / c));
}
return tmp;
}
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 <= (-3.3d+97)) then
tmp = (-4.0d0) * (a / (c / t))
else if (z <= 1.25d+16) then
tmp = (b + (9.0d0 * (y * x))) / (z * c)
else
tmp = a * ((-4.0d0) * (t / c))
end if
code = tmp
end function
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 <= -3.3e+97) {
tmp = -4.0 * (a / (c / t));
} else if (z <= 1.25e+16) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = a * (-4.0 * (t / c));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -3.3e+97: tmp = -4.0 * (a / (c / t)) elif z <= 1.25e+16: tmp = (b + (9.0 * (y * x))) / (z * c) else: tmp = a * (-4.0 * (t / c)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -3.3e+97) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (z <= 1.25e+16) tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / Float64(z * c)); else tmp = Float64(a * Float64(-4.0 * Float64(t / c))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -3.3e+97)
tmp = -4.0 * (a / (c / t));
elseif (z <= 1.25e+16)
tmp = (b + (9.0 * (y * x))) / (z * c);
else
tmp = a * (-4.0 * (t / c));
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -3.3e+97], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+16], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(a * N[(-4.0 * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+97}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+16}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c}\right)\\
\end{array}
\end{array}
if z < -3.3000000000000001e97Initial program 59.0%
associate-/r*71.9%
Simplified88.7%
Taylor expanded in t around inf 64.3%
associate-/l*62.5%
Simplified62.5%
if -3.3000000000000001e97 < z < 1.25e16Initial program 92.3%
associate-/r*87.9%
Simplified88.6%
Taylor expanded in z around 0 80.4%
if 1.25e16 < z Initial program 50.2%
associate-/r*59.6%
Simplified82.6%
Taylor expanded in t around inf 63.4%
associate-/l*70.0%
associate-/r/59.9%
Simplified59.9%
Taylor expanded in a around 0 63.4%
associate-*r/71.8%
*-commutative71.8%
associate-*l*71.8%
Simplified71.8%
Final simplification75.0%
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 (<= b -1e-15) (/ b (* z c)) (if (<= b 4.3e+95) (* -4.0 (* t (/ a c))) (/ (/ b c) z))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1e-15) {
tmp = b / (z * c);
} else if (b <= 4.3e+95) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b / c) / z;
}
return tmp;
}
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 (b <= (-1d-15)) then
tmp = b / (z * c)
else if (b <= 4.3d+95) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = (b / c) / z
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1e-15) {
tmp = b / (z * c);
} else if (b <= 4.3e+95) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -1e-15: tmp = b / (z * c) elif b <= 4.3e+95: tmp = -4.0 * (t * (a / c)) else: tmp = (b / c) / z return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -1e-15) tmp = Float64(b / Float64(z * c)); elseif (b <= 4.3e+95) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(Float64(b / c) / z); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -1e-15)
tmp = b / (z * c);
elseif (b <= 4.3e+95)
tmp = -4.0 * (t * (a / c));
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -1e-15], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.3e+95], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-15}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq 4.3 \cdot 10^{+95}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -1.0000000000000001e-15Initial program 83.8%
associate-/r*80.6%
Simplified86.5%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
if -1.0000000000000001e-15 < b < 4.3e95Initial program 71.5%
associate-/r*76.3%
Simplified87.8%
Taylor expanded in t around inf 50.9%
associate-/l*54.1%
associate-/r/51.7%
Simplified51.7%
if 4.3e95 < b Initial program 80.7%
associate-/r*84.1%
Simplified87.3%
Taylor expanded in x around 0 76.1%
Taylor expanded in b around inf 62.9%
div-inv63.0%
Applied egg-rr63.0%
Taylor expanded in b around 0 59.7%
associate-/r*62.9%
Simplified62.9%
Final simplification56.1%
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 (<= b -1.75e-16) (/ b (* z c)) (if (<= b 2.85e+48) (* a (* -4.0 (/ t c))) (/ (/ b c) z))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1.75e-16) {
tmp = b / (z * c);
} else if (b <= 2.85e+48) {
tmp = a * (-4.0 * (t / c));
} else {
tmp = (b / c) / z;
}
return tmp;
}
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 (b <= (-1.75d-16)) then
tmp = b / (z * c)
else if (b <= 2.85d+48) then
tmp = a * ((-4.0d0) * (t / c))
else
tmp = (b / c) / z
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1.75e-16) {
tmp = b / (z * c);
} else if (b <= 2.85e+48) {
tmp = a * (-4.0 * (t / c));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -1.75e-16: tmp = b / (z * c) elif b <= 2.85e+48: tmp = a * (-4.0 * (t / c)) else: tmp = (b / c) / z return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -1.75e-16) tmp = Float64(b / Float64(z * c)); elseif (b <= 2.85e+48) tmp = Float64(a * Float64(-4.0 * Float64(t / c))); else tmp = Float64(Float64(b / c) / z); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -1.75e-16)
tmp = b / (z * c);
elseif (b <= 2.85e+48)
tmp = a * (-4.0 * (t / c));
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -1.75e-16], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.85e+48], N[(a * N[(-4.0 * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.75 \cdot 10^{-16}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq 2.85 \cdot 10^{+48}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if b < -1.75000000000000009e-16Initial program 83.8%
associate-/r*80.6%
Simplified86.5%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
if -1.75000000000000009e-16 < b < 2.84999999999999984e48Initial program 71.0%
associate-/r*76.9%
Simplified87.3%
Taylor expanded in t around inf 52.8%
associate-/l*56.3%
associate-/r/52.9%
Simplified52.9%
Taylor expanded in a around 0 52.8%
associate-*r/57.4%
*-commutative57.4%
associate-*l*57.4%
Simplified57.4%
if 2.84999999999999984e48 < b Initial program 79.5%
associate-/r*80.0%
Simplified88.9%
Taylor expanded in x around 0 72.0%
Taylor expanded in b around inf 53.9%
div-inv54.0%
Applied egg-rr54.0%
Taylor expanded in b around 0 51.7%
associate-/r*54.0%
Simplified54.0%
Final simplification58.1%
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 (* z c)))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
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 / (z * c)
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return b / (z * c)
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (z * c);
end
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[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 76.6%
associate-/r*78.6%
Simplified87.3%
Taylor expanded in b around inf 38.8%
*-commutative38.8%
Simplified38.8%
Final simplification38.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 2023230
(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)))