
(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 13 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 (if (or (<= c -3.7e+48) (not (<= c 2.2e-49))) (fma (/ a (/ c t)) -4.0 (fma 9.0 (* (/ x c) (/ y z)) (/ b (* c z)))) (/ (+ (* x (* 9.0 y)) (- b (* (* z 4.0) (* a t)))) (* c z))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((c <= -3.7e+48) || !(c <= 2.2e-49)) {
tmp = fma((a / (c / t)), -4.0, fma(9.0, ((x / c) * (y / z)), (b / (c * z))));
} else {
tmp = ((x * (9.0 * y)) + (b - ((z * 4.0) * (a * t)))) / (c * z);
}
return tmp;
}
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((c <= -3.7e+48) || !(c <= 2.2e-49)) tmp = fma(Float64(a / Float64(c / t)), -4.0, fma(9.0, Float64(Float64(x / c) * Float64(y / z)), Float64(b / Float64(c * z)))); else tmp = Float64(Float64(Float64(x * Float64(9.0 * y)) + Float64(b - Float64(Float64(z * 4.0) * Float64(a * t)))) / Float64(c * z)); 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[c, -3.7e+48], N[Not[LessEqual[c, 2.2e-49]], $MachinePrecision]], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] + N[(b - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.7 \cdot 10^{+48} \lor \neg \left(c \leq 2.2 \cdot 10^{-49}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{\frac{c}{t}}, -4, \mathsf{fma}\left(9, \frac{x}{c} \cdot \frac{y}{z}, \frac{b}{c \cdot z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot y\right) + \left(b - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right)}{c \cdot z}\\
\end{array}
\end{array}
if c < -3.6999999999999999e48 or 2.1999999999999999e-49 < c Initial program 69.0%
Taylor expanded in x around 0 80.6%
cancel-sign-sub-inv80.6%
metadata-eval80.6%
+-commutative80.6%
*-commutative80.6%
fma-def80.6%
associate-/l*83.1%
fma-def83.1%
times-frac88.0%
*-commutative88.0%
Simplified88.0%
if -3.6999999999999999e48 < c < 2.1999999999999999e-49Initial program 96.1%
associate-+l-96.1%
associate-*l*96.1%
associate-*l*97.5%
Simplified97.5%
Final simplification92.5%
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 (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* c z))))
(if (<= t_1 -4e-310)
t_1
(if (<= t_1 0.0)
(/ (+ (* -4.0 (* a t)) (/ b z)) c)
(if (<= t_1 INFINITY) t_1 (* (/ a (/ c t)) -4.0))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
double tmp;
if (t_1 <= -4e-310) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a / (c / t)) * -4.0;
}
return tmp;
}
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 + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
double tmp;
if (t_1 <= -4e-310) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (a / (c / t)) * -4.0;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z) tmp = 0 if t_1 <= -4e-310: tmp = t_1 elif t_1 <= 0.0: tmp = ((-4.0 * (a * t)) + (b / z)) / c elif t_1 <= math.inf: tmp = t_1 else: tmp = (a / (c / t)) * -4.0 return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)) tmp = 0.0 if (t_1 <= -4e-310) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a / Float64(c / t)) * -4.0); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
tmp = 0.0;
if (t_1 <= -4e-310)
tmp = t_1;
elseif (t_1 <= 0.0)
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
elseif (t_1 <= Inf)
tmp = t_1;
else
tmp = (a / (c / t)) * -4.0;
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[(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]}, If[LessEqual[t$95$1, -4e-310], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{-310}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -3.999999999999988e-310 or 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < +inf.0Initial program 91.7%
if -3.999999999999988e-310 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 0.0Initial program 36.6%
associate-/r*99.4%
associate-+l-99.4%
associate-*r*99.5%
associate-*r*99.6%
div-inv99.6%
associate--r-99.6%
fma-neg99.6%
associate-*r*99.7%
distribute-rgt-neg-in99.7%
associate-*l*99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in x around 0 91.2%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) Initial program 0.0%
Simplified8.0%
add-cube-cbrt8.0%
times-frac16.6%
pow216.6%
+-commutative16.6%
fma-def16.6%
Applied egg-rr16.6%
Taylor expanded in t around inf 48.8%
associate-/l*61.3%
Simplified61.3%
Final simplification89.9%
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 (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* c z))))
(if (<= t_1 -4e-310)
(/ (+ (* x (* 9.0 y)) (- b (* (* z 4.0) (* a t)))) (* c z))
(if (<= t_1 0.0)
(/ (+ (* -4.0 (* a t)) (/ b z)) c)
(if (<= t_1 INFINITY) t_1 (* (/ a (/ c t)) -4.0))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
double tmp;
if (t_1 <= -4e-310) {
tmp = ((x * (9.0 * y)) + (b - ((z * 4.0) * (a * t)))) / (c * z);
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a / (c / t)) * -4.0;
}
return tmp;
}
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 + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
double tmp;
if (t_1 <= -4e-310) {
tmp = ((x * (9.0 * y)) + (b - ((z * 4.0) * (a * t)))) / (c * z);
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (a / (c / t)) * -4.0;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z) tmp = 0 if t_1 <= -4e-310: tmp = ((x * (9.0 * y)) + (b - ((z * 4.0) * (a * t)))) / (c * z) elif t_1 <= 0.0: tmp = ((-4.0 * (a * t)) + (b / z)) / c elif t_1 <= math.inf: tmp = t_1 else: tmp = (a / (c / t)) * -4.0 return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)) tmp = 0.0 if (t_1 <= -4e-310) tmp = Float64(Float64(Float64(x * Float64(9.0 * y)) + Float64(b - Float64(Float64(z * 4.0) * Float64(a * t)))) / Float64(c * z)); elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a / Float64(c / t)) * -4.0); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
tmp = 0.0;
if (t_1 <= -4e-310)
tmp = ((x * (9.0 * y)) + (b - ((z * 4.0) * (a * t)))) / (c * z);
elseif (t_1 <= 0.0)
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
elseif (t_1 <= Inf)
tmp = t_1;
else
tmp = (a / (c / t)) * -4.0;
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[(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]}, If[LessEqual[t$95$1, -4e-310], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] + N[(b - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot y\right) + \left(b - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right)}{c \cdot z}\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -3.999999999999988e-310Initial program 93.2%
associate-+l-93.2%
associate-*l*93.2%
associate-*l*93.9%
Simplified93.9%
if -3.999999999999988e-310 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 0.0Initial program 36.6%
associate-/r*99.4%
associate-+l-99.4%
associate-*r*99.5%
associate-*r*99.6%
div-inv99.6%
associate--r-99.6%
fma-neg99.6%
associate-*r*99.7%
distribute-rgt-neg-in99.7%
associate-*l*99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in x around 0 91.2%
if 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < +inf.0Initial program 90.1%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) Initial program 0.0%
Simplified8.0%
add-cube-cbrt8.0%
times-frac16.6%
pow216.6%
+-commutative16.6%
fma-def16.6%
Applied egg-rr16.6%
Taylor expanded in t around inf 48.8%
associate-/l*61.3%
Simplified61.3%
Final simplification90.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 (or (<= z -1.9e+51) (not (<= z 3.2e-99))) (* (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) (/ 1.0 c)) (/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* c z))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.9e+51) || !(z <= 3.2e-99)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (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 ((z <= (-1.9d+51)) .or. (.not. (z <= 3.2d-99))) then
tmp = (((-4.0d0) * (a * t)) + ((9.0d0 * ((x * y) / z)) + (b / z))) * (1.0d0 / c)
else
tmp = (b + ((y * (9.0d0 * x)) - (a * (t * (z * 4.0d0))))) / (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 ((z <= -1.9e+51) || !(z <= 3.2e-99)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1.9e+51) or not (z <= 3.2e-99): tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c) else: tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1.9e+51) || !(z <= 3.2e-99)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) * Float64(1.0 / c)); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(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 ((z <= -1.9e+51) || ~((z <= 3.2e-99)))
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
else
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (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[Or[LessEqual[z, -1.9e+51], N[Not[LessEqual[z, 3.2e-99]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $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[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+51} \lor \neg \left(z \leq 3.2 \cdot 10^{-99}\right):\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)\right) \cdot \frac{1}{c}\\
\mathbf{else}:\\
\;\;\;\;\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}\\
\end{array}
\end{array}
if z < -1.8999999999999999e51 or 3.2000000000000001e-99 < z Initial program 66.0%
associate-/r*76.6%
associate-+l-76.6%
associate-*r*76.6%
associate-*r*80.5%
div-inv80.5%
associate--r-80.5%
fma-neg80.6%
associate-*r*76.8%
distribute-rgt-neg-in76.8%
associate-*l*76.8%
Applied egg-rr76.8%
Taylor expanded in x around 0 87.3%
if -1.8999999999999999e51 < z < 3.2000000000000001e-99Initial program 97.7%
Final simplification92.5%
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 t))) (t_2 (+ b (* x (* 9.0 y)))))
(if (<= b -1e+66)
(/ (/ t_2 c) z)
(if (<= b -8.6e+20)
(/ (+ t_1 (/ b z)) c)
(if (<= b -112000000000.0)
(* 9.0 (/ (* x y) (* c z)))
(if (<= b 3.1e+127)
(/ (+ t_1 (* 9.0 (/ (* x y) z))) c)
(/ t_2 (* c z))))))))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 * t);
double t_2 = b + (x * (9.0 * y));
double tmp;
if (b <= -1e+66) {
tmp = (t_2 / c) / z;
} else if (b <= -8.6e+20) {
tmp = (t_1 + (b / z)) / c;
} else if (b <= -112000000000.0) {
tmp = 9.0 * ((x * y) / (c * z));
} else if (b <= 3.1e+127) {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
} else {
tmp = t_2 / (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) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * (a * t)
t_2 = b + (x * (9.0d0 * y))
if (b <= (-1d+66)) then
tmp = (t_2 / c) / z
else if (b <= (-8.6d+20)) then
tmp = (t_1 + (b / z)) / c
else if (b <= (-112000000000.0d0)) then
tmp = 9.0d0 * ((x * y) / (c * z))
else if (b <= 3.1d+127) then
tmp = (t_1 + (9.0d0 * ((x * y) / z))) / c
else
tmp = t_2 / (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 = -4.0 * (a * t);
double t_2 = b + (x * (9.0 * y));
double tmp;
if (b <= -1e+66) {
tmp = (t_2 / c) / z;
} else if (b <= -8.6e+20) {
tmp = (t_1 + (b / z)) / c;
} else if (b <= -112000000000.0) {
tmp = 9.0 * ((x * y) / (c * z));
} else if (b <= 3.1e+127) {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
} else {
tmp = t_2 / (c * z);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * t) t_2 = b + (x * (9.0 * y)) tmp = 0 if b <= -1e+66: tmp = (t_2 / c) / z elif b <= -8.6e+20: tmp = (t_1 + (b / z)) / c elif b <= -112000000000.0: tmp = 9.0 * ((x * y) / (c * z)) elif b <= 3.1e+127: tmp = (t_1 + (9.0 * ((x * y) / z))) / c else: tmp = t_2 / (c * z) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a * t)) t_2 = Float64(b + Float64(x * Float64(9.0 * y))) tmp = 0.0 if (b <= -1e+66) tmp = Float64(Float64(t_2 / c) / z); elseif (b <= -8.6e+20) tmp = Float64(Float64(t_1 + Float64(b / z)) / c); elseif (b <= -112000000000.0) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))); elseif (b <= 3.1e+127) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(Float64(x * y) / z))) / c); else tmp = Float64(t_2 / Float64(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 = -4.0 * (a * t);
t_2 = b + (x * (9.0 * y));
tmp = 0.0;
if (b <= -1e+66)
tmp = (t_2 / c) / z;
elseif (b <= -8.6e+20)
tmp = (t_1 + (b / z)) / c;
elseif (b <= -112000000000.0)
tmp = 9.0 * ((x * y) / (c * z));
elseif (b <= 3.1e+127)
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
else
tmp = t_2 / (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[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1e+66], N[(N[(t$95$2 / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, -8.6e+20], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, -112000000000.0], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.1e+127], N[(N[(t$95$1 + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(t$95$2 / N[(c * z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot t\right)\\
t_2 := b + x \cdot \left(9 \cdot y\right)\\
\mathbf{if}\;b \leq -1 \cdot 10^{+66}:\\
\;\;\;\;\frac{\frac{t_2}{c}}{z}\\
\mathbf{elif}\;b \leq -8.6 \cdot 10^{+20}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\mathbf{elif}\;b \leq -112000000000:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{+127}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{x \cdot y}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_2}{c \cdot z}\\
\end{array}
\end{array}
if b < -9.99999999999999945e65Initial program 87.4%
Simplified89.2%
add-cube-cbrt88.4%
times-frac87.0%
pow287.0%
+-commutative87.0%
fma-def87.0%
Applied egg-rr87.0%
Taylor expanded in t around 0 77.7%
associate-/r*78.8%
associate-*r*78.8%
*-commutative78.8%
associate-*r*78.8%
*-commutative78.8%
Simplified78.8%
if -9.99999999999999945e65 < b < -8.6e20Initial program 63.6%
associate-/r*81.6%
associate-+l-81.6%
associate-*r*81.6%
associate-*r*81.6%
div-inv81.3%
associate--r-81.3%
fma-neg81.6%
associate-*r*81.6%
distribute-rgt-neg-in81.6%
associate-*l*81.6%
Applied egg-rr81.6%
Taylor expanded in x around 0 81.4%
Taylor expanded in x around 0 81.8%
if -8.6e20 < b < -1.12e11Initial program 100.0%
Taylor expanded in x around inf 100.0%
if -1.12e11 < b < 3.1000000000000002e127Initial program 81.5%
associate-/r*85.4%
associate-+l-85.4%
associate-*r*85.4%
associate-*r*87.4%
div-inv87.5%
associate--r-87.5%
fma-neg87.5%
associate-*r*85.5%
distribute-rgt-neg-in85.5%
associate-*l*85.5%
Applied egg-rr85.5%
Taylor expanded in x around 0 89.4%
Taylor expanded in b around 0 82.1%
if 3.1000000000000002e127 < b Initial program 80.7%
Taylor expanded in x around inf 80.4%
associate-*r*80.4%
*-commutative80.4%
associate-*r*80.4%
Simplified80.4%
Final simplification81.4%
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 (<= a -3.9e-177)
(* (/ a (/ c t)) -4.0)
(if (<= a 2.5e-182)
(/ (/ b c) z)
(if (<= a 8.2e-70)
(* 9.0 (* x (/ y (* c z))))
(if (<= a 6.8e+38) (/ b (* c z)) (* -4.0 (/ t (/ c a))))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -3.9e-177) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 2.5e-182) {
tmp = (b / c) / z;
} else if (a <= 8.2e-70) {
tmp = 9.0 * (x * (y / (c * z)));
} else if (a <= 6.8e+38) {
tmp = b / (c * z);
} else {
tmp = -4.0 * (t / (c / a));
}
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 (a <= (-3.9d-177)) then
tmp = (a / (c / t)) * (-4.0d0)
else if (a <= 2.5d-182) then
tmp = (b / c) / z
else if (a <= 8.2d-70) then
tmp = 9.0d0 * (x * (y / (c * z)))
else if (a <= 6.8d+38) then
tmp = b / (c * z)
else
tmp = (-4.0d0) * (t / (c / a))
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 (a <= -3.9e-177) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 2.5e-182) {
tmp = (b / c) / z;
} else if (a <= 8.2e-70) {
tmp = 9.0 * (x * (y / (c * z)));
} else if (a <= 6.8e+38) {
tmp = b / (c * z);
} else {
tmp = -4.0 * (t / (c / a));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= -3.9e-177: tmp = (a / (c / t)) * -4.0 elif a <= 2.5e-182: tmp = (b / c) / z elif a <= 8.2e-70: tmp = 9.0 * (x * (y / (c * z))) elif a <= 6.8e+38: tmp = b / (c * z) else: tmp = -4.0 * (t / (c / a)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= -3.9e-177) tmp = Float64(Float64(a / Float64(c / t)) * -4.0); elseif (a <= 2.5e-182) tmp = Float64(Float64(b / c) / z); elseif (a <= 8.2e-70) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c * z)))); elseif (a <= 6.8e+38) tmp = Float64(b / Float64(c * z)); else tmp = Float64(-4.0 * Float64(t / Float64(c / a))); 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 (a <= -3.9e-177)
tmp = (a / (c / t)) * -4.0;
elseif (a <= 2.5e-182)
tmp = (b / c) / z;
elseif (a <= 8.2e-70)
tmp = 9.0 * (x * (y / (c * z)));
elseif (a <= 6.8e+38)
tmp = b / (c * z);
else
tmp = -4.0 * (t / (c / a));
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[a, -3.9e-177], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[a, 2.5e-182], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 8.2e-70], N[(9.0 * N[(x * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.8e+38], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{-177}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-182}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{-70}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c \cdot z}\right)\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{+38}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -3.90000000000000014e-177Initial program 76.1%
Simplified72.2%
add-cube-cbrt71.7%
times-frac74.6%
pow274.6%
+-commutative74.6%
fma-def74.6%
Applied egg-rr74.6%
Taylor expanded in t around inf 51.2%
associate-/l*51.9%
Simplified51.9%
if -3.90000000000000014e-177 < a < 2.50000000000000012e-182Initial program 86.1%
Taylor expanded in b around inf 57.5%
associate-/r*58.9%
Simplified58.9%
if 2.50000000000000012e-182 < a < 8.19999999999999955e-70Initial program 82.1%
associate-/r*78.8%
associate-+l-78.8%
associate-*r*78.9%
associate-*r*92.1%
div-inv92.0%
associate--r-92.0%
fma-neg92.0%
associate-*r*78.8%
distribute-rgt-neg-in78.8%
associate-*l*78.8%
Applied egg-rr78.8%
Taylor expanded in x around 0 92.1%
Taylor expanded in x around inf 72.3%
*-commutative72.3%
associate-*r/72.3%
Simplified72.3%
if 8.19999999999999955e-70 < a < 6.79999999999999992e38Initial program 90.9%
Taylor expanded in b around inf 46.6%
*-commutative46.6%
Simplified46.6%
if 6.79999999999999992e38 < a Initial program 84.2%
Taylor expanded in z around inf 55.9%
*-commutative55.9%
Simplified55.9%
*-commutative55.9%
*-un-lft-identity55.9%
times-frac66.3%
Applied egg-rr66.3%
/-rgt-identity66.3%
clear-num66.3%
un-div-inv66.2%
Applied egg-rr66.2%
Final simplification57.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 (<= a -3.9e-177)
(* (/ a (/ c t)) -4.0)
(if (<= a 1.6e-182)
(/ (/ b c) z)
(if (<= a 1.35e-70)
(* 9.0 (* (/ x c) (/ y z)))
(if (<= a 1.22e+39) (/ b (* c z)) (* -4.0 (/ t (/ c a))))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -3.9e-177) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 1.6e-182) {
tmp = (b / c) / z;
} else if (a <= 1.35e-70) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (a <= 1.22e+39) {
tmp = b / (c * z);
} else {
tmp = -4.0 * (t / (c / a));
}
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 (a <= (-3.9d-177)) then
tmp = (a / (c / t)) * (-4.0d0)
else if (a <= 1.6d-182) then
tmp = (b / c) / z
else if (a <= 1.35d-70) then
tmp = 9.0d0 * ((x / c) * (y / z))
else if (a <= 1.22d+39) then
tmp = b / (c * z)
else
tmp = (-4.0d0) * (t / (c / a))
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 (a <= -3.9e-177) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 1.6e-182) {
tmp = (b / c) / z;
} else if (a <= 1.35e-70) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (a <= 1.22e+39) {
tmp = b / (c * z);
} else {
tmp = -4.0 * (t / (c / a));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= -3.9e-177: tmp = (a / (c / t)) * -4.0 elif a <= 1.6e-182: tmp = (b / c) / z elif a <= 1.35e-70: tmp = 9.0 * ((x / c) * (y / z)) elif a <= 1.22e+39: tmp = b / (c * z) else: tmp = -4.0 * (t / (c / a)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= -3.9e-177) tmp = Float64(Float64(a / Float64(c / t)) * -4.0); elseif (a <= 1.6e-182) tmp = Float64(Float64(b / c) / z); elseif (a <= 1.35e-70) tmp = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))); elseif (a <= 1.22e+39) tmp = Float64(b / Float64(c * z)); else tmp = Float64(-4.0 * Float64(t / Float64(c / a))); 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 (a <= -3.9e-177)
tmp = (a / (c / t)) * -4.0;
elseif (a <= 1.6e-182)
tmp = (b / c) / z;
elseif (a <= 1.35e-70)
tmp = 9.0 * ((x / c) * (y / z));
elseif (a <= 1.22e+39)
tmp = b / (c * z);
else
tmp = -4.0 * (t / (c / a));
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[a, -3.9e-177], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[a, 1.6e-182], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 1.35e-70], N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.22e+39], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{-177}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-182}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-70}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;a \leq 1.22 \cdot 10^{+39}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -3.90000000000000014e-177Initial program 76.1%
Simplified72.2%
add-cube-cbrt71.7%
times-frac74.6%
pow274.6%
+-commutative74.6%
fma-def74.6%
Applied egg-rr74.6%
Taylor expanded in t around inf 51.2%
associate-/l*51.9%
Simplified51.9%
if -3.90000000000000014e-177 < a < 1.60000000000000001e-182Initial program 86.1%
Taylor expanded in b around inf 57.5%
associate-/r*58.9%
Simplified58.9%
if 1.60000000000000001e-182 < a < 1.3500000000000001e-70Initial program 82.1%
Taylor expanded in x around inf 72.3%
times-frac76.3%
Simplified76.3%
if 1.3500000000000001e-70 < a < 1.22e39Initial program 90.9%
Taylor expanded in b around inf 46.6%
*-commutative46.6%
Simplified46.6%
if 1.22e39 < a Initial program 84.2%
Taylor expanded in z around inf 55.9%
*-commutative55.9%
Simplified55.9%
*-commutative55.9%
*-un-lft-identity55.9%
times-frac66.3%
Applied egg-rr66.3%
/-rgt-identity66.3%
clear-num66.3%
un-div-inv66.2%
Applied egg-rr66.2%
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
(if (<= a -3.2e-178)
(* (/ a (/ c t)) -4.0)
(if (<= a 1.75e-182)
(/ (/ b c) z)
(if (<= a 8.5e-71)
(* 9.0 (* (/ x z) (/ y c)))
(if (<= a 1.06e+39) (/ b (* c z)) (* -4.0 (/ t (/ c a))))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -3.2e-178) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 1.75e-182) {
tmp = (b / c) / z;
} else if (a <= 8.5e-71) {
tmp = 9.0 * ((x / z) * (y / c));
} else if (a <= 1.06e+39) {
tmp = b / (c * z);
} else {
tmp = -4.0 * (t / (c / a));
}
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 (a <= (-3.2d-178)) then
tmp = (a / (c / t)) * (-4.0d0)
else if (a <= 1.75d-182) then
tmp = (b / c) / z
else if (a <= 8.5d-71) then
tmp = 9.0d0 * ((x / z) * (y / c))
else if (a <= 1.06d+39) then
tmp = b / (c * z)
else
tmp = (-4.0d0) * (t / (c / a))
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 (a <= -3.2e-178) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 1.75e-182) {
tmp = (b / c) / z;
} else if (a <= 8.5e-71) {
tmp = 9.0 * ((x / z) * (y / c));
} else if (a <= 1.06e+39) {
tmp = b / (c * z);
} else {
tmp = -4.0 * (t / (c / a));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= -3.2e-178: tmp = (a / (c / t)) * -4.0 elif a <= 1.75e-182: tmp = (b / c) / z elif a <= 8.5e-71: tmp = 9.0 * ((x / z) * (y / c)) elif a <= 1.06e+39: tmp = b / (c * z) else: tmp = -4.0 * (t / (c / a)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= -3.2e-178) tmp = Float64(Float64(a / Float64(c / t)) * -4.0); elseif (a <= 1.75e-182) tmp = Float64(Float64(b / c) / z); elseif (a <= 8.5e-71) tmp = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))); elseif (a <= 1.06e+39) tmp = Float64(b / Float64(c * z)); else tmp = Float64(-4.0 * Float64(t / Float64(c / a))); 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 (a <= -3.2e-178)
tmp = (a / (c / t)) * -4.0;
elseif (a <= 1.75e-182)
tmp = (b / c) / z;
elseif (a <= 8.5e-71)
tmp = 9.0 * ((x / z) * (y / c));
elseif (a <= 1.06e+39)
tmp = b / (c * z);
else
tmp = -4.0 * (t / (c / a));
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[a, -3.2e-178], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[a, 1.75e-182], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 8.5e-71], N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.06e+39], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{-178}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-182}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{-71}:\\
\;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\mathbf{elif}\;a \leq 1.06 \cdot 10^{+39}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -3.2000000000000001e-178Initial program 76.1%
Simplified72.2%
add-cube-cbrt71.7%
times-frac74.6%
pow274.6%
+-commutative74.6%
fma-def74.6%
Applied egg-rr74.6%
Taylor expanded in t around inf 51.2%
associate-/l*51.9%
Simplified51.9%
if -3.2000000000000001e-178 < a < 1.74999999999999992e-182Initial program 86.1%
Taylor expanded in b around inf 57.5%
associate-/r*58.9%
Simplified58.9%
if 1.74999999999999992e-182 < a < 8.49999999999999988e-71Initial program 82.1%
Simplified91.4%
add-cube-cbrt90.8%
times-frac90.8%
pow290.8%
+-commutative90.8%
fma-def90.8%
Applied egg-rr90.8%
Taylor expanded in x around inf 72.3%
associate-*r/72.2%
*-commutative72.2%
associate-*r/72.3%
times-frac72.0%
Simplified72.0%
if 8.49999999999999988e-71 < a < 1.06000000000000005e39Initial program 90.9%
Taylor expanded in b around inf 46.6%
*-commutative46.6%
Simplified46.6%
if 1.06000000000000005e39 < a Initial program 84.2%
Taylor expanded in z around inf 55.9%
*-commutative55.9%
Simplified55.9%
*-commutative55.9%
*-un-lft-identity55.9%
times-frac66.3%
Applied egg-rr66.3%
/-rgt-identity66.3%
clear-num66.3%
un-div-inv66.2%
Applied egg-rr66.2%
Final simplification57.7%
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 (<= x -9.6e+128) (not (<= x 5.2e-70))) (* 9.0 (* (/ x z) (/ y c))) (/ (+ (* -4.0 (* a t)) (/ b z)) c)))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x <= -9.6e+128) || !(x <= 5.2e-70)) {
tmp = 9.0 * ((x / z) * (y / c));
} else {
tmp = ((-4.0 * (a * t)) + (b / 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 ((x <= (-9.6d+128)) .or. (.not. (x <= 5.2d-70))) then
tmp = 9.0d0 * ((x / z) * (y / c))
else
tmp = (((-4.0d0) * (a * t)) + (b / 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 ((x <= -9.6e+128) || !(x <= 5.2e-70)) {
tmp = 9.0 * ((x / z) * (y / c));
} else {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (x <= -9.6e+128) or not (x <= 5.2e-70): tmp = 9.0 * ((x / z) * (y / c)) else: tmp = ((-4.0 * (a * t)) + (b / z)) / c return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((x <= -9.6e+128) || !(x <= 5.2e-70)) tmp = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))); else tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / 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 ((x <= -9.6e+128) || ~((x <= 5.2e-70)))
tmp = 9.0 * ((x / z) * (y / c));
else
tmp = ((-4.0 * (a * t)) + (b / 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[x, -9.6e+128], N[Not[LessEqual[x, 5.2e-70]], $MachinePrecision]], N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.6 \cdot 10^{+128} \lor \neg \left(x \leq 5.2 \cdot 10^{-70}\right):\\
\;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if x < -9.6000000000000007e128 or 5.20000000000000004e-70 < x Initial program 78.5%
Simplified76.0%
add-cube-cbrt75.5%
times-frac78.6%
pow278.6%
+-commutative78.6%
fma-def78.6%
Applied egg-rr78.6%
Taylor expanded in x around inf 50.1%
associate-*r/50.1%
*-commutative50.1%
associate-*r/50.1%
times-frac55.7%
Simplified55.7%
if -9.6000000000000007e128 < x < 5.20000000000000004e-70Initial program 85.1%
associate-/r*81.6%
associate-+l-81.6%
associate-*r*81.6%
associate-*r*82.4%
div-inv82.4%
associate--r-82.4%
fma-neg82.4%
associate-*r*81.6%
distribute-rgt-neg-in81.6%
associate-*l*81.6%
Applied egg-rr81.6%
Taylor expanded in x around 0 86.0%
Taylor expanded in x around 0 75.2%
Final simplification65.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 (if (or (<= z -7.8e-100) (not (<= z 4.6e-97))) (/ (+ (* -4.0 (* a t)) (/ b z)) c) (/ (+ b (* x (* 9.0 y))) (* c z))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -7.8e-100) || !(z <= 4.6e-97)) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else {
tmp = (b + (x * (9.0 * y))) / (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 ((z <= (-7.8d-100)) .or. (.not. (z <= 4.6d-97))) then
tmp = (((-4.0d0) * (a * t)) + (b / z)) / c
else
tmp = (b + (x * (9.0d0 * y))) / (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 ((z <= -7.8e-100) || !(z <= 4.6e-97)) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else {
tmp = (b + (x * (9.0 * y))) / (c * z);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -7.8e-100) or not (z <= 4.6e-97): tmp = ((-4.0 * (a * t)) + (b / z)) / c else: tmp = (b + (x * (9.0 * y))) / (c * z) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -7.8e-100) || !(z <= 4.6e-97)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c); else tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(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 ((z <= -7.8e-100) || ~((z <= 4.6e-97)))
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
else
tmp = (b + (x * (9.0 * y))) / (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[Or[LessEqual[z, -7.8e-100], N[Not[LessEqual[z, 4.6e-97]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-100} \lor \neg \left(z \leq 4.6 \cdot 10^{-97}\right):\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -7.79999999999999955e-100 or 4.59999999999999988e-97 < z Initial program 69.7%
associate-/r*78.7%
associate-+l-78.7%
associate-*r*78.8%
associate-*r*82.1%
div-inv82.1%
associate--r-82.1%
fma-neg82.2%
associate-*r*78.9%
distribute-rgt-neg-in78.9%
associate-*l*78.9%
Applied egg-rr78.9%
Taylor expanded in x around 0 87.9%
Taylor expanded in x around 0 72.0%
if -7.79999999999999955e-100 < z < 4.59999999999999988e-97Initial program 99.0%
Taylor expanded in x around inf 84.8%
associate-*r*84.9%
*-commutative84.9%
associate-*r*84.8%
Simplified84.8%
Final simplification77.3%
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 (<= b -1.8e+71) (not (<= b 5.5e+130))) (/ b (* c z)) (* (/ a (/ c t)) -4.0)))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -1.8e+71) || !(b <= 5.5e+130)) {
tmp = b / (c * z);
} else {
tmp = (a / (c / t)) * -4.0;
}
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.8d+71)) .or. (.not. (b <= 5.5d+130))) then
tmp = b / (c * z)
else
tmp = (a / (c / t)) * (-4.0d0)
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.8e+71) || !(b <= 5.5e+130)) {
tmp = b / (c * z);
} else {
tmp = (a / (c / t)) * -4.0;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -1.8e+71) or not (b <= 5.5e+130): tmp = b / (c * z) else: tmp = (a / (c / t)) * -4.0 return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -1.8e+71) || !(b <= 5.5e+130)) tmp = Float64(b / Float64(c * z)); else tmp = Float64(Float64(a / Float64(c / t)) * -4.0); 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.8e+71) || ~((b <= 5.5e+130)))
tmp = b / (c * z);
else
tmp = (a / (c / t)) * -4.0;
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[b, -1.8e+71], N[Not[LessEqual[b, 5.5e+130]], $MachinePrecision]], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{+71} \lor \neg \left(b \leq 5.5 \cdot 10^{+130}\right):\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\end{array}
\end{array}
if b < -1.8e71 or 5.4999999999999997e130 < b Initial program 84.3%
Taylor expanded in b around inf 66.0%
*-commutative66.0%
Simplified66.0%
if -1.8e71 < b < 5.4999999999999997e130Initial program 80.6%
Simplified77.5%
add-cube-cbrt76.8%
times-frac81.3%
pow281.3%
+-commutative81.3%
fma-def81.3%
Applied egg-rr81.3%
Taylor expanded in t around inf 51.9%
associate-/l*52.7%
Simplified52.7%
Final simplification57.3%
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 (<= a -3.4e-177) (* (/ a (/ c t)) -4.0) (if (<= a 7.5e+38) (* b (/ 1.0 (* c z))) (* -4.0 (/ t (/ c a))))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -3.4e-177) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 7.5e+38) {
tmp = b * (1.0 / (c * z));
} else {
tmp = -4.0 * (t / (c / a));
}
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 (a <= (-3.4d-177)) then
tmp = (a / (c / t)) * (-4.0d0)
else if (a <= 7.5d+38) then
tmp = b * (1.0d0 / (c * z))
else
tmp = (-4.0d0) * (t / (c / a))
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 (a <= -3.4e-177) {
tmp = (a / (c / t)) * -4.0;
} else if (a <= 7.5e+38) {
tmp = b * (1.0 / (c * z));
} else {
tmp = -4.0 * (t / (c / a));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= -3.4e-177: tmp = (a / (c / t)) * -4.0 elif a <= 7.5e+38: tmp = b * (1.0 / (c * z)) else: tmp = -4.0 * (t / (c / a)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= -3.4e-177) tmp = Float64(Float64(a / Float64(c / t)) * -4.0); elseif (a <= 7.5e+38) tmp = Float64(b * Float64(1.0 / Float64(c * z))); else tmp = Float64(-4.0 * Float64(t / Float64(c / a))); 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 (a <= -3.4e-177)
tmp = (a / (c / t)) * -4.0;
elseif (a <= 7.5e+38)
tmp = b * (1.0 / (c * z));
else
tmp = -4.0 * (t / (c / a));
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[a, -3.4e-177], N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[a, 7.5e+38], N[(b * N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.4 \cdot 10^{-177}:\\
\;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{+38}:\\
\;\;\;\;b \cdot \frac{1}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -3.4000000000000001e-177Initial program 76.1%
Simplified72.2%
add-cube-cbrt71.7%
times-frac74.6%
pow274.6%
+-commutative74.6%
fma-def74.6%
Applied egg-rr74.6%
Taylor expanded in t around inf 51.2%
associate-/l*51.9%
Simplified51.9%
if -3.4000000000000001e-177 < a < 7.4999999999999999e38Initial program 86.3%
Taylor expanded in b around inf 50.2%
*-commutative50.2%
Simplified50.2%
div-inv50.9%
Applied egg-rr50.9%
if 7.4999999999999999e38 < a Initial program 84.2%
Taylor expanded in z around inf 55.9%
*-commutative55.9%
Simplified55.9%
*-commutative55.9%
*-un-lft-identity55.9%
times-frac66.3%
Applied egg-rr66.3%
/-rgt-identity66.3%
clear-num66.3%
un-div-inv66.2%
Applied egg-rr66.2%
Final simplification54.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 (/ b (* c z)))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
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 t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return b / (c * z)
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(c * z)) end
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (c * z);
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[(c * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{b}{c \cdot z}
\end{array}
Initial program 81.8%
Taylor expanded in b around inf 36.5%
*-commutative36.5%
Simplified36.5%
Final simplification36.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t_4}{z \cdot c}\\
t_6 := \frac{\left(t_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t_5 < 0:\\
\;\;\;\;\frac{\frac{t_4}{z}}{c}\\
\mathbf{elif}\;t_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t_1\right) - t_2\\
\mathbf{elif}\;t_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t_1\right) - t_2\\
\end{array}
\end{array}
herbie shell --seed 2023298
(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)))