
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 26 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ y 1.0)) (sqrt y)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (+ (sqrt (+ 1.0 t)) (sqrt t)))
(t_4 (sqrt (+ 1.0 z)))
(t_5 (+ t_4 (sqrt z))))
(if (<= t_1 1e-7)
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) t_2)))
(+ (- t_4 (sqrt z)) (* 0.5 (sqrt (/ 1.0 t)))))
(+ (- t_2 (sqrt x)) (+ t_1 (/ (+ t_3 t_5) (* t_3 t_5)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double t_2 = sqrt((1.0 + x));
double t_3 = sqrt((1.0 + t)) + sqrt(t);
double t_4 = sqrt((1.0 + z));
double t_5 = t_4 + sqrt(z);
double tmp;
if (t_1 <= 1e-7) {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2))) + ((t_4 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
} else {
tmp = (t_2 - sqrt(x)) + (t_1 + ((t_3 + t_5) / (t_3 * t_5)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((y + 1.0d0)) - sqrt(y)
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt((1.0d0 + t)) + sqrt(t)
t_4 = sqrt((1.0d0 + z))
t_5 = t_4 + sqrt(z)
if (t_1 <= 1d-7) then
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + t_2))) + ((t_4 - sqrt(z)) + (0.5d0 * sqrt((1.0d0 / t))))
else
tmp = (t_2 - sqrt(x)) + (t_1 + ((t_3 + t_5) / (t_3 * t_5)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + x));
double t_3 = Math.sqrt((1.0 + t)) + Math.sqrt(t);
double t_4 = Math.sqrt((1.0 + z));
double t_5 = t_4 + Math.sqrt(z);
double tmp;
if (t_1 <= 1e-7) {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + t_2))) + ((t_4 - Math.sqrt(z)) + (0.5 * Math.sqrt((1.0 / t))));
} else {
tmp = (t_2 - Math.sqrt(x)) + (t_1 + ((t_3 + t_5) / (t_3 * t_5)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) - math.sqrt(y) t_2 = math.sqrt((1.0 + x)) t_3 = math.sqrt((1.0 + t)) + math.sqrt(t) t_4 = math.sqrt((1.0 + z)) t_5 = t_4 + math.sqrt(z) tmp = 0 if t_1 <= 1e-7: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + t_2))) + ((t_4 - math.sqrt(z)) + (0.5 * math.sqrt((1.0 / t)))) else: tmp = (t_2 - math.sqrt(x)) + (t_1 + ((t_3 + t_5) / (t_3 * t_5))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(sqrt(Float64(1.0 + t)) + sqrt(t)) t_4 = sqrt(Float64(1.0 + z)) t_5 = Float64(t_4 + sqrt(z)) tmp = 0.0 if (t_1 <= 1e-7) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + t_2))) + Float64(Float64(t_4 - sqrt(z)) + Float64(0.5 * sqrt(Float64(1.0 / t))))); else tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(t_1 + Float64(Float64(t_3 + t_5) / Float64(t_3 * t_5)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0)) - sqrt(y);
t_2 = sqrt((1.0 + x));
t_3 = sqrt((1.0 + t)) + sqrt(t);
t_4 = sqrt((1.0 + z));
t_5 = t_4 + sqrt(z);
tmp = 0.0;
if (t_1 <= 1e-7)
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2))) + ((t_4 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
else
tmp = (t_2 - sqrt(x)) + (t_1 + ((t_3 + t_5) / (t_3 * t_5)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-7], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[(t$95$3 + t$95$5), $MachinePrecision] / N[(t$95$3 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} - \sqrt{y}\\
t_2 := \sqrt{1 + x}\\
t_3 := \sqrt{1 + t} + \sqrt{t}\\
t_4 := \sqrt{1 + z}\\
t_5 := t\_4 + \sqrt{z}\\
\mathbf{if}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + t\_2}\right) + \left(\left(t\_4 - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(t\_1 + \frac{t\_3 + t\_5}{t\_3 \cdot t\_5}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 9.9999999999999995e-8Initial program 87.1%
associate-+l+87.1%
associate-+l-87.1%
associate-+l-87.1%
+-commutative87.1%
+-commutative87.1%
+-commutative87.1%
Simplified87.1%
Taylor expanded in t around inf 46.0%
flip--46.0%
flip--46.0%
frac-add46.0%
Applied egg-rr46.0%
Taylor expanded in y around inf 51.0%
if 9.9999999999999995e-8 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 96.2%
associate-+l+96.2%
associate-+l+96.2%
+-commutative96.2%
+-commutative96.2%
associate-+l-82.7%
+-commutative82.7%
+-commutative82.7%
Simplified82.7%
associate--r-96.2%
+-commutative96.2%
flip--96.4%
flip--96.4%
frac-add96.4%
Applied egg-rr96.9%
Simplified97.8%
Final simplification76.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))) (t_2 (sqrt (+ 1.0 z))))
(if (<= (- t_1 (sqrt y)) 1e-7)
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))
(+ (- t_2 (sqrt z)) (* 0.5 (sqrt (/ 1.0 t)))))
(+
(+ 1.0 (- t_1 (+ (sqrt y) (sqrt x))))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_2 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = sqrt((1.0 + z));
double tmp;
if ((t_1 - sqrt(y)) <= 1e-7) {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + ((t_2 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
} else {
tmp = (1.0 + (t_1 - (sqrt(y) + sqrt(x)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_2 + sqrt(z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt((1.0d0 + z))
if ((t_1 - sqrt(y)) <= 1d-7) then
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))) + ((t_2 - sqrt(z)) + (0.5d0 * sqrt((1.0d0 / t))))
else
tmp = (1.0d0 + (t_1 - (sqrt(y) + sqrt(x)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_2 + sqrt(z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if ((t_1 - Math.sqrt(y)) <= 1e-7) {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))))) + ((t_2 - Math.sqrt(z)) + (0.5 * Math.sqrt((1.0 / t))));
} else {
tmp = (1.0 + (t_1 - (Math.sqrt(y) + Math.sqrt(x)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_2 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if (t_1 - math.sqrt(y)) <= 1e-7: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))))) + ((t_2 - math.sqrt(z)) + (0.5 * math.sqrt((1.0 / t)))) else: tmp = (1.0 + (t_1 - (math.sqrt(y) + math.sqrt(x)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_2 + math.sqrt(z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (Float64(t_1 - sqrt(y)) <= 1e-7) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))) + Float64(Float64(t_2 - sqrt(z)) + Float64(0.5 * sqrt(Float64(1.0 / t))))); else tmp = Float64(Float64(1.0 + Float64(t_1 - Float64(sqrt(y) + sqrt(x)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_2 + sqrt(z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if ((t_1 - sqrt(y)) <= 1e-7)
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + ((t_2 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
else
tmp = (1.0 + (t_1 - (sqrt(y) + sqrt(x)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_2 + sqrt(z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 1e-7], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(t$95$1 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;t\_1 - \sqrt{y} \leq 10^{-7}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right) + \left(\left(t\_2 - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(t\_1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t\_2 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 9.9999999999999995e-8Initial program 87.1%
associate-+l+87.1%
associate-+l-87.1%
associate-+l-87.1%
+-commutative87.1%
+-commutative87.1%
+-commutative87.1%
Simplified87.1%
Taylor expanded in t around inf 46.0%
flip--46.0%
flip--46.0%
frac-add46.0%
Applied egg-rr46.0%
Taylor expanded in y around inf 51.0%
if 9.9999999999999995e-8 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 96.2%
associate-+l+96.2%
associate-+l-64.3%
associate-+l-96.2%
+-commutative96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in x around 0 53.8%
associate--l+53.8%
Simplified53.8%
flip--53.9%
add-sqr-sqrt40.6%
add-sqr-sqrt54.1%
Applied egg-rr54.1%
associate--l+54.5%
+-inverses54.5%
metadata-eval54.5%
Simplified54.5%
Final simplification52.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 48000000.0)
(+
(- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x)))
(+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t))))
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))
(+ t_1 (* 0.5 (sqrt (/ 1.0 t))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 48000000.0) {
tmp = ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x))) + (t_1 + (sqrt((1.0 + t)) - sqrt(t)));
} else {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + (t_1 + (0.5 * sqrt((1.0 / t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 48000000.0d0) then
tmp = ((1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x))) + (t_1 + (sqrt((1.0d0 + t)) - sqrt(t)))
else
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))) + (t_1 + (0.5d0 * sqrt((1.0d0 / t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 48000000.0) {
tmp = ((1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x))) + (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
} else {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))))) + (t_1 + (0.5 * Math.sqrt((1.0 / t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 48000000.0: tmp = ((1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x))) + (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t))) else: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))))) + (t_1 + (0.5 * math.sqrt((1.0 / t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 48000000.0) tmp = Float64(Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x))) + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); else tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))) + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 48000000.0)
tmp = ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x))) + (t_1 + (sqrt((1.0 + t)) - sqrt(t)));
else
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + (t_1 + (0.5 * sqrt((1.0 / t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 48000000.0], N[(N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 48000000:\\
\;\;\;\;\left(\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + \left(t\_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right) + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\end{array}
\end{array}
if y < 4.8e7Initial program 97.0%
associate-+l+97.0%
associate-+l-64.4%
associate-+l-97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 54.2%
if 4.8e7 < y Initial program 86.5%
associate-+l+86.5%
associate-+l-86.2%
associate-+l-86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 45.0%
flip--45.0%
flip--44.9%
frac-add44.9%
Applied egg-rr45.4%
Taylor expanded in y around inf 50.1%
Final simplification52.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 96000000.0)
(+
(+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))
(+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t))))
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))
(+ t_1 (* 0.5 (sqrt (/ 1.0 t))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 96000000.0) {
tmp = (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)))) + (t_1 + (sqrt((1.0 + t)) - sqrt(t)));
} else {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + (t_1 + (0.5 * sqrt((1.0 / t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 96000000.0d0) then
tmp = (1.0d0 + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))) + (t_1 + (sqrt((1.0d0 + t)) - sqrt(t)))
else
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))) + (t_1 + (0.5d0 * sqrt((1.0d0 / t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 96000000.0) {
tmp = (1.0 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)))) + (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
} else {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))))) + (t_1 + (0.5 * Math.sqrt((1.0 / t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 96000000.0: tmp = (1.0 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x)))) + (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t))) else: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))))) + (t_1 + (0.5 * math.sqrt((1.0 / t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 96000000.0) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))) + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); else tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))) + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 96000000.0)
tmp = (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)))) + (t_1 + (sqrt((1.0 + t)) - sqrt(t)));
else
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + (t_1 + (0.5 * sqrt((1.0 / t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 96000000.0], N[(N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 96000000:\\
\;\;\;\;\left(1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\right) + \left(t\_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right) + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\end{array}
\end{array}
if y < 9.6e7Initial program 97.0%
associate-+l+97.0%
associate-+l-64.4%
associate-+l-97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 54.2%
associate--l+54.2%
Simplified54.2%
if 9.6e7 < y Initial program 86.5%
associate-+l+86.5%
associate-+l-86.2%
associate-+l-86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 45.0%
flip--45.0%
flip--44.9%
frac-add44.9%
Applied egg-rr45.4%
Taylor expanded in y around inf 50.1%
Final simplification52.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z)))
(t_2 (/ 1.0 (+ t_1 (sqrt z))))
(t_3 (* 0.5 (sqrt (/ 1.0 t)))))
(if (<= y 2e-77)
(+ (+ (- (sqrt (+ 1.0 t)) (sqrt t)) t_2) (- (- 2.0 (sqrt x)) (sqrt y)))
(if (<= y 18000000.0)
(- (+ 1.0 (+ (sqrt (+ y 1.0)) (+ t_3 t_2))) (+ (sqrt y) (sqrt x)))
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))
(+ (- t_1 (sqrt z)) t_3))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = 1.0 / (t_1 + sqrt(z));
double t_3 = 0.5 * sqrt((1.0 / t));
double tmp;
if (y <= 2e-77) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_2) + ((2.0 - sqrt(x)) - sqrt(y));
} else if (y <= 18000000.0) {
tmp = (1.0 + (sqrt((y + 1.0)) + (t_3 + t_2))) - (sqrt(y) + sqrt(x));
} else {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + ((t_1 - sqrt(z)) + t_3);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = 1.0d0 / (t_1 + sqrt(z))
t_3 = 0.5d0 * sqrt((1.0d0 / t))
if (y <= 2d-77) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + t_2) + ((2.0d0 - sqrt(x)) - sqrt(y))
else if (y <= 18000000.0d0) then
tmp = (1.0d0 + (sqrt((y + 1.0d0)) + (t_3 + t_2))) - (sqrt(y) + sqrt(x))
else
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))) + ((t_1 - sqrt(z)) + t_3)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = 1.0 / (t_1 + Math.sqrt(z));
double t_3 = 0.5 * Math.sqrt((1.0 / t));
double tmp;
if (y <= 2e-77) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + t_2) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} else if (y <= 18000000.0) {
tmp = (1.0 + (Math.sqrt((y + 1.0)) + (t_3 + t_2))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))))) + ((t_1 - Math.sqrt(z)) + t_3);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = 1.0 / (t_1 + math.sqrt(z)) t_3 = 0.5 * math.sqrt((1.0 / t)) tmp = 0 if y <= 2e-77: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + t_2) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) elif y <= 18000000.0: tmp = (1.0 + (math.sqrt((y + 1.0)) + (t_3 + t_2))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))))) + ((t_1 - math.sqrt(z)) + t_3) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = Float64(1.0 / Float64(t_1 + sqrt(z))) t_3 = Float64(0.5 * sqrt(Float64(1.0 / t))) tmp = 0.0 if (y <= 2e-77) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + t_2) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); elseif (y <= 18000000.0) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) + Float64(t_3 + t_2))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))) + Float64(Float64(t_1 - sqrt(z)) + t_3)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = 1.0 / (t_1 + sqrt(z));
t_3 = 0.5 * sqrt((1.0 / t));
tmp = 0.0;
if (y <= 2e-77)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_2) + ((2.0 - sqrt(x)) - sqrt(y));
elseif (y <= 18000000.0)
tmp = (1.0 + (sqrt((y + 1.0)) + (t_3 + t_2))) - (sqrt(y) + sqrt(x));
else
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + ((t_1 - sqrt(z)) + t_3);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2e-77], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 18000000.0], N[(N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(t$95$3 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \frac{1}{t\_1 + \sqrt{z}}\\
t_3 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
\mathbf{if}\;y \leq 2 \cdot 10^{-77}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + t\_2\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 18000000:\\
\;\;\;\;\left(1 + \left(\sqrt{y + 1} + \left(t\_3 + t\_2\right)\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right) + \left(\left(t\_1 - \sqrt{z}\right) + t\_3\right)\\
\end{array}
\end{array}
if y < 1.9999999999999999e-77Initial program 98.4%
associate-+l+98.4%
associate-+l-65.5%
associate-+l-98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 55.4%
associate--l+55.4%
Simplified55.4%
flip--55.5%
add-sqr-sqrt40.0%
add-sqr-sqrt55.5%
Applied egg-rr55.5%
associate--l+55.8%
+-inverses55.8%
metadata-eval55.8%
Simplified55.8%
Taylor expanded in y around 0 55.8%
associate--r+55.8%
Simplified55.8%
if 1.9999999999999999e-77 < y < 1.8e7Initial program 92.2%
associate-+l+92.2%
associate-+l-60.7%
associate-+l-92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in x around 0 50.0%
associate--l+50.1%
Simplified50.1%
flip--50.0%
add-sqr-sqrt45.4%
add-sqr-sqrt50.9%
Applied egg-rr50.9%
associate--l+51.5%
+-inverses51.5%
metadata-eval51.5%
Simplified51.5%
Taylor expanded in t around inf 23.2%
if 1.8e7 < y Initial program 86.5%
associate-+l+86.5%
associate-+l-86.2%
associate-+l-86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 45.0%
flip--45.0%
flip--44.9%
frac-add44.9%
Applied egg-rr45.4%
Taylor expanded in y around inf 50.1%
Final simplification49.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z)))
(t_2 (/ 1.0 (+ t_1 (sqrt z))))
(t_3 (* 0.5 (sqrt (/ 1.0 t)))))
(if (<= y 1e-75)
(+ (+ (- (sqrt (+ 1.0 t)) (sqrt t)) t_2) (- (- 2.0 (sqrt x)) (sqrt y)))
(if (<= y 5e+15)
(- (+ 1.0 (+ (sqrt (+ y 1.0)) (+ t_3 t_2))) (+ (sqrt y) (sqrt x)))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (+ (- t_1 (sqrt z)) t_3))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = 1.0 / (t_1 + sqrt(z));
double t_3 = 0.5 * sqrt((1.0 / t));
double tmp;
if (y <= 1e-75) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_2) + ((2.0 - sqrt(x)) - sqrt(y));
} else if (y <= 5e+15) {
tmp = (1.0 + (sqrt((y + 1.0)) + (t_3 + t_2))) - (sqrt(y) + sqrt(x));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((t_1 - sqrt(z)) + t_3);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = 1.0d0 / (t_1 + sqrt(z))
t_3 = 0.5d0 * sqrt((1.0d0 / t))
if (y <= 1d-75) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + t_2) + ((2.0d0 - sqrt(x)) - sqrt(y))
else if (y <= 5d+15) then
tmp = (1.0d0 + (sqrt((y + 1.0d0)) + (t_3 + t_2))) - (sqrt(y) + sqrt(x))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + ((t_1 - sqrt(z)) + t_3)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = 1.0 / (t_1 + Math.sqrt(z));
double t_3 = 0.5 * Math.sqrt((1.0 / t));
double tmp;
if (y <= 1e-75) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + t_2) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} else if (y <= 5e+15) {
tmp = (1.0 + (Math.sqrt((y + 1.0)) + (t_3 + t_2))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((t_1 - Math.sqrt(z)) + t_3);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = 1.0 / (t_1 + math.sqrt(z)) t_3 = 0.5 * math.sqrt((1.0 / t)) tmp = 0 if y <= 1e-75: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + t_2) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) elif y <= 5e+15: tmp = (1.0 + (math.sqrt((y + 1.0)) + (t_3 + t_2))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((t_1 - math.sqrt(z)) + t_3) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = Float64(1.0 / Float64(t_1 + sqrt(z))) t_3 = Float64(0.5 * sqrt(Float64(1.0 / t))) tmp = 0.0 if (y <= 1e-75) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + t_2) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); elseif (y <= 5e+15) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) + Float64(t_3 + t_2))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(t_1 - sqrt(z)) + t_3)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = 1.0 / (t_1 + sqrt(z));
t_3 = 0.5 * sqrt((1.0 / t));
tmp = 0.0;
if (y <= 1e-75)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_2) + ((2.0 - sqrt(x)) - sqrt(y));
elseif (y <= 5e+15)
tmp = (1.0 + (sqrt((y + 1.0)) + (t_3 + t_2))) - (sqrt(y) + sqrt(x));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((t_1 - sqrt(z)) + t_3);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1e-75], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+15], N[(N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(t$95$3 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \frac{1}{t\_1 + \sqrt{z}}\\
t_3 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
\mathbf{if}\;y \leq 10^{-75}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + t\_2\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \left(\sqrt{y + 1} + \left(t\_3 + t\_2\right)\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\left(t\_1 - \sqrt{z}\right) + t\_3\right)\\
\end{array}
\end{array}
if y < 9.9999999999999996e-76Initial program 98.2%
associate-+l+98.2%
associate-+l-66.0%
associate-+l-98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 56.0%
associate--l+56.0%
Simplified56.0%
flip--56.1%
add-sqr-sqrt40.6%
add-sqr-sqrt56.1%
Applied egg-rr56.1%
associate--l+56.6%
+-inverses56.6%
metadata-eval56.6%
Simplified56.6%
Taylor expanded in y around 0 56.6%
associate--r+56.6%
Simplified56.6%
if 9.9999999999999996e-76 < y < 5e15Initial program 89.5%
associate-+l+89.5%
associate-+l-58.7%
associate-+l-89.5%
+-commutative89.5%
+-commutative89.5%
+-commutative89.5%
Simplified89.5%
Taylor expanded in x around 0 46.2%
associate--l+46.3%
Simplified46.3%
flip--46.3%
add-sqr-sqrt40.5%
add-sqr-sqrt47.1%
Applied egg-rr47.1%
associate--l+47.1%
+-inverses47.1%
metadata-eval47.1%
Simplified47.1%
Taylor expanded in t around inf 18.8%
if 5e15 < y Initial program 87.1%
associate-+l+87.1%
associate-+l-87.1%
associate-+l-87.1%
+-commutative87.1%
+-commutative87.1%
+-commutative87.1%
Simplified87.1%
Taylor expanded in t around inf 46.0%
flip--46.0%
flip--46.0%
frac-add46.0%
Applied egg-rr46.0%
Taylor expanded in y around inf 47.1%
Final simplification47.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (/ 1.0 (+ t_2 (sqrt z)))))
(if (<= y 7.2e-22)
(+ (+ (- (sqrt (+ 1.0 t)) (sqrt t)) t_3) (- (- 2.0 (sqrt x)) (sqrt y)))
(if (<= y 6.2e+23)
(+ (- t_1 (sqrt x)) (+ (- (sqrt (+ y 1.0)) (sqrt y)) t_3))
(+
(/ 1.0 (+ (sqrt x) t_1))
(+ (- t_2 (sqrt z)) (* 0.5 (sqrt (/ 1.0 t)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double t_3 = 1.0 / (t_2 + sqrt(z));
double tmp;
if (y <= 7.2e-22) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_3) + ((2.0 - sqrt(x)) - sqrt(y));
} else if (y <= 6.2e+23) {
tmp = (t_1 - sqrt(x)) + ((sqrt((y + 1.0)) - sqrt(y)) + t_3);
} else {
tmp = (1.0 / (sqrt(x) + t_1)) + ((t_2 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = 1.0d0 / (t_2 + sqrt(z))
if (y <= 7.2d-22) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + t_3) + ((2.0d0 - sqrt(x)) - sqrt(y))
else if (y <= 6.2d+23) then
tmp = (t_1 - sqrt(x)) + ((sqrt((y + 1.0d0)) - sqrt(y)) + t_3)
else
tmp = (1.0d0 / (sqrt(x) + t_1)) + ((t_2 - sqrt(z)) + (0.5d0 * sqrt((1.0d0 / t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = 1.0 / (t_2 + Math.sqrt(z));
double tmp;
if (y <= 7.2e-22) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + t_3) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} else if (y <= 6.2e+23) {
tmp = (t_1 - Math.sqrt(x)) + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + t_3);
} else {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + ((t_2 - Math.sqrt(z)) + (0.5 * Math.sqrt((1.0 / t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) t_3 = 1.0 / (t_2 + math.sqrt(z)) tmp = 0 if y <= 7.2e-22: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + t_3) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) elif y <= 6.2e+23: tmp = (t_1 - math.sqrt(x)) + ((math.sqrt((y + 1.0)) - math.sqrt(y)) + t_3) else: tmp = (1.0 / (math.sqrt(x) + t_1)) + ((t_2 - math.sqrt(z)) + (0.5 * math.sqrt((1.0 / t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(1.0 / Float64(t_2 + sqrt(z))) tmp = 0.0 if (y <= 7.2e-22) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + t_3) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); elseif (y <= 6.2e+23) tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + t_3)); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(Float64(t_2 - sqrt(z)) + Float64(0.5 * sqrt(Float64(1.0 / t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
t_3 = 1.0 / (t_2 + sqrt(z));
tmp = 0.0;
if (y <= 7.2e-22)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_3) + ((2.0 - sqrt(x)) - sqrt(y));
elseif (y <= 6.2e+23)
tmp = (t_1 - sqrt(x)) + ((sqrt((y + 1.0)) - sqrt(y)) + t_3);
else
tmp = (1.0 / (sqrt(x) + t_1)) + ((t_2 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 7.2e-22], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+23], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := \frac{1}{t\_2 + \sqrt{z}}\\
\mathbf{if}\;y \leq 7.2 \cdot 10^{-22}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + t\_3\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+23}:\\
\;\;\;\;\left(t\_1 - \sqrt{x}\right) + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1} + \left(\left(t\_2 - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\end{array}
\end{array}
if y < 7.1999999999999996e-22Initial program 97.6%
associate-+l+97.5%
associate-+l-64.2%
associate-+l-97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 53.2%
associate--l+53.2%
Simplified53.2%
flip--53.3%
add-sqr-sqrt39.5%
add-sqr-sqrt53.3%
Applied egg-rr53.3%
associate--l+53.8%
+-inverses53.8%
metadata-eval53.8%
Simplified53.8%
Taylor expanded in y around 0 53.8%
associate--r+53.8%
Simplified53.8%
if 7.1999999999999996e-22 < y < 6.19999999999999941e23Initial program 85.2%
associate-+l+85.2%
associate-+l+85.2%
+-commutative85.2%
+-commutative85.2%
associate-+l-73.9%
+-commutative73.9%
+-commutative73.9%
Simplified73.9%
associate--r-85.2%
+-commutative85.2%
flip--85.2%
flip--85.2%
frac-add85.2%
Applied egg-rr86.4%
Simplified86.4%
Taylor expanded in t around inf 39.0%
if 6.19999999999999941e23 < y Initial program 87.5%
associate-+l+87.5%
associate-+l-87.5%
associate-+l-87.5%
+-commutative87.5%
+-commutative87.5%
+-commutative87.5%
Simplified87.5%
Taylor expanded in t around inf 47.0%
flip--47.0%
flip--47.0%
frac-add47.0%
Applied egg-rr47.0%
Taylor expanded in y around inf 48.2%
Final simplification50.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (- t_1 (sqrt z))))
(if (<= y 7.5e-111)
(+ (+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t))) (- (- 2.0 (sqrt x)) (sqrt y)))
(if (<= y 4.5e+16)
(-
(+ 1.0 (+ (sqrt (+ y 1.0)) (/ 1.0 (+ t_1 (sqrt z)))))
(+ (sqrt y) (sqrt x)))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ t_2 (* 0.5 (sqrt (/ 1.0 t)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = t_1 - sqrt(z);
double tmp;
if (y <= 7.5e-111) {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + ((2.0 - sqrt(x)) - sqrt(y));
} else if (y <= 4.5e+16) {
tmp = (1.0 + (sqrt((y + 1.0)) + (1.0 / (t_1 + sqrt(z))))) - (sqrt(y) + sqrt(x));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_2 + (0.5 * sqrt((1.0 / t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = t_1 - sqrt(z)
if (y <= 7.5d-111) then
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + ((2.0d0 - sqrt(x)) - sqrt(y))
else if (y <= 4.5d+16) then
tmp = (1.0d0 + (sqrt((y + 1.0d0)) + (1.0d0 / (t_1 + sqrt(z))))) - (sqrt(y) + sqrt(x))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (t_2 + (0.5d0 * sqrt((1.0d0 / t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = t_1 - Math.sqrt(z);
double tmp;
if (y <= 7.5e-111) {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} else if (y <= 4.5e+16) {
tmp = (1.0 + (Math.sqrt((y + 1.0)) + (1.0 / (t_1 + Math.sqrt(z))))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (t_2 + (0.5 * Math.sqrt((1.0 / t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = t_1 - math.sqrt(z) tmp = 0 if y <= 7.5e-111: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) elif y <= 4.5e+16: tmp = (1.0 + (math.sqrt((y + 1.0)) + (1.0 / (t_1 + math.sqrt(z))))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_2 + (0.5 * math.sqrt((1.0 / t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = Float64(t_1 - sqrt(z)) tmp = 0.0 if (y <= 7.5e-111) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); elseif (y <= 4.5e+16) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) + Float64(1.0 / Float64(t_1 + sqrt(z))))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = t_1 - sqrt(z);
tmp = 0.0;
if (y <= 7.5e-111)
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + ((2.0 - sqrt(x)) - sqrt(y));
elseif (y <= 4.5e+16)
tmp = (1.0 + (sqrt((y + 1.0)) + (1.0 / (t_1 + sqrt(z))))) - (sqrt(y) + sqrt(x));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_2 + (0.5 * sqrt((1.0 / t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 7.5e-111], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+16], N[(N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := t\_1 - \sqrt{z}\\
\mathbf{if}\;y \leq 7.5 \cdot 10^{-111}:\\
\;\;\;\;\left(t\_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+16}:\\
\;\;\;\;\left(1 + \left(\sqrt{y + 1} + \frac{1}{t\_1 + \sqrt{z}}\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\end{array}
\end{array}
if y < 7.49999999999999965e-111Initial program 98.2%
associate-+l+98.2%
associate-+l-67.1%
associate-+l-98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 57.4%
associate--l+57.4%
Simplified57.4%
Taylor expanded in y around 0 57.4%
associate--r+57.9%
Simplified57.4%
if 7.49999999999999965e-111 < y < 4.5e16Initial program 92.9%
associate-+l+92.9%
associate-+l-59.4%
associate-+l-92.9%
+-commutative92.9%
+-commutative92.9%
+-commutative92.9%
Simplified92.9%
Taylor expanded in x around 0 47.6%
associate--l+47.6%
Simplified47.6%
flip--47.6%
add-sqr-sqrt36.8%
add-sqr-sqrt48.1%
Applied egg-rr48.1%
associate--l+48.5%
+-inverses48.5%
metadata-eval48.5%
Simplified48.5%
Taylor expanded in t around inf 26.3%
if 4.5e16 < y Initial program 87.1%
associate-+l+87.1%
associate-+l-87.1%
associate-+l-87.1%
+-commutative87.1%
+-commutative87.1%
+-commutative87.1%
Simplified87.1%
Taylor expanded in t around inf 46.0%
flip--46.0%
flip--46.0%
frac-add46.0%
Applied egg-rr46.0%
Taylor expanded in y around inf 47.1%
Final simplification46.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))) (t_2 (sqrt (+ 1.0 x))))
(if (<= z 3.8e-15)
(- (+ (+ 1.0 t_2) (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))) (sqrt z))
(+ (- t_2 (sqrt x)) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- t_1 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = sqrt((1.0 + x));
double tmp;
if (z <= 3.8e-15) {
tmp = ((1.0 + t_2) + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))))) - sqrt(z);
} else {
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0 + z)) - sqrt(z)) + (t_1 - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt((1.0d0 + x))
if (z <= 3.8d-15) then
tmp = ((1.0d0 + t_2) + (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))) - sqrt(z)
else
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (t_1 - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 3.8e-15) {
tmp = ((1.0 + t_2) + (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))))) - Math.sqrt(z);
} else {
tmp = (t_2 - Math.sqrt(x)) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (t_1 - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if z <= 3.8e-15: tmp = ((1.0 + t_2) + (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) - math.sqrt(z) else: tmp = (t_2 - math.sqrt(x)) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (t_1 - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 3.8e-15) tmp = Float64(Float64(Float64(1.0 + t_2) + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))) - sqrt(z)); else tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(t_1 - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 3.8e-15)
tmp = ((1.0 + t_2) + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))))) - sqrt(z);
else
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0 + z)) - sqrt(z)) + (t_1 - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.8e-15], N[(N[(N[(1.0 + t$95$2), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;\left(\left(1 + t\_2\right) + \left(t\_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(t\_1 - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 3.8000000000000002e-15Initial program 98.1%
associate-+l+98.1%
associate-+l-81.0%
associate-+l-98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
flip--98.1%
add-sqr-sqrt77.6%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
associate--l+98.6%
+-inverses98.6%
metadata-eval98.6%
Simplified98.6%
Taylor expanded in z around 0 30.5%
associate-+r+30.5%
associate-+r+30.5%
+-commutative30.5%
Simplified30.5%
Taylor expanded in z around inf 26.4%
if 3.8000000000000002e-15 < z Initial program 86.9%
associate-+l+86.9%
associate-+l+86.9%
+-commutative86.9%
+-commutative86.9%
associate-+l-84.7%
+-commutative84.7%
+-commutative84.7%
Simplified84.7%
Taylor expanded in t around inf 37.5%
Final simplification32.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 3.05e+16)
(-
(+ 1.0 (+ (sqrt (+ y 1.0)) (/ 1.0 (+ t_1 (sqrt z)))))
(+ (sqrt y) (sqrt x)))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ (- t_1 (sqrt z)) (* 0.5 (sqrt (/ 1.0 t))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 3.05e+16) {
tmp = (1.0 + (sqrt((y + 1.0)) + (1.0 / (t_1 + sqrt(z))))) - (sqrt(y) + sqrt(x));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((t_1 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 3.05d+16) then
tmp = (1.0d0 + (sqrt((y + 1.0d0)) + (1.0d0 / (t_1 + sqrt(z))))) - (sqrt(y) + sqrt(x))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + ((t_1 - sqrt(z)) + (0.5d0 * sqrt((1.0d0 / t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 3.05e+16) {
tmp = (1.0 + (Math.sqrt((y + 1.0)) + (1.0 / (t_1 + Math.sqrt(z))))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((t_1 - Math.sqrt(z)) + (0.5 * Math.sqrt((1.0 / t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 3.05e+16: tmp = (1.0 + (math.sqrt((y + 1.0)) + (1.0 / (t_1 + math.sqrt(z))))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((t_1 - math.sqrt(z)) + (0.5 * math.sqrt((1.0 / t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 3.05e+16) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) + Float64(1.0 / Float64(t_1 + sqrt(z))))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(t_1 - sqrt(z)) + Float64(0.5 * sqrt(Float64(1.0 / t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 3.05e+16)
tmp = (1.0 + (sqrt((y + 1.0)) + (1.0 / (t_1 + sqrt(z))))) - (sqrt(y) + sqrt(x));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((t_1 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.05e+16], N[(N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 3.05 \cdot 10^{+16}:\\
\;\;\;\;\left(1 + \left(\sqrt{y + 1} + \frac{1}{t\_1 + \sqrt{z}}\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\left(t\_1 - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\end{array}
\end{array}
if y < 3.05e16Initial program 96.2%
associate-+l+96.2%
associate-+l-64.3%
associate-+l-96.2%
+-commutative96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in x around 0 53.8%
associate--l+53.8%
Simplified53.8%
flip--53.9%
add-sqr-sqrt40.6%
add-sqr-sqrt54.1%
Applied egg-rr54.1%
associate--l+54.5%
+-inverses54.5%
metadata-eval54.5%
Simplified54.5%
Taylor expanded in t around inf 29.7%
if 3.05e16 < y Initial program 87.1%
associate-+l+87.1%
associate-+l-87.1%
associate-+l-87.1%
+-commutative87.1%
+-commutative87.1%
+-commutative87.1%
Simplified87.1%
Taylor expanded in t around inf 46.0%
flip--46.0%
flip--46.0%
frac-add46.0%
Applied egg-rr46.0%
Taylor expanded in y around inf 47.1%
Final simplification37.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 95000000000.0)
(-
(+ 1.0 (+ (sqrt (+ y 1.0)) (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))))
(+ (sqrt y) (sqrt x)))
(+
(sqrt (+ 1.0 x))
(- (* 0.5 (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 95000000000.0) {
tmp = (1.0 + (sqrt((y + 1.0)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))))) - (sqrt(y) + sqrt(x));
} else {
tmp = sqrt((1.0 + x)) + ((0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z)))) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 95000000000.0d0) then
tmp = (1.0d0 + (sqrt((y + 1.0d0)) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))))) - (sqrt(y) + sqrt(x))
else
tmp = sqrt((1.0d0 + x)) + ((0.5d0 * (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z)))) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 95000000000.0) {
tmp = (1.0 + (Math.sqrt((y + 1.0)) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = Math.sqrt((1.0 + x)) + ((0.5 * (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z)))) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 95000000000.0: tmp = (1.0 + (math.sqrt((y + 1.0)) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = math.sqrt((1.0 + x)) + ((0.5 * (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 95000000000.0) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z)))) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 95000000000.0)
tmp = (1.0 + (sqrt((y + 1.0)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))))) - (sqrt(y) + sqrt(x));
else
tmp = sqrt((1.0 + x)) + ((0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z)))) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 95000000000.0], N[(N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 95000000000:\\
\;\;\;\;\left(1 + \left(\sqrt{y + 1} + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 9.5e10Initial program 96.5%
associate-+l+96.5%
associate-+l-64.1%
associate-+l-96.5%
+-commutative96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in x around 0 54.0%
associate--l+54.0%
Simplified54.0%
flip--54.1%
add-sqr-sqrt40.6%
add-sqr-sqrt54.3%
Applied egg-rr54.3%
associate--l+54.7%
+-inverses54.7%
metadata-eval54.7%
Simplified54.7%
Taylor expanded in t around inf 30.0%
if 9.5e10 < y Initial program 86.9%
associate-+l+86.9%
associate-+l-86.9%
associate-+l-86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
Taylor expanded in t around inf 3.4%
associate--l+19.6%
Simplified19.6%
Taylor expanded in z around inf 4.0%
Taylor expanded in y around inf 16.1%
associate--l+16.2%
distribute-lft-out16.2%
Simplified16.2%
Final simplification23.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt y) (sqrt x))) (t_2 (sqrt (+ y 1.0))))
(if (<= z 37000000.0)
(+ 1.0 (+ t_2 (- (sqrt (+ 1.0 z)) (+ (sqrt z) t_1))))
(+ 1.0 (- (+ t_2 (* 0.5 (sqrt (/ 1.0 z)))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(x);
double t_2 = sqrt((y + 1.0));
double tmp;
if (z <= 37000000.0) {
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(z) + t_1)));
} else {
tmp = 1.0 + ((t_2 + (0.5 * sqrt((1.0 / z)))) - t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
t_2 = sqrt((y + 1.0d0))
if (z <= 37000000.0d0) then
tmp = 1.0d0 + (t_2 + (sqrt((1.0d0 + z)) - (sqrt(z) + t_1)))
else
tmp = 1.0d0 + ((t_2 + (0.5d0 * sqrt((1.0d0 / z)))) - t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt(x);
double t_2 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 37000000.0) {
tmp = 1.0 + (t_2 + (Math.sqrt((1.0 + z)) - (Math.sqrt(z) + t_1)));
} else {
tmp = 1.0 + ((t_2 + (0.5 * Math.sqrt((1.0 / z)))) - t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(x) t_2 = math.sqrt((y + 1.0)) tmp = 0 if z <= 37000000.0: tmp = 1.0 + (t_2 + (math.sqrt((1.0 + z)) - (math.sqrt(z) + t_1))) else: tmp = 1.0 + ((t_2 + (0.5 * math.sqrt((1.0 / z)))) - t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) t_2 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 37000000.0) tmp = Float64(1.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(z) + t_1)))); else tmp = Float64(1.0 + Float64(Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / z)))) - t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(x);
t_2 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 37000000.0)
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(z) + t_1)));
else
tmp = 1.0 + ((t_2 + (0.5 * sqrt((1.0 / z)))) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 37000000.0], N[(1.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
t_2 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 37000000:\\
\;\;\;\;1 + \left(t\_2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - t\_1\right)\\
\end{array}
\end{array}
if z < 3.7e7Initial program 97.9%
associate-+l+97.9%
associate-+l-79.6%
associate-+l-97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in t around inf 17.9%
associate--l+23.1%
Simplified23.1%
Taylor expanded in x around 0 15.7%
associate--l+25.0%
associate-+r-25.0%
associate-+r+25.0%
+-commutative25.0%
Simplified25.0%
if 3.7e7 < z Initial program 86.3%
associate-+l+86.3%
associate-+l-70.4%
associate-+l-86.3%
+-commutative86.3%
+-commutative86.3%
+-commutative86.3%
Simplified86.3%
Taylor expanded in t around inf 4.7%
associate--l+19.5%
Simplified19.5%
Taylor expanded in z around inf 19.3%
Taylor expanded in x around 0 18.5%
associate--l+31.8%
Simplified31.8%
Final simplification28.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= x 550000.0)
(+ (sqrt (+ 1.0 x)) (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))
(/
(+
(* -0.125 (sqrt (/ 1.0 x)))
(+ (* 0.0625 (sqrt (/ 1.0 (pow x 3.0)))) (* 0.5 (sqrt x))))
x)))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 550000.0) {
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
} else {
tmp = ((-0.125 * sqrt((1.0 / x))) + ((0.0625 * sqrt((1.0 / pow(x, 3.0)))) + (0.5 * sqrt(x)))) / x;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 550000.0d0) then
tmp = sqrt((1.0d0 + x)) + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
else
tmp = (((-0.125d0) * sqrt((1.0d0 / x))) + ((0.0625d0 * sqrt((1.0d0 / (x ** 3.0d0)))) + (0.5d0 * sqrt(x)))) / x
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 550000.0) {
tmp = Math.sqrt((1.0 + x)) + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = ((-0.125 * Math.sqrt((1.0 / x))) + ((0.0625 * Math.sqrt((1.0 / Math.pow(x, 3.0)))) + (0.5 * Math.sqrt(x)))) / x;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 550000.0: tmp = math.sqrt((1.0 + x)) + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) else: tmp = ((-0.125 * math.sqrt((1.0 / x))) + ((0.0625 * math.sqrt((1.0 / math.pow(x, 3.0)))) + (0.5 * math.sqrt(x)))) / x return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 550000.0) tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(Float64(0.0625 * sqrt(Float64(1.0 / (x ^ 3.0)))) + Float64(0.5 * sqrt(x)))) / x); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 550000.0)
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
else
tmp = ((-0.125 * sqrt((1.0 / x))) + ((0.0625 * sqrt((1.0 / (x ^ 3.0)))) + (0.5 * sqrt(x)))) / x;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 550000.0], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.0625 * N[Sqrt[N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 550000:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + \left(0.0625 \cdot \sqrt{\frac{1}{{x}^{3}}} + 0.5 \cdot \sqrt{x}\right)}{x}\\
\end{array}
\end{array}
if x < 5.5e5Initial program 97.5%
associate-+l+97.5%
associate-+l-97.5%
associate-+l-97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in t around inf 16.4%
associate--l+33.1%
Simplified33.1%
Taylor expanded in z around inf 20.7%
associate--l+33.1%
Simplified33.1%
if 5.5e5 < x Initial program 84.5%
associate-+l+84.5%
associate-+l-44.4%
associate-+l-84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
Taylor expanded in t around inf 3.9%
associate--l+5.4%
Simplified5.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
Simplified3.3%
Taylor expanded in x around inf 8.0%
Final simplification22.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= x 1020000.0)
(+ (sqrt (+ 1.0 x)) (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))
(+
(* -0.125 (sqrt (/ 1.0 (pow x 3.0))))
(+ (* 0.5 (sqrt (/ 1.0 z))) (* 0.5 (sqrt (/ 1.0 x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1020000.0) {
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
} else {
tmp = (-0.125 * sqrt((1.0 / pow(x, 3.0)))) + ((0.5 * sqrt((1.0 / z))) + (0.5 * sqrt((1.0 / x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1020000.0d0) then
tmp = sqrt((1.0d0 + x)) + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
else
tmp = ((-0.125d0) * sqrt((1.0d0 / (x ** 3.0d0)))) + ((0.5d0 * sqrt((1.0d0 / z))) + (0.5d0 * sqrt((1.0d0 / x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1020000.0) {
tmp = Math.sqrt((1.0 + x)) + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (-0.125 * Math.sqrt((1.0 / Math.pow(x, 3.0)))) + ((0.5 * Math.sqrt((1.0 / z))) + (0.5 * Math.sqrt((1.0 / x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1020000.0: tmp = math.sqrt((1.0 + x)) + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (-0.125 * math.sqrt((1.0 / math.pow(x, 3.0)))) + ((0.5 * math.sqrt((1.0 / z))) + (0.5 * math.sqrt((1.0 / x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1020000.0) tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(-0.125 * sqrt(Float64(1.0 / (x ^ 3.0)))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(0.5 * sqrt(Float64(1.0 / x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1020000.0)
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
else
tmp = (-0.125 * sqrt((1.0 / (x ^ 3.0)))) + ((0.5 * sqrt((1.0 / z))) + (0.5 * sqrt((1.0 / x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1020000.0], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1020000:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \sqrt{\frac{1}{{x}^{3}}} + \left(0.5 \cdot \sqrt{\frac{1}{z}} + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if x < 1.02e6Initial program 97.5%
associate-+l+97.5%
associate-+l-97.5%
associate-+l-97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in t around inf 16.4%
associate--l+33.1%
Simplified33.1%
Taylor expanded in z around inf 20.7%
associate--l+33.1%
Simplified33.1%
if 1.02e6 < x Initial program 84.5%
associate-+l+84.5%
associate-+l-44.4%
associate-+l-84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
Taylor expanded in t around inf 3.9%
associate--l+5.4%
Simplified5.4%
Taylor expanded in z around inf 4.0%
Taylor expanded in y around inf 4.0%
Taylor expanded in x around inf 11.0%
Final simplification23.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 750000.0) (+ (sqrt (+ 1.0 x)) (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x)))) (/ (+ (* -0.125 (sqrt (/ 1.0 x))) (* 0.5 (sqrt x))) x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 750000.0) {
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
} else {
tmp = ((-0.125 * sqrt((1.0 / x))) + (0.5 * sqrt(x))) / x;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 750000.0d0) then
tmp = sqrt((1.0d0 + x)) + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
else
tmp = (((-0.125d0) * sqrt((1.0d0 / x))) + (0.5d0 * sqrt(x))) / x
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 750000.0) {
tmp = Math.sqrt((1.0 + x)) + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = ((-0.125 * Math.sqrt((1.0 / x))) + (0.5 * Math.sqrt(x))) / x;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 750000.0: tmp = math.sqrt((1.0 + x)) + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) else: tmp = ((-0.125 * math.sqrt((1.0 / x))) + (0.5 * math.sqrt(x))) / x return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 750000.0) tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(0.5 * sqrt(x))) / x); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 750000.0)
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
else
tmp = ((-0.125 * sqrt((1.0 / x))) + (0.5 * sqrt(x))) / x;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 750000.0], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 750000:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{x}}{x}\\
\end{array}
\end{array}
if x < 7.5e5Initial program 97.5%
associate-+l+97.5%
associate-+l-97.5%
associate-+l-97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in t around inf 16.4%
associate--l+33.1%
Simplified33.1%
Taylor expanded in z around inf 20.7%
associate--l+33.1%
Simplified33.1%
if 7.5e5 < x Initial program 84.5%
associate-+l+84.5%
associate-+l-44.4%
associate-+l-84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
Taylor expanded in t around inf 3.9%
associate--l+5.4%
Simplified5.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
Simplified3.3%
Taylor expanded in x around inf 8.0%
Final simplification22.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1e+19) (- (+ (+ 1.0 (sqrt (+ y 1.0))) (* 0.5 x)) (+ (sqrt y) (sqrt x))) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1e+19) {
tmp = ((1.0 + sqrt((y + 1.0))) + (0.5 * x)) - (sqrt(y) + sqrt(x));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1d+19) then
tmp = ((1.0d0 + sqrt((y + 1.0d0))) + (0.5d0 * x)) - (sqrt(y) + sqrt(x))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1e+19) {
tmp = ((1.0 + Math.sqrt((y + 1.0))) + (0.5 * x)) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1e+19: tmp = ((1.0 + math.sqrt((y + 1.0))) + (0.5 * x)) - (math.sqrt(y) + math.sqrt(x)) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1e+19) tmp = Float64(Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) + Float64(0.5 * x)) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1e+19)
tmp = ((1.0 + sqrt((y + 1.0))) + (0.5 * x)) - (sqrt(y) + sqrt(x));
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1e+19], N[(N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * x), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+19}:\\
\;\;\;\;\left(\left(1 + \sqrt{y + 1}\right) + 0.5 \cdot x\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1e19Initial program 95.8%
associate-+l+95.8%
associate-+l-64.4%
associate-+l-95.8%
+-commutative95.8%
+-commutative95.8%
+-commutative95.8%
Simplified95.8%
Taylor expanded in t around inf 17.8%
associate--l+22.5%
Simplified22.5%
Taylor expanded in z around inf 19.5%
Taylor expanded in x around 0 19.8%
associate-+r+19.8%
distribute-lft-out19.8%
Simplified19.8%
Taylor expanded in x around inf 22.6%
*-commutative22.6%
Simplified22.6%
if 1e19 < y Initial program 87.4%
associate-+l+87.4%
associate-+l-87.4%
associate-+l-87.4%
+-commutative87.4%
+-commutative87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in t around inf 3.2%
associate--l+19.8%
Simplified19.8%
Taylor expanded in x around inf 18.8%
mul-1-neg18.8%
Simplified18.8%
unsub-neg18.8%
Applied egg-rr18.8%
Final simplification20.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (/ 1.0 z))))
(if (<= y 0.95)
(- (+ 2.0 (* 0.5 (+ x t_1))) (+ (sqrt y) (sqrt x)))
(- (+ (sqrt (+ 1.0 x)) (* 0.5 t_1)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 / z));
double tmp;
if (y <= 0.95) {
tmp = (2.0 + (0.5 * (x + t_1))) - (sqrt(y) + sqrt(x));
} else {
tmp = (sqrt((1.0 + x)) + (0.5 * t_1)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 / z))
if (y <= 0.95d0) then
tmp = (2.0d0 + (0.5d0 * (x + t_1))) - (sqrt(y) + sqrt(x))
else
tmp = (sqrt((1.0d0 + x)) + (0.5d0 * t_1)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 / z));
double tmp;
if (y <= 0.95) {
tmp = (2.0 + (0.5 * (x + t_1))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = (Math.sqrt((1.0 + x)) + (0.5 * t_1)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 / z)) tmp = 0 if y <= 0.95: tmp = (2.0 + (0.5 * (x + t_1))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = (math.sqrt((1.0 + x)) + (0.5 * t_1)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 / z)) tmp = 0.0 if (y <= 0.95) tmp = Float64(Float64(2.0 + Float64(0.5 * Float64(x + t_1))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) + Float64(0.5 * t_1)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 / z));
tmp = 0.0;
if (y <= 0.95)
tmp = (2.0 + (0.5 * (x + t_1))) - (sqrt(y) + sqrt(x));
else
tmp = (sqrt((1.0 + x)) + (0.5 * t_1)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 0.95], N[(N[(2.0 + N[(0.5 * N[(x + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{1}{z}}\\
\mathbf{if}\;y \leq 0.95:\\
\;\;\;\;\left(2 + 0.5 \cdot \left(x + t\_1\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} + 0.5 \cdot t\_1\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 0.94999999999999996Initial program 97.7%
associate-+l+97.7%
associate-+l-65.1%
associate-+l-97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in t around inf 18.4%
associate--l+23.2%
Simplified23.2%
Taylor expanded in z around inf 20.4%
Taylor expanded in x around 0 20.6%
associate-+r+20.6%
distribute-lft-out20.6%
Simplified20.6%
Taylor expanded in y around 0 20.4%
if 0.94999999999999996 < y Initial program 86.1%
associate-+l+86.1%
associate-+l-84.9%
associate-+l-86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
Simplified86.1%
Taylor expanded in t around inf 3.7%
associate--l+19.3%
Simplified19.3%
Taylor expanded in z around inf 4.2%
Taylor expanded in y around inf 15.8%
Final simplification18.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 90000.0) (- (sqrt (+ 1.0 x)) (sqrt x)) (/ (+ (* -0.125 (sqrt (/ 1.0 x))) (* 0.5 (sqrt x))) x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 90000.0) {
tmp = sqrt((1.0 + x)) - sqrt(x);
} else {
tmp = ((-0.125 * sqrt((1.0 / x))) + (0.5 * sqrt(x))) / x;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 90000.0d0) then
tmp = sqrt((1.0d0 + x)) - sqrt(x)
else
tmp = (((-0.125d0) * sqrt((1.0d0 / x))) + (0.5d0 * sqrt(x))) / x
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 90000.0) {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
} else {
tmp = ((-0.125 * Math.sqrt((1.0 / x))) + (0.5 * Math.sqrt(x))) / x;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 90000.0: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) else: tmp = ((-0.125 * math.sqrt((1.0 / x))) + (0.5 * math.sqrt(x))) / x return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 90000.0) tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); else tmp = Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(0.5 * sqrt(x))) / x); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 90000.0)
tmp = sqrt((1.0 + x)) - sqrt(x);
else
tmp = ((-0.125 * sqrt((1.0 / x))) + (0.5 * sqrt(x))) / x;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 90000.0], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 90000:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{x}}{x}\\
\end{array}
\end{array}
if x < 9e4Initial program 97.5%
associate-+l+97.5%
associate-+l-97.5%
associate-+l-97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in t around inf 16.4%
associate--l+33.1%
Simplified33.1%
Taylor expanded in x around inf 23.5%
mul-1-neg23.5%
Simplified23.5%
unsub-neg23.5%
Applied egg-rr23.5%
if 9e4 < x Initial program 84.5%
associate-+l+84.5%
associate-+l-44.4%
associate-+l-84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
Taylor expanded in t around inf 3.9%
associate--l+5.4%
Simplified5.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
Simplified3.3%
Taylor expanded in x around inf 8.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 130000000.0) (- (sqrt (+ 1.0 x)) (sqrt x)) (* 0.5 (+ (sqrt (/ 1.0 z)) (sqrt (/ 1.0 x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 130000000.0) {
tmp = sqrt((1.0 + x)) - sqrt(x);
} else {
tmp = 0.5 * (sqrt((1.0 / z)) + sqrt((1.0 / x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 130000000.0d0) then
tmp = sqrt((1.0d0 + x)) - sqrt(x)
else
tmp = 0.5d0 * (sqrt((1.0d0 / z)) + sqrt((1.0d0 / x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 130000000.0) {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
} else {
tmp = 0.5 * (Math.sqrt((1.0 / z)) + Math.sqrt((1.0 / x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 130000000.0: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) else: tmp = 0.5 * (math.sqrt((1.0 / z)) + math.sqrt((1.0 / x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 130000000.0) tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); else tmp = Float64(0.5 * Float64(sqrt(Float64(1.0 / z)) + sqrt(Float64(1.0 / x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 130000000.0)
tmp = sqrt((1.0 + x)) - sqrt(x);
else
tmp = 0.5 * (sqrt((1.0 / z)) + sqrt((1.0 / x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 130000000.0], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 130000000:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{z}} + \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if x < 1.3e8Initial program 97.5%
associate-+l+97.5%
associate-+l-97.5%
associate-+l-97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in t around inf 16.4%
associate--l+33.1%
Simplified33.1%
Taylor expanded in x around inf 23.5%
mul-1-neg23.5%
Simplified23.5%
unsub-neg23.5%
Applied egg-rr23.5%
if 1.3e8 < x Initial program 84.5%
associate-+l+84.5%
associate-+l-44.4%
associate-+l-84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
Taylor expanded in t around inf 3.9%
associate--l+5.4%
Simplified5.4%
Taylor expanded in z around inf 4.0%
Taylor expanded in y around inf 4.0%
Taylor expanded in x around inf 11.0%
+-commutative11.0%
distribute-lft-out11.0%
Simplified11.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 135000000.0) (- (sqrt (+ 1.0 x)) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 135000000.0) {
tmp = sqrt((1.0 + x)) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 135000000.0d0) then
tmp = sqrt((1.0d0 + x)) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 135000000.0) {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 135000000.0: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 135000000.0) tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 135000000.0)
tmp = sqrt((1.0 + x)) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 135000000.0], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 135000000:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1.35e8Initial program 97.5%
associate-+l+97.5%
associate-+l-97.5%
associate-+l-97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in t around inf 16.4%
associate--l+33.1%
Simplified33.1%
Taylor expanded in x around inf 23.5%
mul-1-neg23.5%
Simplified23.5%
unsub-neg23.5%
Applied egg-rr23.5%
if 1.35e8 < x Initial program 84.5%
associate-+l+84.5%
associate-+l-44.4%
associate-+l-84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
Taylor expanded in t around inf 3.9%
associate--l+5.4%
Simplified5.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
Simplified3.3%
Taylor expanded in x around inf 8.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 5.8) (- (+ 1.0 (* x (+ 0.5 (* x (- (* x 0.0625) 0.125))))) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 5.8) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 5.8d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * ((x * 0.0625d0) - 0.125d0))))) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 5.8) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 5.8: tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 5.8) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.0625) - 0.125))))) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 5.8)
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 5.8], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.8:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.0625 - 0.125\right)\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 5.79999999999999982Initial program 97.6%
associate-+l+97.6%
associate-+l-97.6%
associate-+l-97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in t around inf 16.5%
associate--l+33.3%
Simplified33.3%
Taylor expanded in x around inf 23.6%
mul-1-neg23.6%
Simplified23.6%
Taylor expanded in x around 0 23.7%
if 5.79999999999999982 < x Initial program 84.6%
associate-+l+84.6%
associate-+l-45.2%
associate-+l-84.6%
+-commutative84.6%
+-commutative84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in t around inf 4.1%
associate--l+5.6%
Simplified5.6%
Taylor expanded in x around inf 3.5%
mul-1-neg3.5%
Simplified3.5%
Taylor expanded in x around inf 8.1%
Final simplification16.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 0.029) (+ 1.0 (- (* x (+ 0.5 (* x -0.125))) (sqrt x))) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.029) {
tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - sqrt(x));
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 0.029d0) then
tmp = 1.0d0 + ((x * (0.5d0 + (x * (-0.125d0)))) - sqrt(x))
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.029) {
tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - Math.sqrt(x));
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.029: tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - math.sqrt(x)) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.029) tmp = Float64(1.0 + Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x))); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.029)
tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - sqrt(x));
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.029], N[(1.0 + N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.029:\\
\;\;\;\;1 + \left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.0290000000000000015Initial program 97.6%
associate-+l+97.6%
associate-+l-97.6%
associate-+l-97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in t around inf 16.0%
associate--l+33.0%
Simplified33.0%
Taylor expanded in x around inf 23.8%
mul-1-neg23.8%
Simplified23.8%
Taylor expanded in x around 0 23.8%
associate--l+23.8%
*-commutative23.8%
Simplified23.8%
if 0.0290000000000000015 < x Initial program 85.0%
associate-+l+85.0%
associate-+l-46.7%
associate-+l-85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
Taylor expanded in t around inf 5.0%
associate--l+6.7%
Simplified6.7%
Taylor expanded in x around inf 3.9%
mul-1-neg3.9%
Simplified3.9%
Taylor expanded in x around inf 8.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 10.5) (+ 1.0 (- (* 0.5 x) (sqrt x))) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 10.5) {
tmp = 1.0 + ((0.5 * x) - sqrt(x));
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 10.5d0) then
tmp = 1.0d0 + ((0.5d0 * x) - sqrt(x))
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 10.5) {
tmp = 1.0 + ((0.5 * x) - Math.sqrt(x));
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 10.5: tmp = 1.0 + ((0.5 * x) - math.sqrt(x)) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 10.5) tmp = Float64(1.0 + Float64(Float64(0.5 * x) - sqrt(x))); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 10.5)
tmp = 1.0 + ((0.5 * x) - sqrt(x));
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 10.5], N[(1.0 + N[(N[(0.5 * x), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10.5:\\
\;\;\;\;1 + \left(0.5 \cdot x - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 10.5Initial program 97.6%
associate-+l+97.6%
associate-+l-97.6%
associate-+l-97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in t around inf 16.5%
associate--l+33.3%
Simplified33.3%
Taylor expanded in x around inf 23.6%
mul-1-neg23.6%
Simplified23.6%
Taylor expanded in x around 0 23.7%
associate--l+23.7%
*-commutative23.7%
Simplified23.7%
if 10.5 < x Initial program 84.6%
associate-+l+84.6%
associate-+l-45.2%
associate-+l-84.6%
+-commutative84.6%
+-commutative84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in t around inf 4.1%
associate--l+5.6%
Simplified5.6%
Taylor expanded in x around inf 3.5%
mul-1-neg3.5%
Simplified3.5%
Taylor expanded in x around inf 8.1%
Final simplification16.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 0.026) (- 1.0 (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.026) {
tmp = 1.0 - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 0.026d0) then
tmp = 1.0d0 - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.026) {
tmp = 1.0 - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.026: tmp = 1.0 - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.026) tmp = Float64(1.0 - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.026)
tmp = 1.0 - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.026], N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.026:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.0259999999999999988Initial program 97.6%
associate-+l+97.6%
associate-+l-97.6%
associate-+l-97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in t around inf 16.0%
associate--l+33.0%
Simplified33.0%
Taylor expanded in x around inf 23.8%
mul-1-neg23.8%
Simplified23.8%
Taylor expanded in x around 0 23.8%
if 0.0259999999999999988 < x Initial program 85.0%
associate-+l+85.0%
associate-+l-46.7%
associate-+l-85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
Taylor expanded in t around inf 5.0%
associate--l+6.7%
Simplified6.7%
Taylor expanded in x around inf 3.9%
mul-1-neg3.9%
Simplified3.9%
Taylor expanded in x around inf 8.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 92.0%
associate-+l+92.0%
associate-+l-74.9%
associate-+l-92.0%
+-commutative92.0%
+-commutative92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in t around inf 11.1%
associate--l+21.3%
Simplified21.3%
Taylor expanded in x around inf 14.9%
mul-1-neg14.9%
Simplified14.9%
Taylor expanded in x around 0 13.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 92.0%
associate-+l+92.0%
associate-+l-74.9%
associate-+l-92.0%
+-commutative92.0%
+-commutative92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in x around 0 39.7%
associate--l+55.8%
Simplified55.8%
flip--55.9%
add-sqr-sqrt42.9%
add-sqr-sqrt56.1%
Applied egg-rr56.1%
associate--l+56.3%
+-inverses56.3%
metadata-eval56.3%
Simplified56.3%
Taylor expanded in x around inf 1.6%
neg-mul-11.6%
Simplified1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024157
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (/ 1 (+ (sqrt (+ x 1)) (sqrt x))) (/ 1 (+ (sqrt (+ y 1)) (sqrt y)))) (/ 1 (+ (sqrt (+ z 1)) (sqrt z)))) (- (sqrt (+ t 1)) (sqrt t))))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))