
(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 11 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}
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -2.9e+44) (not (<= z 1.25e-91))) (/ (+ (/ (fma x (* 9.0 y) b) z) (* t (* a -4.0))) c) (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c z))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2.9e+44) || !(z <= 1.25e-91)) {
tmp = ((fma(x, (9.0 * y), b) / z) + (t * (a * -4.0))) / c;
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2.9e+44) || !(z <= 1.25e-91)) tmp = Float64(Float64(Float64(fma(x, Float64(9.0 * y), b) / z) + Float64(t * Float64(a * -4.0))) / c); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -2.9e+44], N[Not[LessEqual[z, 1.25e-91]], $MachinePrecision]], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+44} \lor \neg \left(z \leq 1.25 \cdot 10^{-91}\right):\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z} + t \cdot \left(a \cdot -4\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -2.9000000000000002e44 or 1.24999999999999999e-91 < z Initial program 68.2%
associate-/r*74.0%
Simplified89.1%
if -2.9000000000000002e44 < z < 1.24999999999999999e-91Initial program 93.6%
Final simplification91.1%
(FPCore (x y z t a b c) :precision binary64 (if (<= c 6.4e-32) (/ (fma t (* a -4.0) (/ (fma x (* 9.0 y) b) z)) c) (- (+ (/ b (* c z)) (* 9.0 (/ (* x y) (* c z)))) (* 4.0 (* t (/ a c))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= 6.4e-32) {
tmp = fma(t, (a * -4.0), (fma(x, (9.0 * y), b) / z)) / c;
} else {
tmp = ((b / (c * z)) + (9.0 * ((x * y) / (c * z)))) - (4.0 * (t * (a / c)));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= 6.4e-32) tmp = Float64(fma(t, Float64(a * -4.0), Float64(fma(x, Float64(9.0 * y), b) / z)) / c); else tmp = Float64(Float64(Float64(b / Float64(c * z)) + Float64(9.0 * Float64(Float64(x * y) / Float64(c * z)))) - Float64(4.0 * Float64(t * Float64(a / c)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, 6.4e-32], N[(N[(t * N[(a * -4.0), $MachinePrecision] + N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 6.4 \cdot 10^{-32}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a \cdot -4, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{b}{c \cdot z} + 9 \cdot \frac{x \cdot y}{c \cdot z}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if c < 6.4000000000000004e-32Initial program 83.3%
associate-/r*84.3%
Simplified90.8%
if 6.4000000000000004e-32 < c Initial program 71.4%
associate-*l*71.4%
associate-*l*66.7%
Simplified66.7%
Taylor expanded in x around 0 77.1%
expm1-log1p-u67.6%
expm1-udef52.2%
associate-/l*58.9%
Applied egg-rr58.9%
expm1-def71.8%
expm1-log1p87.9%
associate-/r/88.0%
Simplified88.0%
Final simplification89.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -3.2e+44)
(/ (+ (* t (* a -4.0)) (* 9.0 (/ y (/ z x)))) c)
(if (<= z 1.15e+27)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c z))
(- (+ (/ b (* c z)) (* 9.0 (/ (* x y) (* c z)))) (* 4.0 (* t (/ a c)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -3.2e+44) {
tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c;
} else if (z <= 1.15e+27) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
} else {
tmp = ((b / (c * z)) + (9.0 * ((x * y) / (c * z)))) - (4.0 * (t * (a / c)));
}
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) :: tmp
if (z <= (-3.2d+44)) then
tmp = ((t * (a * (-4.0d0))) + (9.0d0 * (y / (z / x)))) / c
else if (z <= 1.15d+27) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (c * z)
else
tmp = ((b / (c * z)) + (9.0d0 * ((x * y) / (c * z)))) - (4.0d0 * (t * (a / c)))
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 tmp;
if (z <= -3.2e+44) {
tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c;
} else if (z <= 1.15e+27) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
} else {
tmp = ((b / (c * z)) + (9.0 * ((x * y) / (c * z)))) - (4.0 * (t * (a / c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if z <= -3.2e+44: tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c elif z <= 1.15e+27: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z) else: tmp = ((b / (c * z)) + (9.0 * ((x * y) / (c * z)))) - (4.0 * (t * (a / c))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -3.2e+44) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(9.0 * Float64(y / Float64(z / x)))) / c); elseif (z <= 1.15e+27) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)); else tmp = Float64(Float64(Float64(b / Float64(c * z)) + Float64(9.0 * Float64(Float64(x * y) / Float64(c * z)))) - Float64(4.0 * Float64(t * Float64(a / c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (z <= -3.2e+44) tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c; elseif (z <= 1.15e+27) tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z); else tmp = ((b / (c * z)) + (9.0 * ((x * y) / (c * z)))) - (4.0 * (t * (a / c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -3.2e+44], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.15e+27], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+44}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+27}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{b}{c \cdot z} + 9 \cdot \frac{x \cdot y}{c \cdot z}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if z < -3.20000000000000004e44Initial program 57.2%
associate-/r*64.9%
Simplified86.9%
Taylor expanded in x around inf 78.0%
associate-/l*85.3%
Simplified85.3%
if -3.20000000000000004e44 < z < 1.15e27Initial program 93.4%
if 1.15e27 < z Initial program 70.6%
associate-*l*70.6%
associate-*l*76.6%
Simplified76.6%
Taylor expanded in x around 0 88.1%
expm1-log1p-u69.9%
expm1-udef54.6%
associate-/l*58.1%
Applied egg-rr58.1%
expm1-def73.3%
expm1-log1p88.2%
associate-/r/88.2%
Simplified88.2%
Final simplification90.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* a -4.0))))
(if (<= z -1.1e+140)
(/ (+ t_1 (* 9.0 (/ y (/ z x)))) c)
(if (<= z 1.9e+144)
(/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* c z))
(/ (+ t_1 (/ b z)) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (a * -4.0);
double tmp;
if (z <= -1.1e+140) {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
} else if (z <= 1.9e+144) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (c * z);
} else {
tmp = (t_1 + (b / z)) / c;
}
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) :: tmp
t_1 = t * (a * (-4.0d0))
if (z <= (-1.1d+140)) then
tmp = (t_1 + (9.0d0 * (y / (z / x)))) / c
else if (z <= 1.9d+144) then
tmp = (b + ((x * (9.0d0 * y)) - ((z * 4.0d0) * (t * a)))) / (c * z)
else
tmp = (t_1 + (b / z)) / c
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 = t * (a * -4.0);
double tmp;
if (z <= -1.1e+140) {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
} else if (z <= 1.9e+144) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (c * z);
} else {
tmp = (t_1 + (b / z)) / c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (a * -4.0) tmp = 0 if z <= -1.1e+140: tmp = (t_1 + (9.0 * (y / (z / x)))) / c elif z <= 1.9e+144: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (c * z) else: tmp = (t_1 + (b / z)) / c return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (z <= -1.1e+140) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(y / Float64(z / x)))) / c); elseif (z <= 1.9e+144) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(c * z)); else tmp = Float64(Float64(t_1 + Float64(b / z)) / c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = t * (a * -4.0); tmp = 0.0; if (z <= -1.1e+140) tmp = (t_1 + (9.0 * (y / (z / x)))) / c; elseif (z <= 1.9e+144) tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (c * z); else tmp = (t_1 + (b / z)) / c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+140], N[(N[(t$95$1 + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.9e+144], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+140}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+144}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if z < -1.0999999999999999e140Initial program 49.3%
associate-/r*60.1%
Simplified83.4%
Taylor expanded in x around inf 77.1%
associate-/l*87.4%
Simplified87.4%
if -1.0999999999999999e140 < z < 1.90000000000000013e144Initial program 90.6%
associate-*l*90.6%
associate-*l*87.7%
Simplified87.7%
if 1.90000000000000013e144 < z Initial program 66.5%
associate-/r*72.2%
Simplified87.5%
Taylor expanded in x around 0 89.6%
Final simplification88.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* a -4.0))))
(if (<= z -3e+44)
(/ (+ t_1 (* 9.0 (/ y (/ z x)))) c)
(if (<= z 9.2e+139)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c z))
(/ (+ t_1 (/ b z)) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (a * -4.0);
double tmp;
if (z <= -3e+44) {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
} else if (z <= 9.2e+139) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
} else {
tmp = (t_1 + (b / z)) / c;
}
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) :: tmp
t_1 = t * (a * (-4.0d0))
if (z <= (-3d+44)) then
tmp = (t_1 + (9.0d0 * (y / (z / x)))) / c
else if (z <= 9.2d+139) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (c * z)
else
tmp = (t_1 + (b / z)) / c
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 = t * (a * -4.0);
double tmp;
if (z <= -3e+44) {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
} else if (z <= 9.2e+139) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
} else {
tmp = (t_1 + (b / z)) / c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (a * -4.0) tmp = 0 if z <= -3e+44: tmp = (t_1 + (9.0 * (y / (z / x)))) / c elif z <= 9.2e+139: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z) else: tmp = (t_1 + (b / z)) / c return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (z <= -3e+44) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(y / Float64(z / x)))) / c); elseif (z <= 9.2e+139) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)); else tmp = Float64(Float64(t_1 + Float64(b / z)) / c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = t * (a * -4.0); tmp = 0.0; if (z <= -3e+44) tmp = (t_1 + (9.0 * (y / (z / x)))) / c; elseif (z <= 9.2e+139) tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z); else tmp = (t_1 + (b / z)) / c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e+44], N[(N[(t$95$1 + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 9.2e+139], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;z \leq -3 \cdot 10^{+44}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+139}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if z < -2.99999999999999987e44Initial program 57.2%
associate-/r*64.9%
Simplified86.9%
Taylor expanded in x around inf 78.0%
associate-/l*85.3%
Simplified85.3%
if -2.99999999999999987e44 < z < 9.2e139Initial program 92.6%
if 9.2e139 < z Initial program 66.5%
associate-/r*72.2%
Simplified87.5%
Taylor expanded in x around 0 89.6%
Final simplification90.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* a -4.0))))
(if (<= z -3.6e+49)
(/ (+ t_1 (* 9.0 (/ y (/ z x)))) c)
(if (<= z -1.65e-146)
(/ (- b (* 4.0 (* a (* t z)))) (* c z))
(if (<= z 9.5e+53)
(/ (+ b (* 9.0 (* x y))) (* c z))
(/ (+ t_1 (/ b z)) c))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (a * -4.0);
double tmp;
if (z <= -3.6e+49) {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
} else if (z <= -1.65e-146) {
tmp = (b - (4.0 * (a * (t * z)))) / (c * z);
} else if (z <= 9.5e+53) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else {
tmp = (t_1 + (b / z)) / c;
}
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) :: tmp
t_1 = t * (a * (-4.0d0))
if (z <= (-3.6d+49)) then
tmp = (t_1 + (9.0d0 * (y / (z / x)))) / c
else if (z <= (-1.65d-146)) then
tmp = (b - (4.0d0 * (a * (t * z)))) / (c * z)
else if (z <= 9.5d+53) then
tmp = (b + (9.0d0 * (x * y))) / (c * z)
else
tmp = (t_1 + (b / z)) / c
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 = t * (a * -4.0);
double tmp;
if (z <= -3.6e+49) {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
} else if (z <= -1.65e-146) {
tmp = (b - (4.0 * (a * (t * z)))) / (c * z);
} else if (z <= 9.5e+53) {
tmp = (b + (9.0 * (x * y))) / (c * z);
} else {
tmp = (t_1 + (b / z)) / c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (a * -4.0) tmp = 0 if z <= -3.6e+49: tmp = (t_1 + (9.0 * (y / (z / x)))) / c elif z <= -1.65e-146: tmp = (b - (4.0 * (a * (t * z)))) / (c * z) elif z <= 9.5e+53: tmp = (b + (9.0 * (x * y))) / (c * z) else: tmp = (t_1 + (b / z)) / c return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (z <= -3.6e+49) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(y / Float64(z / x)))) / c); elseif (z <= -1.65e-146) tmp = Float64(Float64(b - Float64(4.0 * Float64(a * Float64(t * z)))) / Float64(c * z)); elseif (z <= 9.5e+53) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c * z)); else tmp = Float64(Float64(t_1 + Float64(b / z)) / c); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = t * (a * -4.0); tmp = 0.0; if (z <= -3.6e+49) tmp = (t_1 + (9.0 * (y / (z / x)))) / c; elseif (z <= -1.65e-146) tmp = (b - (4.0 * (a * (t * z)))) / (c * z); elseif (z <= 9.5e+53) tmp = (b + (9.0 * (x * y))) / (c * z); else tmp = (t_1 + (b / z)) / c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e+49], N[(N[(t$95$1 + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, -1.65e-146], N[(N[(b - N[(4.0 * N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+53], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+49}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-146}:\\
\;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+53}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if z < -3.59999999999999996e49Initial program 57.4%
associate-/r*65.3%
Simplified86.5%
Taylor expanded in x around inf 78.8%
associate-/l*86.3%
Simplified86.3%
if -3.59999999999999996e49 < z < -1.65e-146Initial program 87.8%
associate-*l*87.8%
associate-*l*85.6%
Simplified85.6%
Taylor expanded in x around 0 80.6%
if -1.65e-146 < z < 9.5000000000000006e53Initial program 94.9%
associate-/r*85.6%
Simplified85.5%
Taylor expanded in z around 0 77.9%
if 9.5000000000000006e53 < z Initial program 68.8%
associate-/r*75.3%
Simplified89.8%
Taylor expanded in x around 0 87.4%
Final simplification82.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= t -3.6e+56) (not (<= t 9.8e-49))) (* -4.0 (/ a (/ c t))) (/ (+ b (* 9.0 (* x y))) (* c z))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -3.6e+56) || !(t <= 9.8e-49)) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = (b + (9.0 * (x * y))) / (c * z);
}
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) :: tmp
if ((t <= (-3.6d+56)) .or. (.not. (t <= 9.8d-49))) then
tmp = (-4.0d0) * (a / (c / t))
else
tmp = (b + (9.0d0 * (x * y))) / (c * z)
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 tmp;
if ((t <= -3.6e+56) || !(t <= 9.8e-49)) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = (b + (9.0 * (x * y))) / (c * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -3.6e+56) or not (t <= 9.8e-49): tmp = -4.0 * (a / (c / t)) else: tmp = (b + (9.0 * (x * y))) / (c * z) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -3.6e+56) || !(t <= 9.8e-49)) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((t <= -3.6e+56) || ~((t <= 9.8e-49))) tmp = -4.0 * (a / (c / t)); else tmp = (b + (9.0 * (x * y))) / (c * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -3.6e+56], N[Not[LessEqual[t, 9.8e-49]], $MachinePrecision]], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+56} \lor \neg \left(t \leq 9.8 \cdot 10^{-49}\right):\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
\end{array}
\end{array}
if t < -3.59999999999999998e56 or 9.8000000000000005e-49 < t Initial program 75.6%
associate-/r*71.0%
Simplified81.0%
Taylor expanded in t around inf 53.1%
associate-/l*59.2%
Simplified59.2%
if -3.59999999999999998e56 < t < 9.8000000000000005e-49Initial program 84.2%
associate-/r*86.4%
Simplified92.0%
Taylor expanded in z around 0 71.9%
Final simplification65.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -1.1e-138) (not (<= z 8.5e+53))) (/ (+ (* t (* a -4.0)) (/ b z)) c) (/ (+ b (* 9.0 (* x y))) (* c z))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.1e-138) || !(z <= 8.5e+53)) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else {
tmp = (b + (9.0 * (x * y))) / (c * z);
}
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) :: tmp
if ((z <= (-1.1d-138)) .or. (.not. (z <= 8.5d+53))) then
tmp = ((t * (a * (-4.0d0))) + (b / z)) / c
else
tmp = (b + (9.0d0 * (x * y))) / (c * z)
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 tmp;
if ((z <= -1.1e-138) || !(z <= 8.5e+53)) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else {
tmp = (b + (9.0 * (x * y))) / (c * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1.1e-138) or not (z <= 8.5e+53): tmp = ((t * (a * -4.0)) + (b / z)) / c else: tmp = (b + (9.0 * (x * y))) / (c * z) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1.1e-138) || !(z <= 8.5e+53)) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(b / z)) / c); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((z <= -1.1e-138) || ~((z <= 8.5e+53))) tmp = ((t * (a * -4.0)) + (b / z)) / c; else tmp = (b + (9.0 * (x * y))) / (c * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1.1e-138], N[Not[LessEqual[z, 8.5e+53]], $MachinePrecision]], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-138} \lor \neg \left(z \leq 8.5 \cdot 10^{+53}\right):\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -1.0999999999999999e-138 or 8.5000000000000002e53 < z Initial program 68.6%
associate-/r*72.8%
Simplified87.1%
Taylor expanded in x around 0 78.3%
if -1.0999999999999999e-138 < z < 8.5000000000000002e53Initial program 95.0%
associate-/r*85.8%
Simplified84.8%
Taylor expanded in z around 0 77.3%
Final simplification77.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= t -4.1e+55) (not (<= t 3.3e-93))) (* -4.0 (/ a (/ c t))) (/ b (* c z))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -4.1e+55) || !(t <= 3.3e-93)) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = b / (c * z);
}
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) :: tmp
if ((t <= (-4.1d+55)) .or. (.not. (t <= 3.3d-93))) then
tmp = (-4.0d0) * (a / (c / t))
else
tmp = b / (c * z)
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 tmp;
if ((t <= -4.1e+55) || !(t <= 3.3e-93)) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = b / (c * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -4.1e+55) or not (t <= 3.3e-93): tmp = -4.0 * (a / (c / t)) else: tmp = b / (c * z) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -4.1e+55) || !(t <= 3.3e-93)) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); else tmp = Float64(b / Float64(c * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((t <= -4.1e+55) || ~((t <= 3.3e-93))) tmp = -4.0 * (a / (c / t)); else tmp = b / (c * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -4.1e+55], N[Not[LessEqual[t, 3.3e-93]], $MachinePrecision]], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+55} \lor \neg \left(t \leq 3.3 \cdot 10^{-93}\right):\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\end{array}
\end{array}
if t < -4.09999999999999981e55 or 3.3000000000000001e-93 < t Initial program 75.7%
associate-/r*71.8%
Simplified81.3%
Taylor expanded in t around inf 52.6%
associate-/l*58.5%
Simplified58.5%
if -4.09999999999999981e55 < t < 3.3000000000000001e-93Initial program 84.6%
associate-/r*86.4%
Simplified92.3%
Taylor expanded in b around inf 50.8%
*-commutative50.8%
Simplified50.8%
Final simplification55.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= t -6e+56) (not (<= t 5.8e-93))) (* -4.0 (/ a (/ c t))) (* b (/ 1.0 (* c z)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -6e+56) || !(t <= 5.8e-93)) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = b * (1.0 / (c * z));
}
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) :: tmp
if ((t <= (-6d+56)) .or. (.not. (t <= 5.8d-93))) then
tmp = (-4.0d0) * (a / (c / t))
else
tmp = b * (1.0d0 / (c * z))
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 tmp;
if ((t <= -6e+56) || !(t <= 5.8e-93)) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = b * (1.0 / (c * z));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -6e+56) or not (t <= 5.8e-93): tmp = -4.0 * (a / (c / t)) else: tmp = b * (1.0 / (c * z)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -6e+56) || !(t <= 5.8e-93)) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); else tmp = Float64(b * Float64(1.0 / Float64(c * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((t <= -6e+56) || ~((t <= 5.8e-93))) tmp = -4.0 * (a / (c / t)); else tmp = b * (1.0 / (c * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -6e+56], N[Not[LessEqual[t, 5.8e-93]], $MachinePrecision]], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+56} \lor \neg \left(t \leq 5.8 \cdot 10^{-93}\right):\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{1}{c \cdot z}\\
\end{array}
\end{array}
if t < -6.00000000000000012e56 or 5.7999999999999997e-93 < t Initial program 75.7%
associate-/r*71.8%
Simplified81.3%
Taylor expanded in t around inf 52.6%
associate-/l*58.5%
Simplified58.5%
if -6.00000000000000012e56 < t < 5.7999999999999997e-93Initial program 84.6%
associate-/r*86.4%
Simplified92.3%
Taylor expanded in b around inf 50.8%
*-commutative50.8%
Simplified50.8%
*-commutative50.8%
div-inv51.6%
Applied egg-rr51.6%
Final simplification55.5%
(FPCore (x y z t a b c) :precision binary64 (/ b (* c z)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
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
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
def code(x, y, z, t, a, b, c): return b / (c * z)
function code(x, y, z, t, a, b, c) return Float64(b / Float64(c * z)) end
function tmp = code(x, y, z, t, a, b, c) tmp = b / (c * z); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{b}{c \cdot z}
\end{array}
Initial program 79.6%
associate-/r*78.2%
Simplified86.2%
Taylor expanded in b around inf 36.4%
*-commutative36.4%
Simplified36.4%
Final simplification36.4%
(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 2023178
(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)))