
(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 20 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 z)))
(t_4 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= t_1 5e-6)
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) t_2)))
(+ (- t_3 (sqrt z)) t_4))
(+ (+ t_1 (- t_2 (sqrt x))) (+ t_4 (/ 1.0 (+ t_3 (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)) - sqrt(y);
double t_2 = sqrt((1.0 + x));
double t_3 = sqrt((1.0 + z));
double t_4 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (t_1 <= 5e-6) {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2))) + ((t_3 - sqrt(z)) + t_4);
} else {
tmp = (t_1 + (t_2 - sqrt(x))) + (t_4 + (1.0 / (t_3 + 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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((y + 1.0d0)) - sqrt(y)
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt((1.0d0 + z))
t_4 = sqrt((1.0d0 + t)) - sqrt(t)
if (t_1 <= 5d-6) then
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + t_2))) + ((t_3 - sqrt(z)) + t_4)
else
tmp = (t_1 + (t_2 - sqrt(x))) + (t_4 + (1.0d0 / (t_3 + 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)) - Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + x));
double t_3 = Math.sqrt((1.0 + z));
double t_4 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (t_1 <= 5e-6) {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + t_2))) + ((t_3 - Math.sqrt(z)) + t_4);
} else {
tmp = (t_1 + (t_2 - Math.sqrt(x))) + (t_4 + (1.0 / (t_3 + 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)) - math.sqrt(y) t_2 = math.sqrt((1.0 + x)) t_3 = math.sqrt((1.0 + z)) t_4 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if t_1 <= 5e-6: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + t_2))) + ((t_3 - math.sqrt(z)) + t_4) else: tmp = (t_1 + (t_2 - math.sqrt(x))) + (t_4 + (1.0 / (t_3 + math.sqrt(z)))) 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 = sqrt(Float64(1.0 + z)) t_4 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (t_1 <= 5e-6) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + t_2))) + Float64(Float64(t_3 - sqrt(z)) + t_4)); else tmp = Float64(Float64(t_1 + Float64(t_2 - sqrt(x))) + Float64(t_4 + Float64(1.0 / Float64(t_3 + 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)) - sqrt(y);
t_2 = sqrt((1.0 + x));
t_3 = sqrt((1.0 + z));
t_4 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (t_1 <= 5e-6)
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2))) + ((t_3 - sqrt(z)) + t_4);
else
tmp = (t_1 + (t_2 - sqrt(x))) + (t_4 + (1.0 / (t_3 + 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[(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[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-6], 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$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + N[(1.0 / N[(t$95$3 + 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} - \sqrt{y}\\
t_2 := \sqrt{1 + x}\\
t_3 := \sqrt{1 + z}\\
t_4 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + t\_2}\right) + \left(\left(t\_3 - \sqrt{z}\right) + t\_4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \left(t\_2 - \sqrt{x}\right)\right) + \left(t\_4 + \frac{1}{t\_3 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 5.00000000000000041e-6Initial program 83.5%
associate-+l+83.5%
sub-neg83.5%
sub-neg83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
Simplified83.5%
flip--83.5%
flip--83.6%
frac-add83.6%
Applied egg-rr85.9%
Taylor expanded in y around inf 93.1%
if 5.00000000000000041e-6 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
flip--97.8%
add-sqr-sqrt76.3%
add-sqr-sqrt98.2%
Applied egg-rr98.2%
associate--l+98.7%
+-inverses98.7%
metadata-eval98.7%
Simplified98.7%
Final simplification95.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 t)) (sqrt t)))
(t_2 (sqrt (+ y 1.0)))
(t_3 (sqrt (+ 1.0 z)))
(t_4 (sqrt (+ 1.0 x))))
(if (<= (+ (- t_2 (sqrt y)) (- t_4 (sqrt x))) 1.0001)
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) t_4)))
(+ (- t_3 (sqrt z)) t_1))
(+
(+ t_1 (/ 1.0 (+ t_3 (sqrt z))))
(- (+ 1.0 t_2) (+ (sqrt y) (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 + t)) - sqrt(t);
double t_2 = sqrt((y + 1.0));
double t_3 = sqrt((1.0 + z));
double t_4 = sqrt((1.0 + x));
double tmp;
if (((t_2 - sqrt(y)) + (t_4 - sqrt(x))) <= 1.0001) {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_4))) + ((t_3 - sqrt(z)) + t_1);
} else {
tmp = (t_1 + (1.0 / (t_3 + sqrt(z)))) + ((1.0 + t_2) - (sqrt(y) + 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((y + 1.0d0))
t_3 = sqrt((1.0d0 + z))
t_4 = sqrt((1.0d0 + x))
if (((t_2 - sqrt(y)) + (t_4 - sqrt(x))) <= 1.0001d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + t_4))) + ((t_3 - sqrt(z)) + t_1)
else
tmp = (t_1 + (1.0d0 / (t_3 + sqrt(z)))) + ((1.0d0 + t_2) - (sqrt(y) + 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 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((y + 1.0));
double t_3 = Math.sqrt((1.0 + z));
double t_4 = Math.sqrt((1.0 + x));
double tmp;
if (((t_2 - Math.sqrt(y)) + (t_4 - Math.sqrt(x))) <= 1.0001) {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + t_4))) + ((t_3 - Math.sqrt(z)) + t_1);
} else {
tmp = (t_1 + (1.0 / (t_3 + Math.sqrt(z)))) + ((1.0 + t_2) - (Math.sqrt(y) + 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 + t)) - math.sqrt(t) t_2 = math.sqrt((y + 1.0)) t_3 = math.sqrt((1.0 + z)) t_4 = math.sqrt((1.0 + x)) tmp = 0 if ((t_2 - math.sqrt(y)) + (t_4 - math.sqrt(x))) <= 1.0001: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + t_4))) + ((t_3 - math.sqrt(z)) + t_1) else: tmp = (t_1 + (1.0 / (t_3 + math.sqrt(z)))) + ((1.0 + t_2) - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = sqrt(Float64(y + 1.0)) t_3 = sqrt(Float64(1.0 + z)) t_4 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(Float64(t_2 - sqrt(y)) + Float64(t_4 - sqrt(x))) <= 1.0001) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + t_4))) + Float64(Float64(t_3 - sqrt(z)) + t_1)); else tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(t_3 + sqrt(z)))) + Float64(Float64(1.0 + t_2) - Float64(sqrt(y) + 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 + t)) - sqrt(t);
t_2 = sqrt((y + 1.0));
t_3 = sqrt((1.0 + z));
t_4 = sqrt((1.0 + x));
tmp = 0.0;
if (((t_2 - sqrt(y)) + (t_4 - sqrt(x))) <= 1.0001)
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_4))) + ((t_3 - sqrt(z)) + t_1);
else
tmp = (t_1 + (1.0 / (t_3 + sqrt(z)))) + ((1.0 + t_2) - (sqrt(y) + 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[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0001], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + t$95$2), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{y + 1}\\
t_3 := \sqrt{1 + z}\\
t_4 := \sqrt{1 + x}\\
\mathbf{if}\;\left(t\_2 - \sqrt{y}\right) + \left(t\_4 - \sqrt{x}\right) \leq 1.0001:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + t\_4}\right) + \left(\left(t\_3 - \sqrt{z}\right) + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \frac{1}{t\_3 + \sqrt{z}}\right) + \left(\left(1 + t\_2\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1.00009999999999999Initial program 88.4%
associate-+l+88.4%
sub-neg88.4%
sub-neg88.4%
+-commutative88.4%
+-commutative88.4%
+-commutative88.4%
Simplified88.4%
flip--88.4%
flip--88.5%
frac-add88.5%
Applied egg-rr90.1%
Taylor expanded in y around inf 63.6%
if 1.00009999999999999 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
flip--98.3%
add-sqr-sqrt68.0%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
associate--l+99.6%
+-inverses99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 99.0%
Final simplification70.9%
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)) (sqrt z))))
(if (<= (- t_1 (sqrt x)) 1.0)
(+ (/ 1.0 (+ (sqrt x) t_1)) t_2)
(+
(+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (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 + x));
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if ((t_1 - sqrt(x)) <= 1.0) {
tmp = (1.0 / (sqrt(x) + t_1)) + t_2;
} else {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + 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) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if ((t_1 - sqrt(x)) <= 1.0d0) then
tmp = (1.0d0 / (sqrt(x) + t_1)) + t_2
else
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + (sqrt((y + 1.0d0)) - (sqrt(y) + 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 + x));
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if ((t_1 - Math.sqrt(x)) <= 1.0) {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + t_2;
} else {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + 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 + x)) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if (t_1 - math.sqrt(x)) <= 1.0: tmp = (1.0 / (math.sqrt(x) + t_1)) + t_2 else: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + 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 + x)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (Float64(t_1 - sqrt(x)) <= 1.0) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + t_2); else tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + 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 + x));
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if ((t_1 - sqrt(x)) <= 1.0)
tmp = (1.0 / (sqrt(x) + t_1)) + t_2;
else
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + 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 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 1.0], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $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} - \sqrt{z}\\
\mathbf{if}\;t\_1 - \sqrt{x} \leq 1:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1} + t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1Initial program 90.5%
associate-+l+90.5%
sub-neg90.5%
sub-neg90.5%
+-commutative90.5%
+-commutative90.5%
+-commutative90.5%
Simplified90.5%
flip--90.5%
flip--90.5%
frac-add90.5%
Applied egg-rr91.8%
Taylor expanded in y around inf 53.3%
Taylor expanded in t around inf 20.5%
+-commutative20.5%
associate-+r-30.9%
Simplified30.9%
if 1 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 90.5%
associate-+l+90.5%
sub-neg90.5%
sub-neg90.5%
+-commutative90.5%
+-commutative90.5%
+-commutative90.5%
Simplified90.5%
Taylor expanded in x around 0 30.6%
associate--l+48.2%
Simplified48.2%
Final simplification30.9%
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 2e+20)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_1 (sqrt z))))
(- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (- t_1 (sqrt z))))))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 <= 2e+20) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 - 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) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 2d+20) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_1 + sqrt(z)))) + ((1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (t_1 - 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((1.0 + z));
double tmp;
if (y <= 2e+20) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_1 + Math.sqrt(z)))) + ((1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (t_1 - Math.sqrt(z));
}
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 <= 2e+20: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_1 + math.sqrt(z)))) + ((1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_1 - math.sqrt(z)) 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 <= 2e+20) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_1 + sqrt(z)))) + Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(t_1 - 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((1.0 + z));
tmp = 0.0;
if (y <= 2e+20)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 - 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[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2e+20], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $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$1 - N[Sqrt[z], $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 2 \cdot 10^{+20}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t\_1 + \sqrt{z}}\right) + \left(\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 2e20Initial program 96.6%
associate-+l+96.6%
sub-neg96.6%
sub-neg96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
flip--96.6%
add-sqr-sqrt75.9%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in x around 0 41.7%
if 2e20 < y Initial program 84.1%
associate-+l+84.1%
sub-neg84.1%
sub-neg84.1%
+-commutative84.1%
+-commutative84.1%
+-commutative84.1%
Simplified84.1%
flip--84.1%
flip--84.1%
frac-add84.1%
Applied egg-rr85.4%
Taylor expanded in y around inf 88.4%
Taylor expanded in t around inf 29.6%
+-commutative29.6%
associate-+r-46.6%
Simplified46.6%
Final simplification44.1%
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 (sqrt (+ 1.0 x))))
(if (<= y 4.5e+15)
(-
(+ t_2 (+ (sqrt (+ y 1.0)) (/ 1.0 (+ t_1 (sqrt z)))))
(+ (sqrt y) (sqrt x)))
(+ (/ 1.0 (+ (sqrt x) t_2)) (- t_1 (sqrt z))))))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 = sqrt((1.0 + x));
double tmp;
if (y <= 4.5e+15) {
tmp = (t_2 + (sqrt((y + 1.0)) + (1.0 / (t_1 + sqrt(z))))) - (sqrt(y) + sqrt(x));
} else {
tmp = (1.0 / (sqrt(x) + t_2)) + (t_1 - 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((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (y <= 4.5d+15) then
tmp = (t_2 + (sqrt((y + 1.0d0)) + (1.0d0 / (t_1 + sqrt(z))))) - (sqrt(y) + sqrt(x))
else
tmp = (1.0d0 / (sqrt(x) + t_2)) + (t_1 - 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((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.5e+15) {
tmp = (t_2 + (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) + t_2)) + (t_1 - Math.sqrt(z));
}
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 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.5e+15: tmp = (t_2 + (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) + t_2)) + (t_1 - math.sqrt(z)) 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 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.5e+15) tmp = Float64(Float64(t_2 + 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) + t_2)) + Float64(t_1 - 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((1.0 + z));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 4.5e+15)
tmp = (t_2 + (sqrt((y + 1.0)) + (1.0 / (t_1 + sqrt(z))))) - (sqrt(y) + sqrt(x));
else
tmp = (1.0 / (sqrt(x) + t_2)) + (t_1 - 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[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.5e+15], N[(N[(t$95$2 + 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] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $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 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\left(t\_2 + \left(\sqrt{y + 1} + \frac{1}{t\_1 + \sqrt{z}}\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_2} + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 4.5e15Initial program 96.6%
associate-+l+96.6%
sub-neg96.6%
sub-neg96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
flip--96.6%
add-sqr-sqrt75.9%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in t around inf 28.0%
if 4.5e15 < y Initial program 84.1%
associate-+l+84.1%
sub-neg84.1%
sub-neg84.1%
+-commutative84.1%
+-commutative84.1%
+-commutative84.1%
Simplified84.1%
flip--84.1%
flip--84.1%
frac-add84.1%
Applied egg-rr85.4%
Taylor expanded in y around inf 88.4%
Taylor expanded in t around inf 29.6%
+-commutative29.6%
associate-+r-46.6%
Simplified46.6%
Final simplification37.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 x))))
(if (<= (- t_1 (sqrt x)) 0.1)
(/ (+ (* -0.125 (sqrt (/ 1.0 x))) (* 0.5 (sqrt x))) x)
(+ t_1 (- (sqrt (+ y 1.0)) (+ (sqrt y) (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 + x));
double tmp;
if ((t_1 - sqrt(x)) <= 0.1) {
tmp = ((-0.125 * sqrt((1.0 / x))) + (0.5 * sqrt(x))) / x;
} else {
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + 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 + x))
if ((t_1 - sqrt(x)) <= 0.1d0) then
tmp = (((-0.125d0) * sqrt((1.0d0 / x))) + (0.5d0 * sqrt(x))) / x
else
tmp = t_1 + (sqrt((y + 1.0d0)) - (sqrt(y) + 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 + x));
double tmp;
if ((t_1 - Math.sqrt(x)) <= 0.1) {
tmp = ((-0.125 * Math.sqrt((1.0 / x))) + (0.5 * Math.sqrt(x))) / x;
} else {
tmp = t_1 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + 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 + x)) tmp = 0 if (t_1 - math.sqrt(x)) <= 0.1: tmp = ((-0.125 * math.sqrt((1.0 / x))) + (0.5 * math.sqrt(x))) / x else: tmp = t_1 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + 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 + x)) tmp = 0.0 if (Float64(t_1 - sqrt(x)) <= 0.1) tmp = Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(0.5 * sqrt(x))) / x); else tmp = Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + 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 + x));
tmp = 0.0;
if ((t_1 - sqrt(x)) <= 0.1)
tmp = ((-0.125 * sqrt((1.0 / x))) + (0.5 * sqrt(x))) / x;
else
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + 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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.1], 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], N[(t$95$1 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $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}\\
\mathbf{if}\;t\_1 - \sqrt{x} \leq 0.1:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.10000000000000001Initial program 83.3%
associate-+l+83.3%
sub-neg83.3%
sub-neg83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 4.5%
associate--l+5.9%
Simplified5.9%
Taylor expanded in x around inf 3.8%
neg-mul-13.8%
Simplified3.8%
Taylor expanded in x around inf 10.1%
if 0.10000000000000001 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 18.2%
associate--l+38.5%
Simplified38.5%
Taylor expanded in z around inf 16.5%
associate--l+33.4%
Simplified33.4%
Final simplification21.1%
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)) (sqrt x))))
(if (<= t_1 0.0001)
(/ (+ (* -0.125 (sqrt (/ 1.0 x))) (* 0.5 (sqrt x))) x)
(log (exp t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (t_1 <= 0.0001) {
tmp = ((-0.125 * sqrt((1.0 / x))) + (0.5 * sqrt(x))) / x;
} else {
tmp = log(exp(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) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (t_1 <= 0.0001d0) then
tmp = (((-0.125d0) * sqrt((1.0d0 / x))) + (0.5d0 * sqrt(x))) / x
else
tmp = log(exp(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((1.0 + x)) - Math.sqrt(x);
double tmp;
if (t_1 <= 0.0001) {
tmp = ((-0.125 * Math.sqrt((1.0 / x))) + (0.5 * Math.sqrt(x))) / x;
} else {
tmp = Math.log(Math.exp(t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if t_1 <= 0.0001: tmp = ((-0.125 * math.sqrt((1.0 / x))) + (0.5 * math.sqrt(x))) / x else: tmp = math.log(math.exp(t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (t_1 <= 0.0001) tmp = Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(0.5 * sqrt(x))) / x); else tmp = log(exp(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((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (t_1 <= 0.0001)
tmp = ((-0.125 * sqrt((1.0 / x))) + (0.5 * sqrt(x))) / x;
else
tmp = log(exp(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[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0001], 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], N[Log[N[Exp[t$95$1], $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;t\_1 \leq 0.0001:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{t\_1}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1.00000000000000005e-4Initial program 83.3%
associate-+l+83.3%
sub-neg83.3%
sub-neg83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 4.5%
associate--l+5.8%
Simplified5.8%
Taylor expanded in x around inf 3.8%
neg-mul-13.8%
Simplified3.8%
Taylor expanded in x around inf 10.1%
if 1.00000000000000005e-4 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 18.1%
associate--l+38.3%
Simplified38.3%
Taylor expanded in x around inf 26.9%
neg-mul-126.9%
Simplified26.9%
add-log-exp26.9%
unsub-neg26.9%
+-commutative26.9%
Applied egg-rr26.9%
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
(let* ((t_1 (+ (sqrt y) (sqrt x)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (sqrt (+ y 1.0)))
(t_4 (sqrt (+ 1.0 x))))
(if (<= y 1.04e-22)
(+ 1.0 (+ t_3 (- (- t_2 t_1) (sqrt z))))
(if (<= y 3e+15)
(+ t_4 (- (+ t_3 (* 0.5 (sqrt (/ 1.0 z)))) t_1))
(+ (/ 1.0 (+ (sqrt x) t_4)) (- 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) + sqrt(x);
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((y + 1.0));
double t_4 = sqrt((1.0 + x));
double tmp;
if (y <= 1.04e-22) {
tmp = 1.0 + (t_3 + ((t_2 - t_1) - sqrt(z)));
} else if (y <= 3e+15) {
tmp = t_4 + ((t_3 + (0.5 * sqrt((1.0 / z)))) - t_1);
} else {
tmp = (1.0 / (sqrt(x) + t_4)) + (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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((y + 1.0d0))
t_4 = sqrt((1.0d0 + x))
if (y <= 1.04d-22) then
tmp = 1.0d0 + (t_3 + ((t_2 - t_1) - sqrt(z)))
else if (y <= 3d+15) then
tmp = t_4 + ((t_3 + (0.5d0 * sqrt((1.0d0 / z)))) - t_1)
else
tmp = (1.0d0 / (sqrt(x) + t_4)) + (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) + Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((y + 1.0));
double t_4 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 1.04e-22) {
tmp = 1.0 + (t_3 + ((t_2 - t_1) - Math.sqrt(z)));
} else if (y <= 3e+15) {
tmp = t_4 + ((t_3 + (0.5 * Math.sqrt((1.0 / z)))) - t_1);
} else {
tmp = (1.0 / (Math.sqrt(x) + t_4)) + (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) + math.sqrt(x) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((y + 1.0)) t_4 = math.sqrt((1.0 + x)) tmp = 0 if y <= 1.04e-22: tmp = 1.0 + (t_3 + ((t_2 - t_1) - math.sqrt(z))) elif y <= 3e+15: tmp = t_4 + ((t_3 + (0.5 * math.sqrt((1.0 / z)))) - t_1) else: tmp = (1.0 / (math.sqrt(x) + t_4)) + (t_2 - math.sqrt(z)) 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(1.0 + z)) t_3 = sqrt(Float64(y + 1.0)) t_4 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 1.04e-22) tmp = Float64(1.0 + Float64(t_3 + Float64(Float64(t_2 - t_1) - sqrt(z)))); elseif (y <= 3e+15) tmp = Float64(t_4 + Float64(Float64(t_3 + Float64(0.5 * sqrt(Float64(1.0 / z)))) - t_1)); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_4)) + 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) + sqrt(x);
t_2 = sqrt((1.0 + z));
t_3 = sqrt((y + 1.0));
t_4 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 1.04e-22)
tmp = 1.0 + (t_3 + ((t_2 - t_1) - sqrt(z)));
elseif (y <= 3e+15)
tmp = t_4 + ((t_3 + (0.5 * sqrt((1.0 / z)))) - t_1);
else
tmp = (1.0 / (sqrt(x) + t_4)) + (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[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.04e-22], N[(1.0 + N[(t$95$3 + N[(N[(t$95$2 - t$95$1), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+15], N[(t$95$4 + N[(N[(t$95$3 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $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{1 + z}\\
t_3 := \sqrt{y + 1}\\
t_4 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 1.04 \cdot 10^{-22}:\\
\;\;\;\;1 + \left(t\_3 + \left(\left(t\_2 - t\_1\right) - \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+15}:\\
\;\;\;\;t\_4 + \left(\left(t\_3 + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_4} + \left(t\_2 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 1.04e-22Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in t around inf 19.0%
associate--l+22.7%
Simplified22.7%
Taylor expanded in x around 0 17.4%
associate--l+24.4%
associate-+r+24.4%
+-commutative24.4%
associate-+r-35.5%
associate--r+35.5%
+-commutative35.5%
Simplified35.5%
if 1.04e-22 < y < 3e15Initial program 86.7%
associate-+l+86.7%
sub-neg86.7%
sub-neg86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in t around inf 15.6%
associate--l+18.9%
Simplified18.9%
Taylor expanded in z around inf 7.1%
if 3e15 < y Initial program 84.1%
associate-+l+84.1%
sub-neg84.1%
sub-neg84.1%
+-commutative84.1%
+-commutative84.1%
+-commutative84.1%
Simplified84.1%
flip--84.1%
flip--84.1%
frac-add84.1%
Applied egg-rr85.4%
Taylor expanded in y around inf 88.4%
Taylor expanded in t around inf 29.6%
+-commutative29.6%
associate-+r-46.6%
Simplified46.6%
Final simplification38.9%
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 4.5e+15)
(-
(+ (+ 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))))))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 <= 4.5e+15) {
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));
}
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 <= 4.5d+15) 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))
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 <= 4.5e+15) {
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));
}
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 <= 4.5e+15: 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)) 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 <= 4.5e+15) tmp = Float64(Float64(Float64(1.0 + 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_1 - 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((1.0 + z));
tmp = 0.0;
if (y <= 4.5e+15)
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));
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, 4.5e+15], N[(N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $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$1 - N[Sqrt[z], $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 4.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(1 + \sqrt{y + 1}\right) + \frac{1}{t\_1 + \sqrt{z}}\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 4.5e15Initial program 96.6%
associate-+l+96.6%
sub-neg96.6%
sub-neg96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
flip--96.6%
add-sqr-sqrt75.9%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in x around 0 41.7%
Taylor expanded in t around inf 24.8%
associate-+r+24.8%
Simplified24.8%
if 4.5e15 < y Initial program 84.1%
associate-+l+84.1%
sub-neg84.1%
sub-neg84.1%
+-commutative84.1%
+-commutative84.1%
+-commutative84.1%
Simplified84.1%
flip--84.1%
flip--84.1%
frac-add84.1%
Applied egg-rr85.4%
Taylor expanded in y around inf 88.4%
Taylor expanded in t around inf 29.6%
+-commutative29.6%
associate-+r-46.6%
Simplified46.6%
Final simplification35.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 y) (sqrt x)))
(t_2 (sqrt (+ y 1.0)))
(t_3 (sqrt (+ 1.0 z))))
(if (<= y 1.05e-22)
(+ 1.0 (+ t_2 (- (- t_3 t_1) (sqrt z))))
(if (<= y 3e+15)
(- (+ 1.0 (+ t_2 (* 0.5 (sqrt (/ 1.0 z))))) t_1)
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (- t_3 (sqrt z)))))))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 t_3 = sqrt((1.0 + z));
double tmp;
if (y <= 1.05e-22) {
tmp = 1.0 + (t_2 + ((t_3 - t_1) - sqrt(z)));
} else if (y <= 3e+15) {
tmp = (1.0 + (t_2 + (0.5 * sqrt((1.0 / z))))) - t_1;
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_3 - 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) :: t_3
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
t_2 = sqrt((y + 1.0d0))
t_3 = sqrt((1.0d0 + z))
if (y <= 1.05d-22) then
tmp = 1.0d0 + (t_2 + ((t_3 - t_1) - sqrt(z)))
else if (y <= 3d+15) then
tmp = (1.0d0 + (t_2 + (0.5d0 * sqrt((1.0d0 / z))))) - t_1
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (t_3 - 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) + Math.sqrt(x);
double t_2 = Math.sqrt((y + 1.0));
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 1.05e-22) {
tmp = 1.0 + (t_2 + ((t_3 - t_1) - Math.sqrt(z)));
} else if (y <= 3e+15) {
tmp = (1.0 + (t_2 + (0.5 * Math.sqrt((1.0 / z))))) - t_1;
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (t_3 - 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) + math.sqrt(x) t_2 = math.sqrt((y + 1.0)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if y <= 1.05e-22: tmp = 1.0 + (t_2 + ((t_3 - t_1) - math.sqrt(z))) elif y <= 3e+15: tmp = (1.0 + (t_2 + (0.5 * math.sqrt((1.0 / z))))) - t_1 else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_3 - math.sqrt(z)) 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)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 1.05e-22) tmp = Float64(1.0 + Float64(t_2 + Float64(Float64(t_3 - t_1) - sqrt(z)))); elseif (y <= 3e+15) tmp = Float64(Float64(1.0 + Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / z))))) - t_1); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(t_3 - 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) + sqrt(x);
t_2 = sqrt((y + 1.0));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 1.05e-22)
tmp = 1.0 + (t_2 + ((t_3 - t_1) - sqrt(z)));
elseif (y <= 3e+15)
tmp = (1.0 + (t_2 + (0.5 * sqrt((1.0 / z))))) - t_1;
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_3 - 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[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.05e-22], N[(1.0 + N[(t$95$2 + N[(N[(t$95$3 - t$95$1), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+15], N[(N[(1.0 + N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $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}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 1.05 \cdot 10^{-22}:\\
\;\;\;\;1 + \left(t\_2 + \left(\left(t\_3 - t\_1\right) - \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_3 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 1.05000000000000004e-22Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in t around inf 19.0%
associate--l+22.7%
Simplified22.7%
Taylor expanded in x around 0 17.4%
associate--l+24.4%
associate-+r+24.4%
+-commutative24.4%
associate-+r-35.5%
associate--r+35.5%
+-commutative35.5%
Simplified35.5%
if 1.05000000000000004e-22 < y < 3e15Initial program 86.7%
associate-+l+86.7%
sub-neg86.7%
sub-neg86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in t around inf 15.6%
associate--l+18.9%
Simplified18.9%
Taylor expanded in z around inf 7.1%
Taylor expanded in x around 0 5.3%
if 3e15 < y Initial program 84.1%
associate-+l+84.1%
sub-neg84.1%
sub-neg84.1%
+-commutative84.1%
+-commutative84.1%
+-commutative84.1%
Simplified84.1%
flip--84.1%
flip--84.1%
frac-add84.1%
Applied egg-rr85.4%
Taylor expanded in y around inf 88.4%
Taylor expanded in t around inf 29.6%
+-commutative29.6%
associate-+r-46.6%
Simplified46.6%
Final simplification38.7%
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))))
(if (<= (- t_1 (sqrt x)) 0.0001)
(/ (+ (* -0.125 (sqrt (/ 1.0 x))) (* 0.5 (sqrt x))) x)
(- t_1 (cbrt (pow x 1.5))))))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 tmp;
if ((t_1 - sqrt(x)) <= 0.0001) {
tmp = ((-0.125 * sqrt((1.0 / x))) + (0.5 * sqrt(x))) / x;
} else {
tmp = t_1 - cbrt(pow(x, 1.5));
}
return tmp;
}
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 tmp;
if ((t_1 - Math.sqrt(x)) <= 0.0001) {
tmp = ((-0.125 * Math.sqrt((1.0 / x))) + (0.5 * Math.sqrt(x))) / x;
} else {
tmp = t_1 - Math.cbrt(Math.pow(x, 1.5));
}
return tmp;
}
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_1 - sqrt(x)) <= 0.0001) tmp = Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(0.5 * sqrt(x))) / x); else tmp = Float64(t_1 - cbrt((x ^ 1.5))); end return 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]}, If[LessEqual[N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.0001], 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], N[(t$95$1 - N[Power[N[Power[x, 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;t\_1 - \sqrt{x} \leq 0.0001:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \sqrt[3]{{x}^{1.5}}\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1.00000000000000005e-4Initial program 83.3%
associate-+l+83.3%
sub-neg83.3%
sub-neg83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 4.5%
associate--l+5.8%
Simplified5.8%
Taylor expanded in x around inf 3.8%
neg-mul-13.8%
Simplified3.8%
Taylor expanded in x around inf 10.1%
if 1.00000000000000005e-4 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 18.1%
associate--l+38.3%
Simplified38.3%
Taylor expanded in x around inf 26.9%
neg-mul-126.9%
Simplified26.9%
add-cbrt-cube26.9%
pow1/326.9%
pow326.9%
pow1/226.9%
pow-pow26.9%
metadata-eval26.9%
Applied egg-rr26.9%
unpow1/326.9%
Simplified26.9%
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
(let* ((t_1 (- (sqrt (+ 1.0 x)) (sqrt x))))
(if (<= t_1 0.0001)
(/ (+ (* -0.125 (sqrt (/ 1.0 x))) (* 0.5 (sqrt x))) x)
t_1)))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (t_1 <= 0.0001) {
tmp = ((-0.125 * sqrt((1.0 / x))) + (0.5 * sqrt(x))) / x;
} else {
tmp = 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) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (t_1 <= 0.0001d0) then
tmp = (((-0.125d0) * sqrt((1.0d0 / x))) + (0.5d0 * sqrt(x))) / x
else
tmp = 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((1.0 + x)) - Math.sqrt(x);
double tmp;
if (t_1 <= 0.0001) {
tmp = ((-0.125 * Math.sqrt((1.0 / x))) + (0.5 * Math.sqrt(x))) / x;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if t_1 <= 0.0001: tmp = ((-0.125 * math.sqrt((1.0 / x))) + (0.5 * math.sqrt(x))) / x else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (t_1 <= 0.0001) tmp = Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(0.5 * sqrt(x))) / x); else tmp = 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((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (t_1 <= 0.0001)
tmp = ((-0.125 * sqrt((1.0 / x))) + (0.5 * sqrt(x))) / x;
else
tmp = 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[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0001], 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], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;t\_1 \leq 0.0001:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1.00000000000000005e-4Initial program 83.3%
associate-+l+83.3%
sub-neg83.3%
sub-neg83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 4.5%
associate--l+5.8%
Simplified5.8%
Taylor expanded in x around inf 3.8%
neg-mul-13.8%
Simplified3.8%
Taylor expanded in x around inf 10.1%
if 1.00000000000000005e-4 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 18.1%
associate--l+38.3%
Simplified38.3%
Taylor expanded in x around inf 26.9%
neg-mul-126.9%
Simplified26.9%
unsub-neg26.9%
+-commutative26.9%
Applied egg-rr26.9%
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
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 4e+15)
(+ t_1 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))
(+ (/ 1.0 (+ (sqrt x) t_1)) (- (sqrt (+ 1.0 z)) (sqrt z))))))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 tmp;
if (y <= 4e+15) {
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + t_1)) + (sqrt((1.0 + z)) - 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) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 4d+15) then
tmp = t_1 + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + t_1)) + (sqrt((1.0d0 + z)) - 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((1.0 + x));
double tmp;
if (y <= 4e+15) {
tmp = t_1 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4e+15: tmp = t_1 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + t_1)) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(sqrt(Float64(1.0 + z)) - 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((1.0 + x));
tmp = 0.0;
if (y <= 4e+15)
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + t_1)) + (sqrt((1.0 + z)) - 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[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4e+15], N[(t$95$1 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1} + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 4e15Initial program 96.6%
associate-+l+96.6%
sub-neg96.6%
sub-neg96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in t around inf 18.5%
associate--l+22.2%
Simplified22.2%
Taylor expanded in z around inf 16.7%
associate--l+16.7%
Simplified16.7%
if 4e15 < y Initial program 84.1%
associate-+l+84.1%
sub-neg84.1%
sub-neg84.1%
+-commutative84.1%
+-commutative84.1%
+-commutative84.1%
Simplified84.1%
flip--84.1%
flip--84.1%
frac-add84.1%
Applied egg-rr85.4%
Taylor expanded in y around inf 88.4%
Taylor expanded in t around inf 29.6%
+-commutative29.6%
associate-+r-46.6%
Simplified46.6%
Final simplification31.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 (+ 1.0 x)) (sqrt x)))) (if (<= t_1 2e-6) (* 0.5 (sqrt (/ 1.0 x))) t_1)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (t_1 <= 2e-6) {
tmp = 0.5 * sqrt((1.0 / x));
} else {
tmp = 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) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (t_1 <= 2d-6) then
tmp = 0.5d0 * sqrt((1.0d0 / x))
else
tmp = 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((1.0 + x)) - Math.sqrt(x);
double tmp;
if (t_1 <= 2e-6) {
tmp = 0.5 * Math.sqrt((1.0 / x));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if t_1 <= 2e-6: tmp = 0.5 * math.sqrt((1.0 / x)) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (t_1 <= 2e-6) tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); else tmp = 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((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (t_1 <= 2e-6)
tmp = 0.5 * sqrt((1.0 / x));
else
tmp = 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[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-6], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-6}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1.99999999999999991e-6Initial program 83.3%
associate-+l+83.3%
sub-neg83.3%
sub-neg83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 4.5%
associate--l+5.8%
Simplified5.8%
Taylor expanded in x around inf 3.8%
neg-mul-13.8%
Simplified3.8%
Taylor expanded in x around inf 9.9%
if 1.99999999999999991e-6 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 18.1%
associate--l+38.3%
Simplified38.3%
Taylor expanded in x around inf 26.9%
neg-mul-126.9%
Simplified26.9%
unsub-neg26.9%
+-commutative26.9%
Applied egg-rr26.9%
Final simplification18.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 1.3) (- (+ 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 <= 1.3) {
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 <= 1.3d0) 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 <= 1.3) {
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 <= 1.3: 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 <= 1.3) 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 <= 1.3)
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, 1.3], 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 1.3:\\
\;\;\;\;\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 < 1.30000000000000004Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 18.2%
associate--l+38.5%
Simplified38.5%
Taylor expanded in x around inf 27.0%
neg-mul-127.0%
Simplified27.0%
Taylor expanded in x around 0 27.0%
if 1.30000000000000004 < x Initial program 83.3%
associate-+l+83.3%
sub-neg83.3%
sub-neg83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 4.5%
associate--l+5.9%
Simplified5.9%
Taylor expanded in x around inf 3.8%
neg-mul-13.8%
Simplified3.8%
Taylor expanded in x around inf 9.9%
Final simplification18.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 0.98) (- (+ 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.98) {
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.98d0) 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.98) {
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.98: 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.98) tmp = Float64(Float64(1.0 + 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.98)
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.98], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * -0.125), $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 0.98:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot -0.125\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.97999999999999998Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 18.2%
associate--l+38.5%
Simplified38.5%
Taylor expanded in x around inf 27.0%
neg-mul-127.0%
Simplified27.0%
Taylor expanded in x around 0 27.0%
if 0.97999999999999998 < x Initial program 83.3%
associate-+l+83.3%
sub-neg83.3%
sub-neg83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 4.5%
associate--l+5.9%
Simplified5.9%
Taylor expanded in x around inf 3.8%
neg-mul-13.8%
Simplified3.8%
Taylor expanded in x around inf 9.9%
Final simplification18.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 11.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 <= 11.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 <= 11.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 <= 11.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 <= 11.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 <= 11.5) tmp = Float64(Float64(1.0 + 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 <= 11.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, 11.5], N[(N[(1.0 + N[(0.5 * 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 11.5:\\
\;\;\;\;\left(1 + 0.5 \cdot x\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 11.5Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 18.2%
associate--l+38.5%
Simplified38.5%
Taylor expanded in x around inf 27.0%
neg-mul-127.0%
Simplified27.0%
Taylor expanded in x around 0 27.0%
*-commutative27.0%
Simplified27.0%
if 11.5 < x Initial program 83.3%
associate-+l+83.3%
sub-neg83.3%
sub-neg83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 4.5%
associate--l+5.9%
Simplified5.9%
Taylor expanded in x around inf 3.8%
neg-mul-13.8%
Simplified3.8%
Taylor expanded in x around inf 9.9%
Final simplification18.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 0.075) (- 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.075) {
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.075d0) 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.075) {
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.075: 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.075) 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.075)
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.075], 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.075:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.0749999999999999972Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 18.2%
associate--l+38.5%
Simplified38.5%
Taylor expanded in x around inf 27.0%
neg-mul-127.0%
Simplified27.0%
Taylor expanded in x around 0 27.0%
if 0.0749999999999999972 < x Initial program 83.3%
associate-+l+83.3%
sub-neg83.3%
sub-neg83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 4.5%
associate--l+5.9%
Simplified5.9%
Taylor expanded in x around inf 3.8%
neg-mul-13.8%
Simplified3.8%
Taylor expanded in x around inf 9.9%
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 90.5%
associate-+l+90.5%
sub-neg90.5%
sub-neg90.5%
+-commutative90.5%
+-commutative90.5%
+-commutative90.5%
Simplified90.5%
Taylor expanded in t around inf 11.0%
associate--l+21.3%
Simplified21.3%
Taylor expanded in x around inf 14.8%
neg-mul-114.8%
Simplified14.8%
Taylor expanded in x around 0 13.5%
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 90.5%
associate-+l+90.5%
sub-neg90.5%
sub-neg90.5%
+-commutative90.5%
+-commutative90.5%
+-commutative90.5%
Simplified90.5%
flip--90.7%
add-sqr-sqrt74.0%
add-sqr-sqrt91.1%
Applied egg-rr91.1%
associate--l+92.3%
+-inverses92.3%
metadata-eval92.3%
Simplified92.3%
Taylor expanded in x around 0 31.1%
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 2024132
(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))))