
(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 23 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 t) (sqrt (+ 1.0 t))))
(t_2 (sqrt (+ y 1.0)))
(t_3 (- t_2 (sqrt y)))
(t_4 (sqrt (+ 1.0 x)))
(t_5 (+ (sqrt z) (sqrt (+ 1.0 z)))))
(if (<= t_3 0.3)
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (/ 1.0 (+ (sqrt x) t_4)) (/ 1.0 (+ (sqrt y) t_2))))
(+
(- t_4 (sqrt x))
(+ t_3 (/ (fma t_1 (+ 1.0 (- z z)) t_5) (* t_1 t_5)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(t) + sqrt((1.0 + t));
double t_2 = sqrt((y + 1.0));
double t_3 = t_2 - sqrt(y);
double t_4 = sqrt((1.0 + x));
double t_5 = sqrt(z) + sqrt((1.0 + z));
double tmp;
if (t_3 <= 0.3) {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + t_4)) + (1.0 / (sqrt(y) + t_2)));
} else {
tmp = (t_4 - sqrt(x)) + (t_3 + (fma(t_1, (1.0 + (z - z)), t_5) / (t_1 * t_5)));
}
return tmp;
}
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(t) + sqrt(Float64(1.0 + t))) t_2 = sqrt(Float64(y + 1.0)) t_3 = Float64(t_2 - sqrt(y)) t_4 = sqrt(Float64(1.0 + x)) t_5 = Float64(sqrt(z) + sqrt(Float64(1.0 + z))) tmp = 0.0 if (t_3 <= 0.3) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 / Float64(sqrt(x) + t_4)) + Float64(1.0 / Float64(sqrt(y) + t_2)))); else tmp = Float64(Float64(t_4 - sqrt(x)) + Float64(t_3 + Float64(fma(t_1, Float64(1.0 + Float64(z - z)), t_5) / Float64(t_1 * t_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[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.3], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(N[(t$95$1 * N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] / N[(t$95$1 * 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{t} + \sqrt{1 + t}\\
t_2 := \sqrt{y + 1}\\
t_3 := t\_2 - \sqrt{y}\\
t_4 := \sqrt{1 + x}\\
t_5 := \sqrt{z} + \sqrt{1 + z}\\
\mathbf{if}\;t\_3 \leq 0.3:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\frac{1}{\sqrt{x} + t\_4} + \frac{1}{\sqrt{y} + t\_2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_4 - \sqrt{x}\right) + \left(t\_3 + \frac{\mathsf{fma}\left(t\_1, 1 + \left(z - z\right), t\_5\right)}{t\_1 \cdot t\_5}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 0.299999999999999989Initial program 84.8%
associate-+l+84.8%
associate-+l+84.8%
+-commutative84.8%
+-commutative84.8%
associate-+l-65.5%
+-commutative65.5%
+-commutative65.5%
Simplified65.5%
Taylor expanded in t around inf 43.9%
flip--43.8%
div-inv43.8%
add-sqr-sqrt24.8%
add-sqr-sqrt44.0%
associate--l+46.3%
Applied egg-rr46.3%
+-inverses46.3%
metadata-eval46.3%
*-lft-identity46.3%
+-commutative46.3%
Simplified46.3%
flip--46.3%
div-inv46.3%
add-sqr-sqrt40.0%
+-commutative40.0%
add-sqr-sqrt46.9%
associate--l+49.6%
+-commutative49.6%
Applied egg-rr49.6%
+-inverses49.6%
metadata-eval49.6%
*-lft-identity49.6%
+-commutative49.6%
Simplified49.6%
Taylor expanded in z around inf 30.1%
if 0.299999999999999989 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 98.0%
associate-+l+98.0%
associate-+l+98.0%
+-commutative98.0%
+-commutative98.0%
associate-+l-85.1%
+-commutative85.1%
+-commutative85.1%
Simplified85.1%
associate--r-98.0%
flip--98.0%
flip--98.1%
frac-add98.1%
Applied egg-rr99.1%
+-commutative99.1%
fma-define99.1%
+-commutative99.1%
associate-+r-99.1%
+-commutative99.1%
associate-+r-99.4%
+-inverses99.4%
metadata-eval99.4%
*-lft-identity99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
Simplified99.4%
Final simplification63.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)))
(t_3 (- t_2 (sqrt x)))
(t_4 (sqrt (+ y 1.0))))
(if (<= (+ (+ t_3 (- t_4 (sqrt y))) (- t_1 (sqrt z))) 2.000004)
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (/ 1.0 (+ (sqrt x) t_2)) (/ 1.0 (+ (sqrt y) t_4))))
(+
(+ (/ (+ z (- 1.0 z)) (+ (sqrt z) t_1)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ t_3 (- 1.0 (sqrt y)))))))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 t_3 = t_2 - sqrt(x);
double t_4 = sqrt((y + 1.0));
double tmp;
if (((t_3 + (t_4 - sqrt(y))) + (t_1 - sqrt(z))) <= 2.000004) {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + t_2)) + (1.0 / (sqrt(y) + t_4)));
} else {
tmp = (((z + (1.0 - z)) / (sqrt(z) + t_1)) + (sqrt((1.0 + t)) - sqrt(t))) + (t_3 + (1.0 - 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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
t_3 = t_2 - sqrt(x)
t_4 = sqrt((y + 1.0d0))
if (((t_3 + (t_4 - sqrt(y))) + (t_1 - sqrt(z))) <= 2.000004d0) then
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 / (sqrt(x) + t_2)) + (1.0d0 / (sqrt(y) + t_4)))
else
tmp = (((z + (1.0d0 - z)) / (sqrt(z) + t_1)) + (sqrt((1.0d0 + t)) - sqrt(t))) + (t_3 + (1.0d0 - 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((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = t_2 - Math.sqrt(x);
double t_4 = Math.sqrt((y + 1.0));
double tmp;
if (((t_3 + (t_4 - Math.sqrt(y))) + (t_1 - Math.sqrt(z))) <= 2.000004) {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 / (Math.sqrt(x) + t_2)) + (1.0 / (Math.sqrt(y) + t_4)));
} else {
tmp = (((z + (1.0 - z)) / (Math.sqrt(z) + t_1)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (t_3 + (1.0 - Math.sqrt(y)));
}
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)) t_3 = t_2 - math.sqrt(x) t_4 = math.sqrt((y + 1.0)) tmp = 0 if ((t_3 + (t_4 - math.sqrt(y))) + (t_1 - math.sqrt(z))) <= 2.000004: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 / (math.sqrt(x) + t_2)) + (1.0 / (math.sqrt(y) + t_4))) else: tmp = (((z + (1.0 - z)) / (math.sqrt(z) + t_1)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (t_3 + (1.0 - math.sqrt(y))) 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)) t_3 = Float64(t_2 - sqrt(x)) t_4 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (Float64(Float64(t_3 + Float64(t_4 - sqrt(y))) + Float64(t_1 - sqrt(z))) <= 2.000004) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(1.0 / Float64(sqrt(y) + t_4)))); else tmp = Float64(Float64(Float64(Float64(z + Float64(1.0 - z)) / Float64(sqrt(z) + t_1)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(t_3 + Float64(1.0 - 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((1.0 + z));
t_2 = sqrt((1.0 + x));
t_3 = t_2 - sqrt(x);
t_4 = sqrt((y + 1.0));
tmp = 0.0;
if (((t_3 + (t_4 - sqrt(y))) + (t_1 - sqrt(z))) <= 2.000004)
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + t_2)) + (1.0 / (sqrt(y) + t_4)));
else
tmp = (((z + (1.0 - z)) / (sqrt(z) + t_1)) + (sqrt((1.0 + t)) - sqrt(t))) + (t_3 + (1.0 - 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[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$3 + N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.000004], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z + N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(1.0 - 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{1 + z}\\
t_2 := \sqrt{1 + x}\\
t_3 := t\_2 - \sqrt{x}\\
t_4 := \sqrt{y + 1}\\
\mathbf{if}\;\left(t\_3 + \left(t\_4 - \sqrt{y}\right)\right) + \left(t\_1 - \sqrt{z}\right) \leq 2.000004:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\frac{1}{\sqrt{x} + t\_2} + \frac{1}{\sqrt{y} + t\_4}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z + \left(1 - z\right)}{\sqrt{z} + t\_1} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(t\_3 + \left(1 - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.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))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 2.00000400000000012Initial program 90.0%
associate-+l+90.0%
associate-+l+90.0%
+-commutative90.0%
+-commutative90.0%
associate-+l-76.3%
+-commutative76.3%
+-commutative76.3%
Simplified76.3%
Taylor expanded in t around inf 48.8%
flip--48.8%
div-inv48.8%
add-sqr-sqrt37.2%
add-sqr-sqrt48.8%
associate--l+50.2%
Applied egg-rr50.2%
+-inverses50.2%
metadata-eval50.2%
*-lft-identity50.2%
+-commutative50.2%
Simplified50.2%
flip--50.1%
div-inv50.1%
add-sqr-sqrt41.4%
+-commutative41.4%
add-sqr-sqrt50.7%
associate--l+52.4%
+-commutative52.4%
Applied egg-rr52.4%
+-inverses52.4%
metadata-eval52.4%
*-lft-identity52.4%
+-commutative52.4%
Simplified52.4%
Taylor expanded in z around inf 37.8%
if 2.00000400000000012 < (+.f64 (+.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))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) 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-sqrt98.3%
+-commutative98.3%
add-sqr-sqrt98.3%
associate--l+98.3%
Applied egg-rr98.3%
Taylor expanded in y around 0 94.3%
Final simplification45.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 t) (sqrt (+ 1.0 t))))
(t_2 (sqrt (+ y 1.0)))
(t_3 (sqrt (+ 1.0 x)))
(t_4 (+ (sqrt z) (sqrt (+ 1.0 z)))))
(if (<= z 18500000000.0)
(+
(- t_3 (sqrt x))
(+
(- t_2 (sqrt y))
(/ (+ (* (+ 1.0 (- t t)) t_4) (* t_1 (+ z (- 1.0 z)))) (* t_1 t_4))))
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (/ 1.0 (+ (sqrt x) t_3)) (/ 1.0 (+ (sqrt y) t_2)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(t) + sqrt((1.0 + t));
double t_2 = sqrt((y + 1.0));
double t_3 = sqrt((1.0 + x));
double t_4 = sqrt(z) + sqrt((1.0 + z));
double tmp;
if (z <= 18500000000.0) {
tmp = (t_3 - sqrt(x)) + ((t_2 - sqrt(y)) + ((((1.0 + (t - t)) * t_4) + (t_1 * (z + (1.0 - z)))) / (t_1 * t_4)));
} else {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + t_3)) + (1.0 / (sqrt(y) + t_2)));
}
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(t) + sqrt((1.0d0 + t))
t_2 = sqrt((y + 1.0d0))
t_3 = sqrt((1.0d0 + x))
t_4 = sqrt(z) + sqrt((1.0d0 + z))
if (z <= 18500000000.0d0) then
tmp = (t_3 - sqrt(x)) + ((t_2 - sqrt(y)) + ((((1.0d0 + (t - t)) * t_4) + (t_1 * (z + (1.0d0 - z)))) / (t_1 * t_4)))
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 / (sqrt(x) + t_3)) + (1.0d0 / (sqrt(y) + t_2)))
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(t) + Math.sqrt((1.0 + t));
double t_2 = Math.sqrt((y + 1.0));
double t_3 = Math.sqrt((1.0 + x));
double t_4 = Math.sqrt(z) + Math.sqrt((1.0 + z));
double tmp;
if (z <= 18500000000.0) {
tmp = (t_3 - Math.sqrt(x)) + ((t_2 - Math.sqrt(y)) + ((((1.0 + (t - t)) * t_4) + (t_1 * (z + (1.0 - z)))) / (t_1 * t_4)));
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 / (Math.sqrt(x) + t_3)) + (1.0 / (Math.sqrt(y) + t_2)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(t) + math.sqrt((1.0 + t)) t_2 = math.sqrt((y + 1.0)) t_3 = math.sqrt((1.0 + x)) t_4 = math.sqrt(z) + math.sqrt((1.0 + z)) tmp = 0 if z <= 18500000000.0: tmp = (t_3 - math.sqrt(x)) + ((t_2 - math.sqrt(y)) + ((((1.0 + (t - t)) * t_4) + (t_1 * (z + (1.0 - z)))) / (t_1 * t_4))) else: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 / (math.sqrt(x) + t_3)) + (1.0 / (math.sqrt(y) + t_2))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(t) + sqrt(Float64(1.0 + t))) t_2 = sqrt(Float64(y + 1.0)) t_3 = sqrt(Float64(1.0 + x)) t_4 = Float64(sqrt(z) + sqrt(Float64(1.0 + z))) tmp = 0.0 if (z <= 18500000000.0) tmp = Float64(Float64(t_3 - sqrt(x)) + Float64(Float64(t_2 - sqrt(y)) + Float64(Float64(Float64(Float64(1.0 + Float64(t - t)) * t_4) + Float64(t_1 * Float64(z + Float64(1.0 - z)))) / Float64(t_1 * t_4)))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 / Float64(sqrt(x) + t_3)) + Float64(1.0 / Float64(sqrt(y) + t_2)))); 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(t) + sqrt((1.0 + t));
t_2 = sqrt((y + 1.0));
t_3 = sqrt((1.0 + x));
t_4 = sqrt(z) + sqrt((1.0 + z));
tmp = 0.0;
if (z <= 18500000000.0)
tmp = (t_3 - sqrt(x)) + ((t_2 - sqrt(y)) + ((((1.0 + (t - t)) * t_4) + (t_1 * (z + (1.0 - z)))) / (t_1 * t_4)));
else
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + t_3)) + (1.0 / (sqrt(y) + t_2)));
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[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 18500000000.0], N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(1.0 + N[(t - t), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$1 * N[(z + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{t} + \sqrt{1 + t}\\
t_2 := \sqrt{y + 1}\\
t_3 := \sqrt{1 + x}\\
t_4 := \sqrt{z} + \sqrt{1 + z}\\
\mathbf{if}\;z \leq 18500000000:\\
\;\;\;\;\left(t\_3 - \sqrt{x}\right) + \left(\left(t\_2 - \sqrt{y}\right) + \frac{\left(1 + \left(t - t\right)\right) \cdot t\_4 + t\_1 \cdot \left(z + \left(1 - z\right)\right)}{t\_1 \cdot t\_4}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\frac{1}{\sqrt{x} + t\_3} + \frac{1}{\sqrt{y} + t\_2}\right)\\
\end{array}
\end{array}
if z < 1.85e10Initial program 97.7%
associate-+l+97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
associate-+l-61.2%
+-commutative61.2%
+-commutative61.2%
Simplified61.2%
associate--r-97.7%
flip--97.9%
flip--97.9%
frac-add98.0%
Applied egg-rr98.8%
if 1.85e10 < z Initial program 85.8%
associate-+l+85.8%
associate-+l+85.8%
+-commutative85.8%
+-commutative85.8%
associate-+l-85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 44.4%
flip--44.4%
div-inv44.4%
add-sqr-sqrt37.8%
add-sqr-sqrt44.4%
associate--l+46.6%
Applied egg-rr46.6%
+-inverses46.6%
metadata-eval46.6%
*-lft-identity46.6%
+-commutative46.6%
Simplified46.6%
flip--46.6%
div-inv46.6%
add-sqr-sqrt42.2%
+-commutative42.2%
add-sqr-sqrt47.3%
associate--l+49.9%
+-commutative49.9%
Applied egg-rr49.9%
+-inverses49.9%
metadata-eval49.9%
*-lft-identity49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in z around inf 54.4%
Final simplification74.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 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0)))))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (sqrt (+ 1.0 x))))
(if (<= (- t_2 (sqrt z)) 4e-6)
(+ (* 0.5 (sqrt (/ 1.0 z))) (+ (/ 1.0 (+ (sqrt x) t_3)) t_1))
(+
(+ t_1 (- t_3 (sqrt x)))
(+
(/ (+ z (- 1.0 z)) (+ (sqrt z) t_2))
(- (sqrt (+ 1.0 t)) (sqrt t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt(y) + sqrt((y + 1.0)));
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((1.0 + x));
double tmp;
if ((t_2 - sqrt(z)) <= 4e-6) {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + t_3)) + t_1);
} else {
tmp = (t_1 + (t_3 - sqrt(x))) + (((z + (1.0 - z)) / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(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 = 1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + x))
if ((t_2 - sqrt(z)) <= 4d-6) then
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 / (sqrt(x) + t_3)) + t_1)
else
tmp = (t_1 + (t_3 - sqrt(x))) + (((z + (1.0d0 - z)) / (sqrt(z) + t_2)) + (sqrt((1.0d0 + t)) - sqrt(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 = 1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if ((t_2 - Math.sqrt(z)) <= 4e-6) {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 / (Math.sqrt(x) + t_3)) + t_1);
} else {
tmp = (t_1 + (t_3 - Math.sqrt(x))) + (((z + (1.0 - z)) / (Math.sqrt(z) + t_2)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((1.0 + x)) tmp = 0 if (t_2 - math.sqrt(z)) <= 4e-6: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 / (math.sqrt(x) + t_3)) + t_1) else: tmp = (t_1 + (t_3 - math.sqrt(x))) + (((z + (1.0 - z)) / (math.sqrt(z) + t_2)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))) t_2 = sqrt(Float64(1.0 + z)) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_2 - sqrt(z)) <= 4e-6) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 / Float64(sqrt(x) + t_3)) + t_1)); else tmp = Float64(Float64(t_1 + Float64(t_3 - sqrt(x))) + Float64(Float64(Float64(z + Float64(1.0 - z)) / Float64(sqrt(z) + t_2)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(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 = 1.0 / (sqrt(y) + sqrt((y + 1.0)));
t_2 = sqrt((1.0 + z));
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if ((t_2 - sqrt(z)) <= 4e-6)
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + t_3)) + t_1);
else
tmp = (t_1 + (t_3 - sqrt(x))) + (((z + (1.0 - z)) / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(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[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], 4e-6], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z + N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{y} + \sqrt{y + 1}}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;t\_2 - \sqrt{z} \leq 4 \cdot 10^{-6}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\frac{1}{\sqrt{x} + t\_3} + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \left(t\_3 - \sqrt{x}\right)\right) + \left(\frac{z + \left(1 - z\right)}{\sqrt{z} + t\_2} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) < 3.99999999999999982e-6Initial program 85.8%
associate-+l+85.8%
associate-+l+85.8%
+-commutative85.8%
+-commutative85.8%
associate-+l-85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 44.4%
flip--44.4%
div-inv44.4%
add-sqr-sqrt37.8%
add-sqr-sqrt44.4%
associate--l+46.6%
Applied egg-rr46.6%
+-inverses46.6%
metadata-eval46.6%
*-lft-identity46.6%
+-commutative46.6%
Simplified46.6%
flip--46.6%
div-inv46.6%
add-sqr-sqrt42.2%
+-commutative42.2%
add-sqr-sqrt47.3%
associate--l+49.9%
+-commutative49.9%
Applied egg-rr49.9%
+-inverses49.9%
metadata-eval49.9%
*-lft-identity49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in z around inf 54.4%
if 3.99999999999999982e-6 < (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
flip--97.8%
add-sqr-sqrt97.7%
+-commutative97.7%
add-sqr-sqrt97.9%
associate--l+97.9%
Applied egg-rr97.9%
flip--57.3%
div-inv57.3%
add-sqr-sqrt43.2%
add-sqr-sqrt57.5%
associate--l+57.5%
Applied egg-rr98.6%
+-inverses57.5%
metadata-eval57.5%
*-lft-identity57.5%
+-commutative57.5%
Simplified98.6%
Final simplification74.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 1.0))) (t_2 (sqrt (+ 1.0 z))) (t_3 (sqrt (+ 1.0 x))))
(if (<= (- t_2 (sqrt z)) 4e-6)
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (/ 1.0 (+ (sqrt x) t_3)) (/ 1.0 (+ (sqrt y) t_1))))
(+
(+ (/ (+ z (- 1.0 z)) (+ (sqrt z) t_2)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (- t_3 (sqrt x)) (- 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 + z));
double t_3 = sqrt((1.0 + x));
double tmp;
if ((t_2 - sqrt(z)) <= 4e-6) {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + t_3)) + (1.0 / (sqrt(y) + t_1)));
} else {
tmp = (((z + (1.0 - z)) / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(t))) + ((t_3 - sqrt(x)) + (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) :: t_3
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + x))
if ((t_2 - sqrt(z)) <= 4d-6) then
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 / (sqrt(x) + t_3)) + (1.0d0 / (sqrt(y) + t_1)))
else
tmp = (((z + (1.0d0 - z)) / (sqrt(z) + t_2)) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((t_3 - sqrt(x)) + (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 + z));
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if ((t_2 - Math.sqrt(z)) <= 4e-6) {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 / (Math.sqrt(x) + t_3)) + (1.0 / (Math.sqrt(y) + t_1)));
} else {
tmp = (((z + (1.0 - z)) / (Math.sqrt(z) + t_2)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((t_3 - Math.sqrt(x)) + (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 + z)) t_3 = math.sqrt((1.0 + x)) tmp = 0 if (t_2 - math.sqrt(z)) <= 4e-6: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 / (math.sqrt(x) + t_3)) + (1.0 / (math.sqrt(y) + t_1))) else: tmp = (((z + (1.0 - z)) / (math.sqrt(z) + t_2)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((t_3 - math.sqrt(x)) + (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 + z)) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_2 - sqrt(z)) <= 4e-6) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 / Float64(sqrt(x) + t_3)) + Float64(1.0 / Float64(sqrt(y) + t_1)))); else tmp = Float64(Float64(Float64(Float64(z + Float64(1.0 - z)) / Float64(sqrt(z) + t_2)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(t_3 - sqrt(x)) + 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 + z));
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if ((t_2 - sqrt(z)) <= 4e-6)
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + t_3)) + (1.0 / (sqrt(y) + t_1)));
else
tmp = (((z + (1.0 - z)) / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(t))) + ((t_3 - sqrt(x)) + (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 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], 4e-6], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z + N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - N[Sqrt[x], $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 + z}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;t\_2 - \sqrt{z} \leq 4 \cdot 10^{-6}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\frac{1}{\sqrt{x} + t\_3} + \frac{1}{\sqrt{y} + t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z + \left(1 - z\right)}{\sqrt{z} + t\_2} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(t\_3 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) < 3.99999999999999982e-6Initial program 85.8%
associate-+l+85.8%
associate-+l+85.8%
+-commutative85.8%
+-commutative85.8%
associate-+l-85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 44.4%
flip--44.4%
div-inv44.4%
add-sqr-sqrt37.8%
add-sqr-sqrt44.4%
associate--l+46.6%
Applied egg-rr46.6%
+-inverses46.6%
metadata-eval46.6%
*-lft-identity46.6%
+-commutative46.6%
Simplified46.6%
flip--46.6%
div-inv46.6%
add-sqr-sqrt42.2%
+-commutative42.2%
add-sqr-sqrt47.3%
associate--l+49.9%
+-commutative49.9%
Applied egg-rr49.9%
+-inverses49.9%
metadata-eval49.9%
*-lft-identity49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in z around inf 54.4%
if 3.99999999999999982e-6 < (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
flip--97.8%
add-sqr-sqrt97.7%
+-commutative97.7%
add-sqr-sqrt97.9%
associate--l+97.9%
Applied egg-rr97.9%
Final simplification73.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 (+ y 1.0))) (t_2 (sqrt (+ 1.0 x))))
(if (<= z 6.6e-29)
(+
(- t_2 (sqrt x))
(+ (- t_1 (sqrt y)) (+ 1.0 (- (sqrt (+ 1.0 t)) (+ (sqrt t) (sqrt z))))))
(+
(/ 1.0 (+ (sqrt x) t_2))
(+ (/ 1.0 (+ (sqrt y) 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((y + 1.0));
double t_2 = sqrt((1.0 + x));
double tmp;
if (z <= 6.6e-29) {
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 + (sqrt((1.0 + t)) - (sqrt(t) + sqrt(z)))));
} else {
tmp = (1.0 / (sqrt(x) + t_2)) + ((1.0 / (sqrt(y) + 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) :: t_2
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt((1.0d0 + x))
if (z <= 6.6d-29) then
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0d0 + (sqrt((1.0d0 + t)) - (sqrt(t) + sqrt(z)))))
else
tmp = (1.0d0 / (sqrt(x) + t_2)) + ((1.0d0 / (sqrt(y) + 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((y + 1.0));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 6.6e-29) {
tmp = (t_2 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + (1.0 + (Math.sqrt((1.0 + t)) - (Math.sqrt(t) + Math.sqrt(z)))));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_2)) + ((1.0 / (Math.sqrt(y) + 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((y + 1.0)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if z <= 6.6e-29: tmp = (t_2 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + (1.0 + (math.sqrt((1.0 + t)) - (math.sqrt(t) + math.sqrt(z))))) else: tmp = (1.0 / (math.sqrt(x) + t_2)) + ((1.0 / (math.sqrt(y) + 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(y + 1.0)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 6.6e-29) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(t) + sqrt(z)))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(Float64(1.0 / Float64(sqrt(y) + 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((y + 1.0));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 6.6e-29)
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 + (sqrt((1.0 + t)) - (sqrt(t) + sqrt(z)))));
else
tmp = (1.0 / (sqrt(x) + t_2)) + ((1.0 / (sqrt(y) + 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[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 6.6e-29], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $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 6.6 \cdot 10^{-29}:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(1 + \left(\sqrt{1 + t} - \left(\sqrt{t} + \sqrt{z}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_2} + \left(\frac{1}{\sqrt{y} + t\_1} + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if z < 6.60000000000000055e-29Initial program 97.9%
associate-+l+97.9%
associate-+l+97.9%
+-commutative97.9%
+-commutative97.9%
associate-+l-61.2%
+-commutative61.2%
+-commutative61.2%
Simplified61.2%
Taylor expanded in z around 0 61.2%
associate--l+97.8%
Simplified97.8%
if 6.60000000000000055e-29 < z Initial program 86.9%
associate-+l+86.9%
associate-+l+86.9%
+-commutative86.9%
+-commutative86.9%
associate-+l-83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 45.6%
flip--45.6%
div-inv45.6%
add-sqr-sqrt36.7%
add-sqr-sqrt45.6%
associate--l+47.6%
Applied egg-rr47.6%
+-inverses47.6%
metadata-eval47.6%
*-lft-identity47.6%
+-commutative47.6%
Simplified47.6%
flip--47.5%
div-inv47.5%
add-sqr-sqrt42.2%
+-commutative42.2%
add-sqr-sqrt48.2%
associate--l+50.6%
+-commutative50.6%
Applied egg-rr50.6%
+-inverses50.6%
metadata-eval50.6%
*-lft-identity50.6%
+-commutative50.6%
Simplified50.6%
Final simplification68.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 1.0))) (t_2 (sqrt (+ 1.0 x))))
(if (<= z 16800000000.0)
(+
(- t_2 (sqrt x))
(+ (- t_1 (sqrt y)) (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (/ 1.0 (+ (sqrt x) t_2)) (/ 1.0 (+ (sqrt y) t_1)))))))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 <= 16800000000.0) {
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 / (sqrt(z) + sqrt((1.0 + z)))));
} else {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + t_2)) + (1.0 / (sqrt(y) + 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 + 1.0d0))
t_2 = sqrt((1.0d0 + x))
if (z <= 16800000000.0d0) then
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))))
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 / (sqrt(x) + t_2)) + (1.0d0 / (sqrt(y) + 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 + 1.0));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 16800000000.0) {
tmp = (t_2 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))));
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 / (Math.sqrt(x) + t_2)) + (1.0 / (Math.sqrt(y) + t_1)));
}
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 <= 16800000000.0: tmp = (t_2 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))) else: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 / (math.sqrt(x) + t_2)) + (1.0 / (math.sqrt(y) + t_1))) 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 <= 16800000000.0) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(1.0 / Float64(sqrt(y) + 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 + 1.0));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 16800000000.0)
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 / (sqrt(z) + sqrt((1.0 + z)))));
else
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + t_2)) + (1.0 / (sqrt(y) + 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[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 16800000000.0], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $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 16800000000:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\frac{1}{\sqrt{x} + t\_2} + \frac{1}{\sqrt{y} + t\_1}\right)\\
\end{array}
\end{array}
if z < 1.68e10Initial program 97.7%
associate-+l+97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
associate-+l-61.2%
+-commutative61.2%
+-commutative61.2%
Simplified61.2%
associate--r-97.7%
flip--97.9%
flip--97.9%
frac-add98.0%
Applied egg-rr98.8%
+-commutative98.8%
fma-define98.8%
+-commutative98.8%
associate-+r-98.8%
+-commutative98.8%
associate-+r-98.8%
+-inverses98.8%
metadata-eval98.8%
*-lft-identity98.8%
+-commutative98.8%
+-commutative98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in t around inf 57.4%
if 1.68e10 < z Initial program 85.8%
associate-+l+85.8%
associate-+l+85.8%
+-commutative85.8%
+-commutative85.8%
associate-+l-85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 44.4%
flip--44.4%
div-inv44.4%
add-sqr-sqrt37.8%
add-sqr-sqrt44.4%
associate--l+46.6%
Applied egg-rr46.6%
+-inverses46.6%
metadata-eval46.6%
*-lft-identity46.6%
+-commutative46.6%
Simplified46.6%
flip--46.6%
div-inv46.6%
add-sqr-sqrt42.2%
+-commutative42.2%
add-sqr-sqrt47.3%
associate--l+49.9%
+-commutative49.9%
Applied egg-rr49.9%
+-inverses49.9%
metadata-eval49.9%
*-lft-identity49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in z around inf 54.4%
Final simplification55.7%
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) (sqrt (+ 1.0 x)))) (+ (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0)))) (- (sqrt (+ 1.0 z)) (sqrt z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((1.0 / (sqrt(y) + sqrt((y + 1.0)))) + (sqrt((1.0 + z)) - sqrt(z)));
}
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) + sqrt((1.0d0 + x)))) + ((1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))) + (sqrt((1.0d0 + z)) - sqrt(z)))
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) + Math.sqrt((1.0 + x)))) + ((1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((1.0 / (math.sqrt(y) + math.sqrt((y + 1.0)))) + (math.sqrt((1.0 + z)) - math.sqrt(z)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((1.0 / (sqrt(y) + sqrt((y + 1.0)))) + (sqrt((1.0 + z)) - sqrt(z)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\frac{1}{\sqrt{y} + \sqrt{y + 1}} + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)
\end{array}
Initial program 91.1%
associate-+l+91.1%
associate-+l+91.1%
+-commutative91.1%
+-commutative91.1%
associate-+l-74.8%
+-commutative74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in t around inf 50.2%
flip--50.2%
div-inv50.2%
add-sqr-sqrt40.2%
add-sqr-sqrt50.3%
associate--l+51.5%
Applied egg-rr51.5%
+-inverses51.5%
metadata-eval51.5%
*-lft-identity51.5%
+-commutative51.5%
Simplified51.5%
flip--51.4%
div-inv51.4%
add-sqr-sqrt43.8%
+-commutative43.8%
add-sqr-sqrt51.9%
associate--l+53.4%
+-commutative53.4%
Applied egg-rr53.4%
+-inverses53.4%
metadata-eval53.4%
*-lft-identity53.4%
+-commutative53.4%
Simplified53.4%
Final simplification53.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 1.0))))
(if (<= z 60000000.0)
(+ (- 1.0 (sqrt x)) (+ (- t_1 (sqrt y)) (- (sqrt (+ 1.0 z)) (sqrt z))))
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_1)))))))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 tmp;
if (z <= 60000000.0) {
tmp = (1.0 - sqrt(x)) + ((t_1 - sqrt(y)) + (sqrt((1.0 + z)) - sqrt(z)));
} else {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + 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((y + 1.0d0))
if (z <= 60000000.0d0) then
tmp = (1.0d0 - sqrt(x)) + ((t_1 - sqrt(y)) + (sqrt((1.0d0 + z)) - sqrt(z)))
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + 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 + 1.0));
double tmp;
if (z <= 60000000.0) {
tmp = (1.0 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_1)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 60000000.0: tmp = (1.0 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + (math.sqrt((1.0 + z)) - math.sqrt(z))) else: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_1))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 60000000.0) tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + 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 + 1.0));
tmp = 0.0;
if (z <= 60000000.0)
tmp = (1.0 - sqrt(x)) + ((t_1 - sqrt(y)) + (sqrt((1.0 + z)) - sqrt(z)));
else
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + 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[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 60000000.0], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $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}\\
\mathbf{if}\;z \leq 60000000:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_1}\right)\\
\end{array}
\end{array}
if z < 6e7Initial program 97.8%
associate-+l+97.8%
associate-+l+97.8%
+-commutative97.8%
+-commutative97.8%
associate-+l-61.0%
+-commutative61.0%
+-commutative61.0%
Simplified61.0%
Taylor expanded in t around inf 57.6%
Taylor expanded in x around 0 35.2%
if 6e7 < z Initial program 85.8%
associate-+l+85.8%
associate-+l+85.8%
+-commutative85.8%
+-commutative85.8%
associate-+l-85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 44.3%
flip--44.3%
div-inv44.3%
add-sqr-sqrt37.5%
add-sqr-sqrt44.3%
associate--l+46.5%
Applied egg-rr46.5%
+-inverses46.5%
metadata-eval46.5%
*-lft-identity46.5%
+-commutative46.5%
Simplified46.5%
flip--46.4%
div-inv46.4%
add-sqr-sqrt42.1%
+-commutative42.1%
add-sqr-sqrt47.1%
associate--l+49.8%
+-commutative49.8%
Applied egg-rr49.8%
+-inverses49.8%
metadata-eval49.8%
*-lft-identity49.8%
+-commutative49.8%
Simplified49.8%
Taylor expanded in z around inf 54.2%
Final simplification45.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 (+ y 1.0))) (t_2 (sqrt (+ 1.0 x))))
(if (<= z 49000000.0)
(+ 1.0 (- (+ t_2 (sqrt (+ 1.0 z))) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(if (<= z 6.6e+30)
(+ 1.0 (- (+ (* 0.5 (sqrt (/ 1.0 z))) t_1) (+ (sqrt y) (sqrt x))))
(+ (/ 1.0 (+ (sqrt x) t_2)) (/ 1.0 (+ (sqrt y) t_1)))))))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 <= 49000000.0) {
tmp = 1.0 + ((t_2 + sqrt((1.0 + z))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else if (z <= 6.6e+30) {
tmp = 1.0 + (((0.5 * sqrt((1.0 / z))) + t_1) - (sqrt(y) + sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + t_2)) + (1.0 / (sqrt(y) + 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 + 1.0d0))
t_2 = sqrt((1.0d0 + x))
if (z <= 49000000.0d0) then
tmp = 1.0d0 + ((t_2 + sqrt((1.0d0 + z))) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else if (z <= 6.6d+30) then
tmp = 1.0d0 + (((0.5d0 * sqrt((1.0d0 / z))) + t_1) - (sqrt(y) + sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + t_2)) + (1.0d0 / (sqrt(y) + 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 + 1.0));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 49000000.0) {
tmp = 1.0 + ((t_2 + Math.sqrt((1.0 + z))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else if (z <= 6.6e+30) {
tmp = 1.0 + (((0.5 * Math.sqrt((1.0 / z))) + t_1) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_2)) + (1.0 / (Math.sqrt(y) + t_1));
}
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 <= 49000000.0: tmp = 1.0 + ((t_2 + math.sqrt((1.0 + z))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) elif z <= 6.6e+30: tmp = 1.0 + (((0.5 * math.sqrt((1.0 / z))) + t_1) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + t_2)) + (1.0 / (math.sqrt(y) + t_1)) 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 <= 49000000.0) tmp = Float64(1.0 + Float64(Float64(t_2 + sqrt(Float64(1.0 + z))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); elseif (z <= 6.6e+30) tmp = Float64(1.0 + Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + t_1) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(1.0 / Float64(sqrt(y) + 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 + 1.0));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 49000000.0)
tmp = 1.0 + ((t_2 + sqrt((1.0 + z))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
elseif (z <= 6.6e+30)
tmp = 1.0 + (((0.5 * sqrt((1.0 / z))) + t_1) - (sqrt(y) + sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + t_2)) + (1.0 / (sqrt(y) + 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[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 49000000.0], N[(1.0 + N[(N[(t$95$2 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e+30], N[(1.0 + N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $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 49000000:\\
\;\;\;\;1 + \left(\left(t\_2 + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+30}:\\
\;\;\;\;1 + \left(\left(0.5 \cdot \sqrt{\frac{1}{z}} + t\_1\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_2} + \frac{1}{\sqrt{y} + t\_1}\\
\end{array}
\end{array}
if z < 4.9e7Initial program 97.8%
associate-+l+97.8%
associate-+l+97.8%
+-commutative97.8%
+-commutative97.8%
associate-+l-61.0%
+-commutative61.0%
+-commutative61.0%
Simplified61.0%
Taylor expanded in t around inf 57.6%
Taylor expanded in y around 0 18.2%
associate--l+25.9%
+-commutative25.9%
+-commutative25.9%
Simplified25.9%
if 4.9e7 < z < 6.60000000000000053e30Initial program 69.4%
associate-+l+69.4%
associate-+l+69.4%
+-commutative69.4%
+-commutative69.4%
associate-+l-68.7%
+-commutative68.7%
+-commutative68.7%
Simplified68.7%
Taylor expanded in t around inf 45.2%
Taylor expanded in z around inf 25.4%
+-commutative25.4%
Simplified25.4%
Taylor expanded in x around 0 24.9%
associate--l+45.7%
Simplified45.7%
if 6.60000000000000053e30 < z Initial program 87.4%
associate-+l+87.4%
associate-+l+87.4%
+-commutative87.4%
+-commutative87.4%
associate-+l-87.4%
+-commutative87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in t around inf 44.2%
flip--44.2%
div-inv44.2%
add-sqr-sqrt37.0%
add-sqr-sqrt44.2%
associate--l+46.6%
Applied egg-rr46.6%
+-inverses46.6%
metadata-eval46.6%
*-lft-identity46.6%
+-commutative46.6%
Simplified46.6%
flip--46.5%
div-inv46.5%
add-sqr-sqrt41.8%
+-commutative41.8%
add-sqr-sqrt47.3%
associate--l+50.2%
+-commutative50.2%
Applied egg-rr50.2%
+-inverses50.2%
metadata-eval50.2%
*-lft-identity50.2%
+-commutative50.2%
Simplified50.2%
Taylor expanded in z around inf 50.2%
+-commutative50.2%
Simplified50.2%
Final simplification39.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 (+ y 1.0))))
(if (<= z 2.4e+16)
(+ (- 1.0 (sqrt x)) (+ (- t_1 (sqrt y)) (- (sqrt (+ 1.0 z)) (sqrt z))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_1))))))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 tmp;
if (z <= 2.4e+16) {
tmp = (1.0 - sqrt(x)) + ((t_1 - sqrt(y)) + (sqrt((1.0 + z)) - sqrt(z)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + 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((y + 1.0d0))
if (z <= 2.4d+16) then
tmp = (1.0d0 - sqrt(x)) + ((t_1 - sqrt(y)) + (sqrt((1.0d0 + z)) - sqrt(z)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + 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 + 1.0));
double tmp;
if (z <= 2.4e+16) {
tmp = (1.0 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 2.4e+16: tmp = (1.0 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + (math.sqrt((1.0 + z)) - math.sqrt(z))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 2.4e+16) tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + 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 + 1.0));
tmp = 0.0;
if (z <= 2.4e+16)
tmp = (1.0 - sqrt(x)) + ((t_1 - sqrt(y)) + (sqrt((1.0 + z)) - sqrt(z)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + 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[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.4e+16], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 2.4 \cdot 10^{+16}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_1}\\
\end{array}
\end{array}
if z < 2.4e16Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-61.2%
+-commutative61.2%
+-commutative61.2%
Simplified61.2%
Taylor expanded in t around inf 56.3%
Taylor expanded in x around 0 34.7%
if 2.4e16 < z Initial program 86.4%
associate-+l+86.4%
associate-+l+86.4%
+-commutative86.4%
+-commutative86.4%
associate-+l-86.4%
+-commutative86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in t around inf 44.9%
flip--44.9%
div-inv44.9%
add-sqr-sqrt38.1%
add-sqr-sqrt44.9%
associate--l+47.2%
Applied egg-rr47.2%
+-inverses47.2%
metadata-eval47.2%
*-lft-identity47.2%
+-commutative47.2%
Simplified47.2%
flip--47.1%
div-inv47.1%
add-sqr-sqrt42.6%
+-commutative42.6%
add-sqr-sqrt47.8%
associate--l+50.6%
+-commutative50.6%
Applied egg-rr50.6%
+-inverses50.6%
metadata-eval50.6%
*-lft-identity50.6%
+-commutative50.6%
Simplified50.6%
Taylor expanded in z around inf 50.6%
+-commutative50.6%
Simplified50.6%
Final simplification43.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 (+ y 1.0))))
(if (<= z 2.4e+16)
(- (+ 1.0 (+ t_1 (sqrt (+ 1.0 z)))) (+ (sqrt x) (+ (sqrt y) (sqrt z))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_1))))))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 tmp;
if (z <= 2.4e+16) {
tmp = (1.0 + (t_1 + sqrt((1.0 + z)))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + 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((y + 1.0d0))
if (z <= 2.4d+16) then
tmp = (1.0d0 + (t_1 + sqrt((1.0d0 + z)))) - (sqrt(x) + (sqrt(y) + sqrt(z)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + 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 + 1.0));
double tmp;
if (z <= 2.4e+16) {
tmp = (1.0 + (t_1 + Math.sqrt((1.0 + z)))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 2.4e+16: tmp = (1.0 + (t_1 + math.sqrt((1.0 + z)))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 2.4e+16) tmp = Float64(Float64(1.0 + Float64(t_1 + sqrt(Float64(1.0 + z)))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + 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 + 1.0));
tmp = 0.0;
if (z <= 2.4e+16)
tmp = (1.0 + (t_1 + sqrt((1.0 + z)))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + 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[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.4e+16], N[(N[(1.0 + N[(t$95$1 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 2.4 \cdot 10^{+16}:\\
\;\;\;\;\left(1 + \left(t\_1 + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_1}\\
\end{array}
\end{array}
if z < 2.4e16Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-61.2%
+-commutative61.2%
+-commutative61.2%
Simplified61.2%
Taylor expanded in t around inf 56.3%
Taylor expanded in x around 0 19.3%
+-commutative19.3%
+-commutative19.3%
Simplified19.3%
if 2.4e16 < z Initial program 86.4%
associate-+l+86.4%
associate-+l+86.4%
+-commutative86.4%
+-commutative86.4%
associate-+l-86.4%
+-commutative86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in t around inf 44.9%
flip--44.9%
div-inv44.9%
add-sqr-sqrt38.1%
add-sqr-sqrt44.9%
associate--l+47.2%
Applied egg-rr47.2%
+-inverses47.2%
metadata-eval47.2%
*-lft-identity47.2%
+-commutative47.2%
Simplified47.2%
flip--47.1%
div-inv47.1%
add-sqr-sqrt42.6%
+-commutative42.6%
add-sqr-sqrt47.8%
associate--l+50.6%
+-commutative50.6%
Applied egg-rr50.6%
+-inverses50.6%
metadata-eval50.6%
*-lft-identity50.6%
+-commutative50.6%
Simplified50.6%
Taylor expanded in z around inf 50.6%
+-commutative50.6%
Simplified50.6%
Final simplification36.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 (<= x 17000000000.0)
(- (+ t_1 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))) (sqrt x))
(/ 1.0 (+ (sqrt 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));
double tmp;
if (x <= 17000000000.0) {
tmp = (t_1 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + 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))
if (x <= 17000000000.0d0) then
tmp = (t_1 + (1.0d0 / (sqrt(y) + sqrt((y + 1.0d0))))) - sqrt(x)
else
tmp = 1.0d0 / (sqrt(x) + 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));
double tmp;
if (x <= 17000000000.0) {
tmp = (t_1 + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0))))) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + 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)) tmp = 0 if x <= 17000000000.0: tmp = (t_1 + (1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))))) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + t_1) 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 (x <= 17000000000.0) tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0))))) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + 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));
tmp = 0.0;
if (x <= 17000000000.0)
tmp = (t_1 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
else
tmp = 1.0 / (sqrt(x) + 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[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 17000000000.0], N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $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{1 + x}\\
\mathbf{if}\;x \leq 17000000000:\\
\;\;\;\;\left(t\_1 + \frac{1}{\sqrt{y} + \sqrt{y + 1}}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if x < 1.7e10Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-79.6%
+-commutative79.6%
+-commutative79.6%
Simplified79.6%
Taylor expanded in t around inf 59.2%
flip--59.2%
div-inv59.2%
add-sqr-sqrt44.7%
add-sqr-sqrt59.3%
associate--l+59.3%
Applied egg-rr59.3%
+-inverses59.3%
metadata-eval59.3%
*-lft-identity59.3%
+-commutative59.3%
Simplified59.3%
Taylor expanded in z around inf 40.2%
if 1.7e10 < x Initial program 83.9%
associate-+l+83.9%
associate-+l+83.9%
+-commutative83.9%
+-commutative83.9%
associate-+l-68.6%
+-commutative68.6%
+-commutative68.6%
Simplified68.6%
Taylor expanded in t around inf 38.4%
Taylor expanded in z around inf 4.6%
associate--l+5.6%
Simplified5.6%
Taylor expanded in y around inf 3.6%
flip--3.6%
add-sqr-sqrt4.1%
add-sqr-sqrt4.1%
+-commutative4.1%
Applied egg-rr4.1%
associate-+r-10.0%
+-inverses10.0%
metadata-eval10.0%
Simplified10.0%
Final simplification27.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 5e+27)
(+ t_1 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))
(/ 1.0 (+ (sqrt 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));
double tmp;
if (y <= 5e+27) {
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + 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))
if (y <= 5d+27) then
tmp = t_1 + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + 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));
double tmp;
if (y <= 5e+27) {
tmp = t_1 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + 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)) tmp = 0 if y <= 5e+27: tmp = t_1 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_1) 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 <= 5e+27) tmp = Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + 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));
tmp = 0.0;
if (y <= 5e+27)
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + 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[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5e+27], 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[(1.0 / N[(N[Sqrt[x], $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{1 + x}\\
\mathbf{if}\;y \leq 5 \cdot 10^{+27}:\\
\;\;\;\;t\_1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 4.99999999999999979e27Initial program 96.0%
associate-+l+96.0%
associate-+l+96.0%
+-commutative96.0%
+-commutative96.0%
associate-+l-83.6%
+-commutative83.6%
+-commutative83.6%
Simplified83.6%
Taylor expanded in t around inf 55.1%
Taylor expanded in z around inf 27.6%
associate--l+27.6%
Simplified27.6%
if 4.99999999999999979e27 < y Initial program 85.9%
associate-+l+85.9%
associate-+l+85.9%
+-commutative85.9%
+-commutative85.9%
associate-+l-65.5%
+-commutative65.5%
+-commutative65.5%
Simplified65.5%
Taylor expanded in t around inf 44.9%
Taylor expanded in z around inf 3.3%
associate--l+22.3%
Simplified22.3%
Taylor expanded in y around inf 22.0%
flip--22.0%
add-sqr-sqrt22.4%
add-sqr-sqrt22.4%
+-commutative22.4%
Applied egg-rr22.4%
associate-+r-26.3%
+-inverses26.3%
metadata-eval26.3%
Simplified26.3%
Final simplification27.0%
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) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + sqrt((y + 1.0))));
}
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) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + sqrt((y + 1.0d0))))
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) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + sqrt((y + 1.0))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + \sqrt{y + 1}}
\end{array}
Initial program 91.1%
associate-+l+91.1%
associate-+l+91.1%
+-commutative91.1%
+-commutative91.1%
associate-+l-74.8%
+-commutative74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in t around inf 50.2%
flip--50.2%
div-inv50.2%
add-sqr-sqrt40.2%
add-sqr-sqrt50.3%
associate--l+51.5%
Applied egg-rr51.5%
+-inverses51.5%
metadata-eval51.5%
*-lft-identity51.5%
+-commutative51.5%
Simplified51.5%
flip--51.4%
div-inv51.4%
add-sqr-sqrt43.8%
+-commutative43.8%
add-sqr-sqrt51.9%
associate--l+53.4%
+-commutative53.4%
Applied egg-rr53.4%
+-inverses53.4%
metadata-eval53.4%
*-lft-identity53.4%
+-commutative53.4%
Simplified53.4%
Taylor expanded in z around inf 34.9%
+-commutative34.9%
Simplified34.9%
Final simplification34.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 (<= y 380000000000.0) (+ 1.0 (- (- (sqrt (+ y 1.0)) (sqrt x)) (sqrt y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 380000000000.0) {
tmp = 1.0 + ((sqrt((y + 1.0)) - sqrt(x)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + 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 (y <= 380000000000.0d0) then
tmp = 1.0d0 + ((sqrt((y + 1.0d0)) - sqrt(x)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + 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 (y <= 380000000000.0) {
tmp = 1.0 + ((Math.sqrt((y + 1.0)) - Math.sqrt(x)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + 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 y <= 380000000000.0: tmp = 1.0 + ((math.sqrt((y + 1.0)) - math.sqrt(x)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + 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 (y <= 380000000000.0) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(x)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + 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 (y <= 380000000000.0)
tmp = 1.0 + ((sqrt((y + 1.0)) - sqrt(x)) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + 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[y, 380000000000.0], N[(1.0 + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $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}\;y \leq 380000000000:\\
\;\;\;\;1 + \left(\left(\sqrt{y + 1} - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 3.8e11Initial program 97.7%
associate-+l+97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
associate-+l-84.6%
+-commutative84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in t around inf 57.0%
Taylor expanded in z around inf 28.4%
associate--l+28.4%
Simplified28.4%
Taylor expanded in x around 0 25.6%
associate--l+25.6%
associate--r+25.6%
Simplified25.6%
if 3.8e11 < y Initial program 84.7%
associate-+l+84.7%
associate-+l+84.7%
+-commutative84.7%
+-commutative84.7%
associate-+l-65.3%
+-commutative65.3%
+-commutative65.3%
Simplified65.3%
Taylor expanded in t around inf 43.6%
Taylor expanded in z around inf 3.6%
associate--l+21.8%
Simplified21.8%
Taylor expanded in y around inf 21.5%
flip--21.5%
add-sqr-sqrt21.9%
add-sqr-sqrt21.9%
+-commutative21.9%
Applied egg-rr21.9%
associate-+r-25.7%
+-inverses25.7%
metadata-eval25.7%
Simplified25.7%
Final simplification25.6%
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.4e-13) (+ 1.0 (- (- (sqrt (+ y 1.0)) (sqrt y)) (sqrt x))) (/ 1.0 (+ (sqrt x) (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.4e-13) {
tmp = 1.0 + ((sqrt((y + 1.0)) - sqrt(y)) - sqrt(x));
} else {
tmp = 1.0 / (sqrt(x) + 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.4d-13) then
tmp = 1.0d0 + ((sqrt((y + 1.0d0)) - sqrt(y)) - sqrt(x))
else
tmp = 1.0d0 / (sqrt(x) + 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.4e-13) {
tmp = 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)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 5.4e-13: tmp = 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))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 5.4e-13) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) - sqrt(x))); else tmp = Float64(1.0 / Float64(sqrt(x) + 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.4e-13)
tmp = 1.0 + ((sqrt((y + 1.0)) - sqrt(y)) - sqrt(x));
else
tmp = 1.0 / (sqrt(x) + 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.4e-13], N[(1.0 + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $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 5.4 \cdot 10^{-13}:\\
\;\;\;\;1 + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if x < 5.40000000000000021e-13Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
associate-+l-79.8%
+-commutative79.8%
+-commutative79.8%
Simplified79.8%
Taylor expanded in t around inf 59.4%
Taylor expanded in z around inf 24.2%
associate--l+40.1%
Simplified40.1%
Taylor expanded in x around inf 35.8%
+-commutative35.8%
associate--r+36.0%
associate-*l/31.1%
*-lft-identity31.1%
associate-*l/36.0%
*-lft-identity36.0%
div-sub40.4%
Simplified40.4%
Taylor expanded in x around 0 24.2%
associate--l+40.1%
+-commutative40.1%
associate--r+40.4%
Simplified40.4%
if 5.40000000000000021e-13 < x Initial program 84.0%
associate-+l+84.0%
associate-+l+84.0%
+-commutative84.0%
+-commutative84.0%
associate-+l-68.7%
+-commutative68.7%
+-commutative68.7%
Simplified68.7%
Taylor expanded in t around inf 38.8%
Taylor expanded in z around inf 5.5%
associate--l+6.6%
Simplified6.6%
Taylor expanded in y around inf 4.0%
flip--4.0%
add-sqr-sqrt4.5%
add-sqr-sqrt4.5%
+-commutative4.5%
Applied egg-rr4.5%
associate-+r-10.1%
+-inverses10.1%
metadata-eval10.1%
Simplified10.1%
Final simplification26.8%
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) (sqrt (+ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 / (sqrt(x) + sqrt((1.0 + 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) + sqrt((1.0d0 + 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) + Math.sqrt((1.0 + x)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{x} + \sqrt{1 + x}}
\end{array}
Initial program 91.1%
associate-+l+91.1%
associate-+l+91.1%
+-commutative91.1%
+-commutative91.1%
associate-+l-74.8%
+-commutative74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in t around inf 50.2%
Taylor expanded in z around inf 15.8%
associate--l+25.1%
Simplified25.1%
Taylor expanded in y around inf 16.8%
flip--16.8%
add-sqr-sqrt17.0%
add-sqr-sqrt17.0%
+-commutative17.0%
Applied egg-rr17.0%
associate-+r-19.5%
+-inverses19.5%
metadata-eval19.5%
Simplified19.5%
Final simplification19.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 0.82) (- (+ 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.82) {
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.82d0) 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.82) {
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.82: 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.82) 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.82)
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.82], 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.82:\\
\;\;\;\;\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.819999999999999951Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
associate-+l-80.0%
+-commutative80.0%
+-commutative80.0%
Simplified80.0%
Taylor expanded in t around inf 59.2%
Taylor expanded in z around inf 24.2%
associate--l+40.0%
Simplified40.0%
Taylor expanded in y around inf 27.2%
Taylor expanded in x around 0 27.2%
if 0.819999999999999951 < x Initial program 83.9%
associate-+l+83.9%
associate-+l+83.9%
+-commutative83.9%
+-commutative83.9%
associate-+l-68.4%
+-commutative68.4%
+-commutative68.4%
Simplified68.4%
Taylor expanded in t around inf 39.0%
Taylor expanded in z around inf 5.4%
associate--l+6.5%
Simplified6.5%
Taylor expanded in y around inf 3.9%
Taylor expanded in x around inf 9.8%
Final simplification19.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 1.0) (- (+ 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 <= 1.0) {
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 <= 1.0d0) 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 <= 1.0) {
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 <= 1.0: 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 <= 1.0) 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 <= 1.0)
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, 1.0], 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 1:\\
\;\;\;\;\left(1 + 0.5 \cdot x\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
associate-+l-80.0%
+-commutative80.0%
+-commutative80.0%
Simplified80.0%
Taylor expanded in t around inf 59.2%
Taylor expanded in z around inf 24.2%
associate--l+40.0%
Simplified40.0%
Taylor expanded in y around inf 27.2%
Taylor expanded in x around 0 27.2%
*-commutative27.2%
Simplified27.2%
if 1 < x Initial program 83.9%
associate-+l+83.9%
associate-+l+83.9%
+-commutative83.9%
+-commutative83.9%
associate-+l-68.4%
+-commutative68.4%
+-commutative68.4%
Simplified68.4%
Taylor expanded in t around inf 39.0%
Taylor expanded in z around inf 5.4%
associate--l+6.5%
Simplified6.5%
Taylor expanded in y around inf 3.9%
Taylor expanded in x around inf 9.8%
Final simplification19.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 0.28) (- 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.28) {
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.28d0) 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.28) {
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.28: 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.28) 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.28)
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.28], 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.28:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.28000000000000003Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
associate-+l-80.0%
+-commutative80.0%
+-commutative80.0%
Simplified80.0%
Taylor expanded in t around inf 59.2%
Taylor expanded in z around inf 24.2%
associate--l+40.0%
Simplified40.0%
Taylor expanded in y around inf 27.2%
Taylor expanded in x around 0 27.2%
if 0.28000000000000003 < x Initial program 83.9%
associate-+l+83.9%
associate-+l+83.9%
+-commutative83.9%
+-commutative83.9%
associate-+l-68.4%
+-commutative68.4%
+-commutative68.4%
Simplified68.4%
Taylor expanded in t around inf 39.0%
Taylor expanded in z around inf 5.4%
associate--l+6.5%
Simplified6.5%
Taylor expanded in y around inf 3.9%
Taylor expanded in x around inf 9.8%
Final simplification19.4%
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 91.1%
associate-+l+91.1%
associate-+l+91.1%
+-commutative91.1%
+-commutative91.1%
associate-+l-74.8%
+-commutative74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in t around inf 50.2%
Taylor expanded in z around inf 15.8%
associate--l+25.1%
Simplified25.1%
Taylor expanded in y around inf 16.8%
Taylor expanded in x around 0 15.6%
Final simplification15.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(z);
}
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(z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(z);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[z], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{z}
\end{array}
Initial program 91.1%
associate-+l+91.1%
associate-+l+91.1%
+-commutative91.1%
+-commutative91.1%
associate-+l-74.8%
+-commutative74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in t around inf 46.4%
Taylor expanded in z around 0 23.1%
Taylor expanded in z around inf 1.5%
mul-1-neg1.5%
Simplified1.5%
Final simplification1.5%
(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 2024081
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 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)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))