
(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: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -3.3e+56) (not (<= z 3.4e+89))) (/ (- (/ (- b (* y (* x -9.0))) z) (* 4.0 (* a t))) c) (/ (+ b (fma x (* y 9.0) (* t (* a (* z -4.0))))) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -3.3e+56) || !(z <= 3.4e+89)) {
tmp = (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c;
} else {
tmp = (b + fma(x, (y * 9.0), (t * (a * (z * -4.0))))) / (z * c);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -3.3e+56) || !(z <= 3.4e+89)) tmp = Float64(Float64(Float64(Float64(b - Float64(y * Float64(x * -9.0))) / z) - Float64(4.0 * Float64(a * t))) / c); else tmp = Float64(Float64(b + fma(x, Float64(y * 9.0), Float64(t * Float64(a * Float64(z * -4.0))))) / Float64(z * c)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -3.3e+56], N[Not[LessEqual[z, 3.4e+89]], $MachinePrecision]], N[(N[(N[(N[(b - N[(y * N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision] + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+56} \lor \neg \left(z \leq 3.4 \cdot 10^{+89}\right):\\
\;\;\;\;\frac{\frac{b - y \cdot \left(x \cdot -9\right)}{z} - 4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \mathsf{fma}\left(x, y \cdot 9, t \cdot \left(a \cdot \left(z \cdot -4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -3.30000000000000002e56 or 3.4000000000000002e89 < z Initial program 52.8%
+-commutative52.8%
associate-+r-52.8%
*-commutative52.8%
associate-*r*58.1%
*-commutative58.1%
associate-+r-58.1%
+-commutative58.1%
associate-*l*58.1%
associate-*l*60.8%
*-commutative60.8%
Simplified60.8%
Taylor expanded in x around 0 84.7%
Taylor expanded in c around 0 90.1%
Taylor expanded in c around 0 91.1%
Taylor expanded in z around -inf 91.1%
mul-1-neg91.1%
distribute-neg-frac291.1%
mul-1-neg91.1%
unsub-neg91.1%
*-commutative91.1%
*-commutative91.1%
associate-*l*91.1%
Simplified91.1%
if -3.30000000000000002e56 < z < 3.4000000000000002e89Initial program 93.9%
Simplified93.9%
Final simplification92.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -5e-49) (not (<= z 8.8e-33))) (/ (- (/ (- b (* y (* x -9.0))) z) (* 4.0 (* a t))) c) (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -5e-49) || !(z <= 8.8e-33)) {
tmp = (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c;
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c 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 <= (-5d-49)) .or. (.not. (z <= 8.8d-33))) then
tmp = (((b - (y * (x * (-9.0d0)))) / z) - (4.0d0 * (a * t))) / c
else
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -5e-49) || !(z <= 8.8e-33)) {
tmp = (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c;
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -5e-49) or not (z <= 8.8e-33): tmp = (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c else: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -5e-49) || !(z <= 8.8e-33)) tmp = Float64(Float64(Float64(Float64(b - Float64(y * Float64(x * -9.0))) / z) - Float64(4.0 * Float64(a * t))) / c); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -5e-49) || ~((z <= 8.8e-33)))
tmp = (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c;
else
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -5e-49], N[Not[LessEqual[z, 8.8e-33]], $MachinePrecision]], N[(N[(N[(N[(b - N[(y * N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - N[(4.0 * N[(a * t), $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[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-49} \lor \neg \left(z \leq 8.8 \cdot 10^{-33}\right):\\
\;\;\;\;\frac{\frac{b - y \cdot \left(x \cdot -9\right)}{z} - 4 \cdot \left(a \cdot t\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)}{z \cdot c}\\
\end{array}
\end{array}
if z < -4.9999999999999999e-49 or 8.80000000000000022e-33 < z Initial program 64.3%
+-commutative64.3%
associate-+r-64.3%
*-commutative64.3%
associate-*r*67.3%
*-commutative67.3%
associate-+r-67.3%
+-commutative67.3%
associate-*l*67.3%
associate-*l*69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in x around 0 85.4%
Taylor expanded in c around 0 89.7%
Taylor expanded in c around 0 90.4%
Taylor expanded in z around -inf 90.3%
mul-1-neg90.3%
distribute-neg-frac290.3%
mul-1-neg90.3%
unsub-neg90.3%
*-commutative90.3%
*-commutative90.3%
associate-*l*90.3%
Simplified90.3%
if -4.9999999999999999e-49 < z < 8.80000000000000022e-33Initial program 96.8%
Final simplification92.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -1.65e+59) (not (<= z 1e-33))) (/ (- (/ (- b (* y (* x -9.0))) z) (* 4.0 (* a t))) c) (/ (+ b (- (* x (* y 9.0)) (* (* a t) (* z 4.0)))) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.65e+59) || !(z <= 1e-33)) {
tmp = (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c;
} else {
tmp = (b + ((x * (y * 9.0)) - ((a * t) * (z * 4.0)))) / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c 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.65d+59)) .or. (.not. (z <= 1d-33))) then
tmp = (((b - (y * (x * (-9.0d0)))) / z) - (4.0d0 * (a * t))) / c
else
tmp = (b + ((x * (y * 9.0d0)) - ((a * t) * (z * 4.0d0)))) / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.65e+59) || !(z <= 1e-33)) {
tmp = (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c;
} else {
tmp = (b + ((x * (y * 9.0)) - ((a * t) * (z * 4.0)))) / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1.65e+59) or not (z <= 1e-33): tmp = (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c else: tmp = (b + ((x * (y * 9.0)) - ((a * t) * (z * 4.0)))) / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1.65e+59) || !(z <= 1e-33)) tmp = Float64(Float64(Float64(Float64(b - Float64(y * Float64(x * -9.0))) / z) - Float64(4.0 * Float64(a * t))) / c); else tmp = Float64(Float64(b + Float64(Float64(x * Float64(y * 9.0)) - Float64(Float64(a * t) * Float64(z * 4.0)))) / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -1.65e+59) || ~((z <= 1e-33)))
tmp = (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c;
else
tmp = (b + ((x * (y * 9.0)) - ((a * t) * (z * 4.0)))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1.65e+59], N[Not[LessEqual[z, 1e-33]], $MachinePrecision]], N[(N[(N[(N[(b - N[(y * N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * t), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+59} \lor \neg \left(z \leq 10^{-33}\right):\\
\;\;\;\;\frac{\frac{b - y \cdot \left(x \cdot -9\right)}{z} - 4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(y \cdot 9\right) - \left(a \cdot t\right) \cdot \left(z \cdot 4\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -1.65e59 or 1.0000000000000001e-33 < z Initial program 60.2%
+-commutative60.2%
associate-+r-60.2%
*-commutative60.2%
associate-*r*63.0%
*-commutative63.0%
associate-+r-63.0%
+-commutative63.0%
associate-*l*63.0%
associate-*l*65.9%
*-commutative65.9%
Simplified65.9%
Taylor expanded in x around 0 84.3%
Taylor expanded in c around 0 89.4%
Taylor expanded in c around 0 90.1%
Taylor expanded in z around -inf 90.1%
mul-1-neg90.1%
distribute-neg-frac290.1%
mul-1-neg90.1%
unsub-neg90.1%
*-commutative90.1%
*-commutative90.1%
associate-*l*90.1%
Simplified90.1%
if -1.65e59 < z < 1.0000000000000001e-33Initial program 95.0%
+-commutative95.0%
associate-+r-95.0%
*-commutative95.0%
associate-*r*95.0%
*-commutative95.0%
associate-+r-95.0%
+-commutative95.0%
associate-*l*95.0%
associate-*l*92.5%
*-commutative92.5%
Simplified92.5%
Final simplification91.2%
NOTE: x, y, z, t, a, b, and c 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))))
(if (<= z -1e-48)
(/ (- (/ (- b (* y (* x -9.0))) z) t_1) c)
(if (<= z 9e-33)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))
(/ (- (+ (* 9.0 (/ (* y x) z)) (/ b z)) t_1) c)))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 4.0 * (a * t);
double tmp;
if (z <= -1e-48) {
tmp = (((b - (y * (x * -9.0))) / z) - t_1) / c;
} else if (z <= 9e-33) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = (((9.0 * ((y * x) / z)) + (b / z)) - t_1) / c;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 4.0d0 * (a * t)
if (z <= (-1d-48)) then
tmp = (((b - (y * (x * (-9.0d0)))) / z) - t_1) / c
else if (z <= 9d-33) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (z * c)
else
tmp = (((9.0d0 * ((y * x) / z)) + (b / z)) - t_1) / c
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 tmp;
if (z <= -1e-48) {
tmp = (((b - (y * (x * -9.0))) / z) - t_1) / c;
} else if (z <= 9e-33) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = (((9.0 * ((y * x) / z)) + (b / z)) - t_1) / c;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = 4.0 * (a * t) tmp = 0 if z <= -1e-48: tmp = (((b - (y * (x * -9.0))) / z) - t_1) / c elif z <= 9e-33: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c) else: tmp = (((9.0 * ((y * x) / z)) + (b / z)) - t_1) / c return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(4.0 * Float64(a * t)) tmp = 0.0 if (z <= -1e-48) tmp = Float64(Float64(Float64(Float64(b - Float64(y * Float64(x * -9.0))) / z) - t_1) / c); elseif (z <= 9e-33) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(Float64(Float64(Float64(9.0 * Float64(Float64(y * x) / z)) + Float64(b / z)) - t_1) / c); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 4.0 * (a * t);
tmp = 0.0;
if (z <= -1e-48)
tmp = (((b - (y * (x * -9.0))) / z) - t_1) / c;
elseif (z <= 9e-33)
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
else
tmp = (((9.0 * ((y * x) / z)) + (b / z)) - t_1) / c;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c 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]}, If[LessEqual[z, -1e-48], N[(N[(N[(N[(b - N[(y * N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - t$95$1), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 9e-33], 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[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;z \leq -1 \cdot 10^{-48}:\\
\;\;\;\;\frac{\frac{b - y \cdot \left(x \cdot -9\right)}{z} - t\_1}{c}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-33}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(9 \cdot \frac{y \cdot x}{z} + \frac{b}{z}\right) - t\_1}{c}\\
\end{array}
\end{array}
if z < -9.9999999999999997e-49Initial program 67.3%
+-commutative67.3%
associate-+r-67.3%
*-commutative67.3%
associate-*r*69.9%
*-commutative69.9%
associate-+r-69.9%
+-commutative69.9%
associate-*l*69.9%
associate-*l*73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in x around 0 88.0%
Taylor expanded in c around 0 90.7%
Taylor expanded in c around 0 92.0%
Taylor expanded in z around -inf 92.0%
mul-1-neg92.0%
distribute-neg-frac292.0%
mul-1-neg92.0%
unsub-neg92.0%
*-commutative92.0%
*-commutative92.0%
associate-*l*92.0%
Simplified92.0%
if -9.9999999999999997e-49 < z < 8.99999999999999982e-33Initial program 96.8%
if 8.99999999999999982e-33 < z Initial program 61.7%
+-commutative61.7%
associate-+r-61.7%
*-commutative61.7%
associate-*r*65.0%
*-commutative65.0%
associate-+r-65.0%
+-commutative65.0%
associate-*l*65.0%
associate-*l*66.2%
*-commutative66.2%
Simplified66.2%
Taylor expanded in x around 0 83.2%
Taylor expanded in c around 0 88.9%
Taylor expanded in c around 0 88.9%
Final simplification92.8%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* z c))))
(if (<= t -0.62)
(* a (/ (* t -4.0) c))
(if (<= t -4.9e-40)
t_1
(if (<= t -2.1e-258)
(* (/ (* x 9.0) c) (/ y z))
(if (<= t 2.65e-98) t_1 (* a (* t (/ -4.0 c)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (z * c);
double tmp;
if (t <= -0.62) {
tmp = a * ((t * -4.0) / c);
} else if (t <= -4.9e-40) {
tmp = t_1;
} else if (t <= -2.1e-258) {
tmp = ((x * 9.0) / c) * (y / z);
} else if (t <= 2.65e-98) {
tmp = t_1;
} else {
tmp = a * (t * (-4.0 / c));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = b / (z * c)
if (t <= (-0.62d0)) then
tmp = a * ((t * (-4.0d0)) / c)
else if (t <= (-4.9d-40)) then
tmp = t_1
else if (t <= (-2.1d-258)) then
tmp = ((x * 9.0d0) / c) * (y / z)
else if (t <= 2.65d-98) then
tmp = t_1
else
tmp = a * (t * ((-4.0d0) / c))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (z * c);
double tmp;
if (t <= -0.62) {
tmp = a * ((t * -4.0) / c);
} else if (t <= -4.9e-40) {
tmp = t_1;
} else if (t <= -2.1e-258) {
tmp = ((x * 9.0) / c) * (y / z);
} else if (t <= 2.65e-98) {
tmp = t_1;
} else {
tmp = a * (t * (-4.0 / c));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = b / (z * c) tmp = 0 if t <= -0.62: tmp = a * ((t * -4.0) / c) elif t <= -4.9e-40: tmp = t_1 elif t <= -2.1e-258: tmp = ((x * 9.0) / c) * (y / z) elif t <= 2.65e-98: tmp = t_1 else: tmp = a * (t * (-4.0 / c)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(z * c)) tmp = 0.0 if (t <= -0.62) tmp = Float64(a * Float64(Float64(t * -4.0) / c)); elseif (t <= -4.9e-40) tmp = t_1; elseif (t <= -2.1e-258) tmp = Float64(Float64(Float64(x * 9.0) / c) * Float64(y / z)); elseif (t <= 2.65e-98) tmp = t_1; else tmp = Float64(a * Float64(t * Float64(-4.0 / c))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = b / (z * c);
tmp = 0.0;
if (t <= -0.62)
tmp = a * ((t * -4.0) / c);
elseif (t <= -4.9e-40)
tmp = t_1;
elseif (t <= -2.1e-258)
tmp = ((x * 9.0) / c) * (y / z);
elseif (t <= 2.65e-98)
tmp = t_1;
else
tmp = a * (t * (-4.0 / c));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -0.62], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.9e-40], t$95$1, If[LessEqual[t, -2.1e-258], N[(N[(N[(x * 9.0), $MachinePrecision] / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.65e-98], t$95$1, N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{b}{z \cdot c}\\
\mathbf{if}\;t \leq -0.62:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c}\\
\mathbf{elif}\;t \leq -4.9 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-258}:\\
\;\;\;\;\frac{x \cdot 9}{c} \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\
\end{array}
\end{array}
if t < -0.619999999999999996Initial program 62.5%
+-commutative62.5%
associate-+r-62.5%
*-commutative62.5%
associate-*r*66.9%
*-commutative66.9%
associate-+r-66.9%
+-commutative66.9%
associate-*l*66.9%
associate-*l*64.0%
*-commutative64.0%
Simplified64.0%
Taylor expanded in z around inf 56.9%
associate-/l*63.7%
associate-*r*63.7%
*-commutative63.7%
associate-*r*63.7%
*-commutative63.7%
associate-*l/63.7%
Simplified63.7%
if -0.619999999999999996 < t < -4.8999999999999997e-40 or -2.0999999999999999e-258 < t < 2.65000000000000015e-98Initial program 93.3%
+-commutative93.3%
associate-+r-93.3%
*-commutative93.3%
associate-*r*89.6%
*-commutative89.6%
associate-+r-89.6%
+-commutative89.6%
associate-*l*89.7%
associate-*l*93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in b around inf 59.0%
*-commutative59.0%
Simplified59.0%
if -4.8999999999999997e-40 < t < -2.0999999999999999e-258Initial program 86.1%
+-commutative86.1%
associate-+r-86.1%
*-commutative86.1%
associate-*r*81.8%
*-commutative81.8%
associate-+r-81.8%
+-commutative81.8%
associate-*l*81.8%
associate-*l*85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in x around inf 41.4%
associate-/l*43.4%
associate-/r*48.7%
Simplified48.7%
associate-/l/43.4%
*-commutative43.4%
associate-/l*41.4%
associate-*r/41.4%
Applied egg-rr41.4%
associate-*r*41.4%
times-frac39.3%
Applied egg-rr39.3%
if 2.65000000000000015e-98 < t Initial program 72.1%
+-commutative72.1%
associate-+r-72.1%
*-commutative72.1%
associate-*r*77.4%
*-commutative77.4%
associate-+r-77.4%
+-commutative77.4%
associate-*l*77.3%
associate-*l*76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in x around 0 79.3%
Taylor expanded in c around 0 85.9%
Taylor expanded in z around inf 52.6%
associate-*r/52.6%
*-commutative52.6%
associate-*r*52.6%
associate-/l*56.4%
associate-*r/56.3%
Simplified56.3%
Final simplification55.8%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= b -2.3e-44)
(/ (- (/ b z) (* 4.0 (* a t))) c)
(if (<= b 3.7e-29)
(- (* 9.0 (/ (* y x) (* z c))) (* 4.0 (/ (* a t) c)))
(* b (+ (* -4.0 (/ (* a t) (* b c))) (/ 1.0 (* z c)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -2.3e-44) {
tmp = ((b / z) - (4.0 * (a * t))) / c;
} else if (b <= 3.7e-29) {
tmp = (9.0 * ((y * x) / (z * c))) - (4.0 * ((a * t) / c));
} else {
tmp = b * ((-4.0 * ((a * t) / (b * c))) + (1.0 / (z * c)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-2.3d-44)) then
tmp = ((b / z) - (4.0d0 * (a * t))) / c
else if (b <= 3.7d-29) then
tmp = (9.0d0 * ((y * x) / (z * c))) - (4.0d0 * ((a * t) / c))
else
tmp = b * (((-4.0d0) * ((a * t) / (b * c))) + (1.0d0 / (z * c)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -2.3e-44) {
tmp = ((b / z) - (4.0 * (a * t))) / c;
} else if (b <= 3.7e-29) {
tmp = (9.0 * ((y * x) / (z * c))) - (4.0 * ((a * t) / c));
} else {
tmp = b * ((-4.0 * ((a * t) / (b * c))) + (1.0 / (z * c)));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -2.3e-44: tmp = ((b / z) - (4.0 * (a * t))) / c elif b <= 3.7e-29: tmp = (9.0 * ((y * x) / (z * c))) - (4.0 * ((a * t) / c)) else: tmp = b * ((-4.0 * ((a * t) / (b * c))) + (1.0 / (z * c))) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -2.3e-44) tmp = Float64(Float64(Float64(b / z) - Float64(4.0 * Float64(a * t))) / c); elseif (b <= 3.7e-29) tmp = Float64(Float64(9.0 * Float64(Float64(y * x) / Float64(z * c))) - Float64(4.0 * Float64(Float64(a * t) / c))); else tmp = Float64(b * Float64(Float64(-4.0 * Float64(Float64(a * t) / Float64(b * c))) + Float64(1.0 / Float64(z * c)))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -2.3e-44)
tmp = ((b / z) - (4.0 * (a * t))) / c;
elseif (b <= 3.7e-29)
tmp = (9.0 * ((y * x) / (z * c))) - (4.0 * ((a * t) / c));
else
tmp = b * ((-4.0 * ((a * t) / (b * c))) + (1.0 / (z * c)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -2.3e-44], N[(N[(N[(b / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 3.7e-29], N[(N[(9.0 * N[(N[(y * x), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(-4.0 * N[(N[(a * t), $MachinePrecision] / N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{b}{z} - 4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{elif}\;b \leq 3.7 \cdot 10^{-29}:\\
\;\;\;\;9 \cdot \frac{y \cdot x}{z \cdot c} - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(-4 \cdot \frac{a \cdot t}{b \cdot c} + \frac{1}{z \cdot c}\right)\\
\end{array}
\end{array}
if b < -2.29999999999999998e-44Initial program 72.7%
+-commutative72.7%
associate-+r-72.7%
*-commutative72.7%
associate-*r*70.2%
*-commutative70.2%
associate-+r-70.2%
+-commutative70.2%
associate-*l*70.2%
associate-*l*75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in x around 0 82.8%
Taylor expanded in c around 0 83.7%
Taylor expanded in c around 0 85.0%
Taylor expanded in x around 0 79.5%
if -2.29999999999999998e-44 < b < 3.6999999999999997e-29Initial program 79.8%
+-commutative79.8%
associate-+r-79.8%
*-commutative79.8%
associate-*r*81.4%
*-commutative81.4%
associate-+r-81.4%
+-commutative81.4%
associate-*l*81.4%
associate-*l*80.6%
*-commutative80.6%
Simplified80.6%
Taylor expanded in x around 0 87.6%
Taylor expanded in x around inf 84.1%
if 3.6999999999999997e-29 < b Initial program 74.9%
+-commutative74.9%
associate-+r-74.9%
*-commutative74.9%
associate-*r*80.8%
*-commutative80.8%
associate-+r-80.8%
+-commutative80.8%
associate-*l*80.8%
associate-*l*77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in x around 0 64.5%
*-commutative64.5%
*-commutative64.5%
associate-*l*67.6%
*-commutative67.6%
associate-*r*67.6%
associate-*l*67.6%
Simplified67.6%
Taylor expanded in b around inf 70.0%
Final simplification79.0%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= t -0.000175) (not (<= t 1.22e-73))) (/ (- (/ b z) (* 4.0 (* a t))) c) (/ (+ b (* y (* x 9.0))) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -0.000175) || !(t <= 1.22e-73)) {
tmp = ((b / z) - (4.0 * (a * t))) / c;
} else {
tmp = (b + (y * (x * 9.0))) / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((t <= (-0.000175d0)) .or. (.not. (t <= 1.22d-73))) then
tmp = ((b / z) - (4.0d0 * (a * t))) / c
else
tmp = (b + (y * (x * 9.0d0))) / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -0.000175) || !(t <= 1.22e-73)) {
tmp = ((b / z) - (4.0 * (a * t))) / c;
} else {
tmp = (b + (y * (x * 9.0))) / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -0.000175) or not (t <= 1.22e-73): tmp = ((b / z) - (4.0 * (a * t))) / c else: tmp = (b + (y * (x * 9.0))) / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -0.000175) || !(t <= 1.22e-73)) tmp = Float64(Float64(Float64(b / z) - Float64(4.0 * Float64(a * t))) / c); else tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((t <= -0.000175) || ~((t <= 1.22e-73)))
tmp = ((b / z) - (4.0 * (a * t))) / c;
else
tmp = (b + (y * (x * 9.0))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -0.000175], N[Not[LessEqual[t, 1.22e-73]], $MachinePrecision]], N[(N[(N[(b / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.000175 \lor \neg \left(t \leq 1.22 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{\frac{b}{z} - 4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{z \cdot c}\\
\end{array}
\end{array}
if t < -1.74999999999999998e-4 or 1.22e-73 < t Initial program 66.9%
+-commutative66.9%
associate-+r-66.9%
*-commutative66.9%
associate-*r*72.1%
*-commutative72.1%
associate-+r-72.1%
+-commutative72.1%
associate-*l*72.1%
associate-*l*70.1%
*-commutative70.1%
Simplified70.1%
Taylor expanded in x around 0 77.1%
Taylor expanded in c around 0 80.6%
Taylor expanded in c around 0 82.6%
Taylor expanded in x around 0 72.3%
if -1.74999999999999998e-4 < t < 1.22e-73Initial program 89.7%
+-commutative89.7%
associate-+r-89.7%
*-commutative89.7%
associate-*r*86.1%
*-commutative86.1%
associate-+r-86.1%
+-commutative86.1%
associate-*l*86.1%
associate-*l*89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in x around 0 88.6%
Taylor expanded in c around 0 88.9%
Taylor expanded in c around 0 88.9%
Taylor expanded in z around 0 79.8%
associate-*r*79.8%
*-commutative79.8%
*-commutative79.8%
Simplified79.8%
Final simplification75.4%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -5.8)
(- (/ (/ b c) z) (* 4.0 (/ (* a t) c)))
(if (<= t 1e-73)
(/ (+ b (* y (* x 9.0))) (* z c))
(/ (- (/ b z) (* 4.0 (* a t))) c))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -5.8) {
tmp = ((b / c) / z) - (4.0 * ((a * t) / c));
} else if (t <= 1e-73) {
tmp = (b + (y * (x * 9.0))) / (z * c);
} else {
tmp = ((b / z) - (4.0 * (a * t))) / c;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (t <= (-5.8d0)) then
tmp = ((b / c) / z) - (4.0d0 * ((a * t) / c))
else if (t <= 1d-73) then
tmp = (b + (y * (x * 9.0d0))) / (z * c)
else
tmp = ((b / z) - (4.0d0 * (a * t))) / c
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -5.8) {
tmp = ((b / c) / z) - (4.0 * ((a * t) / c));
} else if (t <= 1e-73) {
tmp = (b + (y * (x * 9.0))) / (z * c);
} else {
tmp = ((b / z) - (4.0 * (a * t))) / c;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -5.8: tmp = ((b / c) / z) - (4.0 * ((a * t) / c)) elif t <= 1e-73: tmp = (b + (y * (x * 9.0))) / (z * c) else: tmp = ((b / z) - (4.0 * (a * t))) / c return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -5.8) tmp = Float64(Float64(Float64(b / c) / z) - Float64(4.0 * Float64(Float64(a * t) / c))); elseif (t <= 1e-73) tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(z * c)); else tmp = Float64(Float64(Float64(b / z) - Float64(4.0 * Float64(a * t))) / c); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -5.8)
tmp = ((b / c) / z) - (4.0 * ((a * t) / c));
elseif (t <= 1e-73)
tmp = (b + (y * (x * 9.0))) / (z * c);
else
tmp = ((b / z) - (4.0 * (a * t))) / c;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -5.8], N[(N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-73], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8:\\
\;\;\;\;\frac{\frac{b}{c}}{z} - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{elif}\;t \leq 10^{-73}:\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} - 4 \cdot \left(a \cdot t\right)}{c}\\
\end{array}
\end{array}
if t < -5.79999999999999982Initial program 62.5%
+-commutative62.5%
associate-+r-62.5%
*-commutative62.5%
associate-*r*66.9%
*-commutative66.9%
associate-+r-66.9%
+-commutative66.9%
associate-*l*66.9%
associate-*l*64.0%
*-commutative64.0%
Simplified64.0%
Taylor expanded in x around 0 76.8%
Taylor expanded in x around 0 70.1%
associate-/r*71.6%
Simplified71.6%
if -5.79999999999999982 < t < 9.99999999999999997e-74Initial program 89.7%
+-commutative89.7%
associate-+r-89.7%
*-commutative89.7%
associate-*r*86.1%
*-commutative86.1%
associate-+r-86.1%
+-commutative86.1%
associate-*l*86.1%
associate-*l*89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in x around 0 88.6%
Taylor expanded in c around 0 88.9%
Taylor expanded in c around 0 88.9%
Taylor expanded in z around 0 79.8%
associate-*r*79.8%
*-commutative79.8%
*-commutative79.8%
Simplified79.8%
if 9.99999999999999997e-74 < t Initial program 70.6%
+-commutative70.6%
associate-+r-70.6%
*-commutative70.6%
associate-*r*76.4%
*-commutative76.4%
associate-+r-76.4%
+-commutative76.4%
associate-*l*76.4%
associate-*l*75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in x around 0 77.3%
Taylor expanded in c around 0 84.6%
Taylor expanded in c around 0 85.8%
Taylor expanded in x around 0 74.0%
Final simplification75.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -0.052)
(* a (/ (* t -4.0) c))
(if (<= t 1.3e-73)
(/ (+ b (* y (* x 9.0))) (* z c))
(* a (* t (/ -4.0 c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -0.052) {
tmp = a * ((t * -4.0) / c);
} else if (t <= 1.3e-73) {
tmp = (b + (y * (x * 9.0))) / (z * c);
} else {
tmp = a * (t * (-4.0 / c));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (t <= (-0.052d0)) then
tmp = a * ((t * (-4.0d0)) / c)
else if (t <= 1.3d-73) then
tmp = (b + (y * (x * 9.0d0))) / (z * c)
else
tmp = a * (t * ((-4.0d0) / c))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -0.052) {
tmp = a * ((t * -4.0) / c);
} else if (t <= 1.3e-73) {
tmp = (b + (y * (x * 9.0))) / (z * c);
} else {
tmp = a * (t * (-4.0 / c));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -0.052: tmp = a * ((t * -4.0) / c) elif t <= 1.3e-73: tmp = (b + (y * (x * 9.0))) / (z * c) else: tmp = a * (t * (-4.0 / c)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -0.052) tmp = Float64(a * Float64(Float64(t * -4.0) / c)); elseif (t <= 1.3e-73) tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(z * c)); else tmp = Float64(a * Float64(t * Float64(-4.0 / c))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -0.052)
tmp = a * ((t * -4.0) / c);
elseif (t <= 1.3e-73)
tmp = (b + (y * (x * 9.0))) / (z * c);
else
tmp = a * (t * (-4.0 / c));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -0.052], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-73], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.052:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-73}:\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\
\end{array}
\end{array}
if t < -0.0519999999999999976Initial program 62.5%
+-commutative62.5%
associate-+r-62.5%
*-commutative62.5%
associate-*r*66.9%
*-commutative66.9%
associate-+r-66.9%
+-commutative66.9%
associate-*l*66.9%
associate-*l*64.0%
*-commutative64.0%
Simplified64.0%
Taylor expanded in z around inf 56.9%
associate-/l*63.7%
associate-*r*63.7%
*-commutative63.7%
associate-*r*63.7%
*-commutative63.7%
associate-*l/63.7%
Simplified63.7%
if -0.0519999999999999976 < t < 1.3e-73Initial program 89.7%
+-commutative89.7%
associate-+r-89.7%
*-commutative89.7%
associate-*r*86.1%
*-commutative86.1%
associate-+r-86.1%
+-commutative86.1%
associate-*l*86.1%
associate-*l*89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in x around 0 88.6%
Taylor expanded in c around 0 88.9%
Taylor expanded in c around 0 88.9%
Taylor expanded in z around 0 79.8%
associate-*r*79.8%
*-commutative79.8%
*-commutative79.8%
Simplified79.8%
if 1.3e-73 < t Initial program 70.6%
+-commutative70.6%
associate-+r-70.6%
*-commutative70.6%
associate-*r*76.4%
*-commutative76.4%
associate-+r-76.4%
+-commutative76.4%
associate-*l*76.4%
associate-*l*75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in x around 0 77.3%
Taylor expanded in c around 0 84.6%
Taylor expanded in z around inf 56.4%
associate-*r/56.4%
*-commutative56.4%
associate-*r*56.4%
associate-/l*61.7%
associate-*r/61.6%
Simplified61.6%
Final simplification69.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= t -0.00035) (not (<= t 1.5e-100))) (* a (* t (/ -4.0 c))) (/ b (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -0.00035) || !(t <= 1.5e-100)) {
tmp = a * (t * (-4.0 / c));
} else {
tmp = b / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((t <= (-0.00035d0)) .or. (.not. (t <= 1.5d-100))) then
tmp = a * (t * ((-4.0d0) / c))
else
tmp = b / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -0.00035) || !(t <= 1.5e-100)) {
tmp = a * (t * (-4.0 / c));
} else {
tmp = b / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -0.00035) or not (t <= 1.5e-100): tmp = a * (t * (-4.0 / c)) else: tmp = b / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -0.00035) || !(t <= 1.5e-100)) tmp = Float64(a * Float64(t * Float64(-4.0 / c))); else tmp = Float64(b / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((t <= -0.00035) || ~((t <= 1.5e-100)))
tmp = a * (t * (-4.0 / c));
else
tmp = b / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -0.00035], N[Not[LessEqual[t, 1.5e-100]], $MachinePrecision]], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.00035 \lor \neg \left(t \leq 1.5 \cdot 10^{-100}\right):\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if t < -3.49999999999999996e-4 or 1.5e-100 < t Initial program 68.0%
+-commutative68.0%
associate-+r-68.0%
*-commutative68.0%
associate-*r*72.9%
*-commutative72.9%
associate-+r-72.9%
+-commutative72.9%
associate-*l*72.9%
associate-*l*71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in x around 0 78.2%
Taylor expanded in c around 0 81.5%
Taylor expanded in z around inf 54.5%
associate-*r/54.5%
*-commutative54.5%
associate-*r*54.5%
associate-/l*59.5%
associate-*r/59.5%
Simplified59.5%
if -3.49999999999999996e-4 < t < 1.5e-100Initial program 89.9%
+-commutative89.9%
associate-+r-89.9%
*-commutative89.9%
associate-*r*85.9%
*-commutative85.9%
associate-+r-85.9%
+-commutative85.9%
associate-*l*86.0%
associate-*l*89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in b around inf 51.4%
*-commutative51.4%
Simplified51.4%
Final simplification56.4%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= t -0.165) (* a (/ (* t -4.0) c)) (if (<= t 3.85e-97) (/ b (* z c)) (* a (* t (/ -4.0 c))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -0.165) {
tmp = a * ((t * -4.0) / c);
} else if (t <= 3.85e-97) {
tmp = b / (z * c);
} else {
tmp = a * (t * (-4.0 / c));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (t <= (-0.165d0)) then
tmp = a * ((t * (-4.0d0)) / c)
else if (t <= 3.85d-97) then
tmp = b / (z * c)
else
tmp = a * (t * ((-4.0d0) / c))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -0.165) {
tmp = a * ((t * -4.0) / c);
} else if (t <= 3.85e-97) {
tmp = b / (z * c);
} else {
tmp = a * (t * (-4.0 / c));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -0.165: tmp = a * ((t * -4.0) / c) elif t <= 3.85e-97: tmp = b / (z * c) else: tmp = a * (t * (-4.0 / c)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -0.165) tmp = Float64(a * Float64(Float64(t * -4.0) / c)); elseif (t <= 3.85e-97) tmp = Float64(b / Float64(z * c)); else tmp = Float64(a * Float64(t * Float64(-4.0 / c))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -0.165)
tmp = a * ((t * -4.0) / c);
elseif (t <= 3.85e-97)
tmp = b / (z * c);
else
tmp = a * (t * (-4.0 / c));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -0.165], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.85e-97], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.165:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c}\\
\mathbf{elif}\;t \leq 3.85 \cdot 10^{-97}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\
\end{array}
\end{array}
if t < -0.165000000000000008Initial program 62.5%
+-commutative62.5%
associate-+r-62.5%
*-commutative62.5%
associate-*r*66.9%
*-commutative66.9%
associate-+r-66.9%
+-commutative66.9%
associate-*l*66.9%
associate-*l*64.0%
*-commutative64.0%
Simplified64.0%
Taylor expanded in z around inf 56.9%
associate-/l*63.7%
associate-*r*63.7%
*-commutative63.7%
associate-*r*63.7%
*-commutative63.7%
associate-*l/63.7%
Simplified63.7%
if -0.165000000000000008 < t < 3.85e-97Initial program 90.0%
+-commutative90.0%
associate-+r-90.0%
*-commutative90.0%
associate-*r*86.1%
*-commutative86.1%
associate-+r-86.1%
+-commutative86.1%
associate-*l*86.1%
associate-*l*90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in b around inf 50.9%
*-commutative50.9%
Simplified50.9%
if 3.85e-97 < t Initial program 71.8%
+-commutative71.8%
associate-+r-71.8%
*-commutative71.8%
associate-*r*77.1%
*-commutative77.1%
associate-+r-77.1%
+-commutative77.1%
associate-*l*77.1%
associate-*l*76.0%
*-commutative76.0%
Simplified76.0%
Taylor expanded in x around 0 79.1%
Taylor expanded in c around 0 85.8%
Taylor expanded in z around inf 53.2%
associate-*r/53.2%
*-commutative53.2%
associate-*r*53.2%
associate-/l*57.0%
associate-*r/56.9%
Simplified56.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ (- (/ (- b (* y (* x -9.0))) z) (* 4.0 (* a t))) c))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c;
}
NOTE: x, y, z, t, a, b, and c 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 - (y * (x * (-9.0d0)))) / z) - (4.0d0 * (a * t))) / c
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): return (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(b - Float64(y * Float64(x * -9.0))) / z) - Float64(4.0 * Float64(a * t))) / c) end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = (((b - (y * (x * -9.0))) / z) - (4.0 * (a * t))) / c;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(b - N[(y * N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\frac{\frac{b - y \cdot \left(x \cdot -9\right)}{z} - 4 \cdot \left(a \cdot t\right)}{c}
\end{array}
Initial program 76.4%
+-commutative76.4%
associate-+r-76.4%
*-commutative76.4%
associate-*r*77.9%
*-commutative77.9%
associate-+r-77.9%
+-commutative77.9%
associate-*l*77.9%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in x around 0 81.8%
Taylor expanded in c around 0 84.0%
Taylor expanded in c around 0 85.2%
Taylor expanded in z around -inf 86.0%
mul-1-neg86.0%
distribute-neg-frac286.0%
mul-1-neg86.0%
unsub-neg86.0%
*-commutative86.0%
*-commutative86.0%
associate-*l*86.0%
Simplified86.0%
Final simplification86.0%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* z c)))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b / (z * c)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): return b / (z * c)
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (z * c);
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 76.4%
+-commutative76.4%
associate-+r-76.4%
*-commutative76.4%
associate-*r*77.9%
*-commutative77.9%
associate-+r-77.9%
+-commutative77.9%
associate-*l*77.9%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in b around inf 34.8%
*-commutative34.8%
Simplified34.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t\_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t\_4}{z \cdot c}\\
t_6 := \frac{\left(t\_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 0:\\
\;\;\;\;\frac{\frac{t\_4}{z}}{c}\\
\mathbf{elif}\;t\_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t\_1\right) - t\_2\\
\mathbf{elif}\;t\_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t\_1\right) - t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024119
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -220031348160821/200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 0) (/ (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 365902434742109/31250000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 28768236795461370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ (* (* 9 (/ y c)) (/ x z)) (/ b (* c z))) (* 4 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 138385150424563190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (- (+ (* 9 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4 (/ (* a t) c)))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))