
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ y 1.0)) (sqrt y)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ 1.0 x)))
(t_5 (- t_4 (sqrt x)))
(t_6 (+ t_5 t_1))
(t_7 (+ t_3 t_6)))
(if (<= t_7 1.002)
(+ (/ 1.0 (+ (sqrt x) t_4)) (+ (* 0.5 (sqrt (/ 1.0 y))) t_3))
(if (<= t_7 2.999)
(+ t_5 (+ t_1 (+ (* 0.5 (sqrt (/ 1.0 t))) (/ 1.0 (+ t_2 (sqrt z))))))
(+
t_6
(+
(/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))
(+ 1.0 (- (* 0.5 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)) - sqrt(y);
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + x));
double t_5 = t_4 - sqrt(x);
double t_6 = t_5 + t_1;
double t_7 = t_3 + t_6;
double tmp;
if (t_7 <= 1.002) {
tmp = (1.0 / (sqrt(x) + t_4)) + ((0.5 * sqrt((1.0 / y))) + t_3);
} else if (t_7 <= 2.999) {
tmp = t_5 + (t_1 + ((0.5 * sqrt((1.0 / t))) + (1.0 / (t_2 + sqrt(z)))));
} else {
tmp = t_6 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (1.0 + ((0.5 * 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) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_1 = sqrt((y + 1.0d0)) - sqrt(y)
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + x))
t_5 = t_4 - sqrt(x)
t_6 = t_5 + t_1
t_7 = t_3 + t_6
if (t_7 <= 1.002d0) then
tmp = (1.0d0 / (sqrt(x) + t_4)) + ((0.5d0 * sqrt((1.0d0 / y))) + t_3)
else if (t_7 <= 2.999d0) then
tmp = t_5 + (t_1 + ((0.5d0 * sqrt((1.0d0 / t))) + (1.0d0 / (t_2 + sqrt(z)))))
else
tmp = t_6 + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + (1.0d0 + ((0.5d0 * 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)) - Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + x));
double t_5 = t_4 - Math.sqrt(x);
double t_6 = t_5 + t_1;
double t_7 = t_3 + t_6;
double tmp;
if (t_7 <= 1.002) {
tmp = (1.0 / (Math.sqrt(x) + t_4)) + ((0.5 * Math.sqrt((1.0 / y))) + t_3);
} else if (t_7 <= 2.999) {
tmp = t_5 + (t_1 + ((0.5 * Math.sqrt((1.0 / t))) + (1.0 / (t_2 + Math.sqrt(z)))));
} else {
tmp = t_6 + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (1.0 + ((0.5 * 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)) - math.sqrt(y) t_2 = math.sqrt((1.0 + z)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((1.0 + x)) t_5 = t_4 - math.sqrt(x) t_6 = t_5 + t_1 t_7 = t_3 + t_6 tmp = 0 if t_7 <= 1.002: tmp = (1.0 / (math.sqrt(x) + t_4)) + ((0.5 * math.sqrt((1.0 / y))) + t_3) elif t_7 <= 2.999: tmp = t_5 + (t_1 + ((0.5 * math.sqrt((1.0 / t))) + (1.0 / (t_2 + math.sqrt(z))))) else: tmp = t_6 + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (1.0 + ((0.5 * z) - math.sqrt(z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(1.0 + x)) t_5 = Float64(t_4 - sqrt(x)) t_6 = Float64(t_5 + t_1) t_7 = Float64(t_3 + t_6) tmp = 0.0 if (t_7 <= 1.002) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_4)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + t_3)); elseif (t_7 <= 2.999) tmp = Float64(t_5 + Float64(t_1 + Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) + Float64(1.0 / Float64(t_2 + sqrt(z)))))); else tmp = Float64(t_6 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(1.0 + Float64(Float64(0.5 * 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)) - sqrt(y);
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((1.0 + x));
t_5 = t_4 - sqrt(x);
t_6 = t_5 + t_1;
t_7 = t_3 + t_6;
tmp = 0.0;
if (t_7 <= 1.002)
tmp = (1.0 / (sqrt(x) + t_4)) + ((0.5 * sqrt((1.0 / y))) + t_3);
elseif (t_7 <= 2.999)
tmp = t_5 + (t_1 + ((0.5 * sqrt((1.0 / t))) + (1.0 / (t_2 + sqrt(z)))));
else
tmp = t_6 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (1.0 + ((0.5 * 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[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 + t$95$1), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$3 + t$95$6), $MachinePrecision]}, If[LessEqual[t$95$7, 1.002], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$7, 2.999], N[(t$95$5 + N[(t$95$1 + N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$6 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(0.5 * z), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} - \sqrt{y}\\
t_2 := \sqrt{1 + z}\\
t_3 := t\_2 - \sqrt{z}\\
t_4 := \sqrt{1 + x}\\
t_5 := t\_4 - \sqrt{x}\\
t_6 := t\_5 + t\_1\\
t_7 := t\_3 + t\_6\\
\mathbf{if}\;t\_7 \leq 1.002:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_4} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + t\_3\right)\\
\mathbf{elif}\;t\_7 \leq 2.999:\\
\;\;\;\;t\_5 + \left(t\_1 + \left(0.5 \cdot \sqrt{\frac{1}{t}} + \frac{1}{t\_2 + \sqrt{z}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_6 + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \left(1 + \left(0.5 \cdot z - \sqrt{z}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) < 1.002Initial program 87.3%
associate-+l+87.3%
associate-+l+87.3%
+-commutative87.3%
+-commutative87.3%
associate-+l-73.4%
+-commutative73.4%
+-commutative73.4%
Simplified73.4%
flip--73.5%
div-inv73.5%
add-sqr-sqrt51.8%
+-commutative51.8%
add-sqr-sqrt73.5%
associate--l+76.6%
+-commutative76.6%
Applied egg-rr76.6%
+-inverses76.6%
metadata-eval76.6%
*-lft-identity76.6%
+-commutative76.6%
Simplified76.6%
Taylor expanded in t around inf 49.3%
Taylor expanded in y around inf 41.6%
if 1.002 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) < 2.99900000000000011Initial program 97.5%
associate-+l+97.5%
associate-+l+97.5%
+-commutative97.5%
+-commutative97.5%
associate-+l-68.2%
+-commutative68.2%
+-commutative68.2%
Simplified68.2%
associate--r-97.5%
flip--97.8%
flip--97.8%
frac-add97.8%
Applied egg-rr99.1%
Taylor expanded in t around inf 55.1%
if 2.99900000000000011 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (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%
Taylor expanded in z around 0 98.3%
associate--l+98.3%
Simplified98.3%
flip--98.8%
div-inv98.8%
add-sqr-sqrt65.4%
add-sqr-sqrt99.9%
associate--l+99.9%
Applied egg-rr99.9%
+-inverses99.9%
metadata-eval99.9%
*-lft-identity99.9%
+-commutative99.9%
Simplified99.9%
Final simplification55.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (- (sqrt (+ y 1.0)) (sqrt y)))
(t_3 (+ (sqrt (+ 1.0 t)) (sqrt t)))
(t_4 (sqrt (+ 1.0 z)))
(t_5 (+ t_4 (sqrt z))))
(if (<= t_2 0.0001)
(+ (/ 1.0 (+ (sqrt x) t_1)) (+ (* 0.5 (sqrt (/ 1.0 y))) (- t_4 (sqrt z))))
(+
(- t_1 (sqrt x))
(+
t_2
(/ (+ (* (+ 1.0 (- t t)) t_5) (* t_3 (+ z (- 1.0 z)))) (* t_5 t_3)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((y + 1.0)) - sqrt(y);
double t_3 = sqrt((1.0 + t)) + sqrt(t);
double t_4 = sqrt((1.0 + z));
double t_5 = t_4 + sqrt(z);
double tmp;
if (t_2 <= 0.0001) {
tmp = (1.0 / (sqrt(x) + t_1)) + ((0.5 * sqrt((1.0 / y))) + (t_4 - sqrt(z)));
} else {
tmp = (t_1 - sqrt(x)) + (t_2 + ((((1.0 + (t - t)) * t_5) + (t_3 * (z + (1.0 - z)))) / (t_5 * t_3)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((y + 1.0d0)) - sqrt(y)
t_3 = sqrt((1.0d0 + t)) + sqrt(t)
t_4 = sqrt((1.0d0 + z))
t_5 = t_4 + sqrt(z)
if (t_2 <= 0.0001d0) then
tmp = (1.0d0 / (sqrt(x) + t_1)) + ((0.5d0 * sqrt((1.0d0 / y))) + (t_4 - sqrt(z)))
else
tmp = (t_1 - sqrt(x)) + (t_2 + ((((1.0d0 + (t - t)) * t_5) + (t_3 * (z + (1.0d0 - z)))) / (t_5 * t_3)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double t_3 = Math.sqrt((1.0 + t)) + Math.sqrt(t);
double t_4 = Math.sqrt((1.0 + z));
double t_5 = t_4 + Math.sqrt(z);
double tmp;
if (t_2 <= 0.0001) {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + ((0.5 * Math.sqrt((1.0 / y))) + (t_4 - Math.sqrt(z)));
} else {
tmp = (t_1 - Math.sqrt(x)) + (t_2 + ((((1.0 + (t - t)) * t_5) + (t_3 * (z + (1.0 - z)))) / (t_5 * t_3)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((y + 1.0)) - math.sqrt(y) t_3 = math.sqrt((1.0 + t)) + math.sqrt(t) t_4 = math.sqrt((1.0 + z)) t_5 = t_4 + math.sqrt(z) tmp = 0 if t_2 <= 0.0001: tmp = (1.0 / (math.sqrt(x) + t_1)) + ((0.5 * math.sqrt((1.0 / y))) + (t_4 - math.sqrt(z))) else: tmp = (t_1 - math.sqrt(x)) + (t_2 + ((((1.0 + (t - t)) * t_5) + (t_3 * (z + (1.0 - z)))) / (t_5 * t_3))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_3 = Float64(sqrt(Float64(1.0 + t)) + sqrt(t)) t_4 = sqrt(Float64(1.0 + z)) t_5 = Float64(t_4 + sqrt(z)) tmp = 0.0 if (t_2 <= 0.0001) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(t_4 - sqrt(z)))); else tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(t_2 + Float64(Float64(Float64(Float64(1.0 + Float64(t - t)) * t_5) + Float64(t_3 * Float64(z + Float64(1.0 - z)))) / Float64(t_5 * t_3)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((y + 1.0)) - sqrt(y);
t_3 = sqrt((1.0 + t)) + sqrt(t);
t_4 = sqrt((1.0 + z));
t_5 = t_4 + sqrt(z);
tmp = 0.0;
if (t_2 <= 0.0001)
tmp = (1.0 / (sqrt(x) + t_1)) + ((0.5 * sqrt((1.0 / y))) + (t_4 - sqrt(z)));
else
tmp = (t_1 - sqrt(x)) + (t_2 + ((((1.0 + (t - t)) * t_5) + (t_3 * (z + (1.0 - z)))) / (t_5 * t_3)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0001], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[(N[(N[(1.0 + N[(t - t), $MachinePrecision]), $MachinePrecision] * t$95$5), $MachinePrecision] + N[(t$95$3 * N[(z + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$5 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{y + 1} - \sqrt{y}\\
t_3 := \sqrt{1 + t} + \sqrt{t}\\
t_4 := \sqrt{1 + z}\\
t_5 := t\_4 + \sqrt{z}\\
\mathbf{if}\;t\_2 \leq 0.0001:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \left(t\_4 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \sqrt{x}\right) + \left(t\_2 + \frac{\left(1 + \left(t - t\right)\right) \cdot t\_5 + t\_3 \cdot \left(z + \left(1 - z\right)\right)}{t\_5 \cdot t\_3}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) < 1.00000000000000005e-4Initial program 88.0%
associate-+l+88.0%
associate-+l+88.0%
+-commutative88.0%
+-commutative88.0%
associate-+l-64.3%
+-commutative64.3%
+-commutative64.3%
Simplified64.3%
flip--64.3%
div-inv64.3%
add-sqr-sqrt49.9%
+-commutative49.9%
add-sqr-sqrt64.3%
associate--l+66.9%
+-commutative66.9%
Applied egg-rr66.9%
+-inverses66.9%
metadata-eval66.9%
*-lft-identity66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in t around inf 53.3%
Taylor expanded in y around inf 56.1%
if 1.00000000000000005e-4 < (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) Initial program 96.8%
associate-+l+96.8%
associate-+l+96.8%
+-commutative96.8%
+-commutative96.8%
associate-+l-72.0%
+-commutative72.0%
+-commutative72.0%
Simplified72.0%
associate--r-96.8%
flip--97.1%
flip--97.1%
frac-add97.1%
Applied egg-rr98.5%
Final simplification81.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0)))
(t_2 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_3 (sqrt (+ 1.0 x)))
(t_4 (+ (- t_3 (sqrt x)) (- t_1 (sqrt y)))))
(if (<= (+ t_2 t_4) 2.0001)
(+ (/ 1.0 (+ (sqrt x) t_3)) (- (+ t_1 (* 0.5 (sqrt (/ 1.0 z)))) (sqrt y)))
(+ t_4 (+ t_2 (/ 1.0 (+ (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 = sqrt((y + 1.0));
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double t_3 = sqrt((1.0 + x));
double t_4 = (t_3 - sqrt(x)) + (t_1 - sqrt(y));
double tmp;
if ((t_2 + t_4) <= 2.0001) {
tmp = (1.0 / (sqrt(x) + t_3)) + ((t_1 + (0.5 * sqrt((1.0 / z)))) - sqrt(y));
} else {
tmp = t_4 + (t_2 + (1.0 / (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) :: t_4
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
t_3 = sqrt((1.0d0 + x))
t_4 = (t_3 - sqrt(x)) + (t_1 - sqrt(y))
if ((t_2 + t_4) <= 2.0001d0) then
tmp = (1.0d0 / (sqrt(x) + t_3)) + ((t_1 + (0.5d0 * sqrt((1.0d0 / z)))) - sqrt(y))
else
tmp = t_4 + (t_2 + (1.0d0 / (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 = Math.sqrt((y + 1.0));
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + x));
double t_4 = (t_3 - Math.sqrt(x)) + (t_1 - Math.sqrt(y));
double tmp;
if ((t_2 + t_4) <= 2.0001) {
tmp = (1.0 / (Math.sqrt(x) + t_3)) + ((t_1 + (0.5 * Math.sqrt((1.0 / z)))) - Math.sqrt(y));
} else {
tmp = t_4 + (t_2 + (1.0 / (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 = math.sqrt((y + 1.0)) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) t_3 = math.sqrt((1.0 + x)) t_4 = (t_3 - math.sqrt(x)) + (t_1 - math.sqrt(y)) tmp = 0 if (t_2 + t_4) <= 2.0001: tmp = (1.0 / (math.sqrt(x) + t_3)) + ((t_1 + (0.5 * math.sqrt((1.0 / z)))) - math.sqrt(y)) else: tmp = t_4 + (t_2 + (1.0 / (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 = sqrt(Float64(y + 1.0)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_3 = sqrt(Float64(1.0 + x)) t_4 = Float64(Float64(t_3 - sqrt(x)) + Float64(t_1 - sqrt(y))) tmp = 0.0 if (Float64(t_2 + t_4) <= 2.0001) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_3)) + Float64(Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / z)))) - sqrt(y))); else tmp = Float64(t_4 + Float64(t_2 + Float64(1.0 / 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 = sqrt((y + 1.0));
t_2 = sqrt((1.0 + z)) - sqrt(z);
t_3 = sqrt((1.0 + x));
t_4 = (t_3 - sqrt(x)) + (t_1 - sqrt(y));
tmp = 0.0;
if ((t_2 + t_4) <= 2.0001)
tmp = (1.0 / (sqrt(x) + t_3)) + ((t_1 + (0.5 * sqrt((1.0 / z)))) - sqrt(y));
else
tmp = t_4 + (t_2 + (1.0 / (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[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 + t$95$4), $MachinePrecision], 2.0001], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$4 + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
t_3 := \sqrt{1 + x}\\
t_4 := \left(t\_3 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\\
\mathbf{if}\;t\_2 + t\_4 \leq 2.0001:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_3} + \left(\left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4 + \left(t\_2 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) < 2.00010000000000021Initial program 92.3%
associate-+l+92.3%
associate-+l+92.3%
+-commutative92.3%
+-commutative92.3%
associate-+l-71.5%
+-commutative71.5%
+-commutative71.5%
Simplified71.5%
flip--71.6%
div-inv71.6%
add-sqr-sqrt53.7%
+-commutative53.7%
add-sqr-sqrt71.6%
associate--l+73.2%
+-commutative73.2%
Applied egg-rr73.2%
+-inverses73.2%
metadata-eval73.2%
*-lft-identity73.2%
+-commutative73.2%
Simplified73.2%
Taylor expanded in t around inf 53.8%
Taylor expanded in z around inf 27.5%
if 2.00010000000000021 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
flip--96.4%
div-inv96.4%
add-sqr-sqrt65.7%
add-sqr-sqrt97.4%
associate--l+97.4%
Applied egg-rr99.5%
+-inverses97.4%
metadata-eval97.4%
*-lft-identity97.4%
+-commutative97.4%
Simplified99.5%
Final simplification38.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (- (sqrt (+ y 1.0)) (sqrt y)))
(t_3 (sqrt (+ 1.0 z))))
(if (<= t_2 0.0001)
(+ (/ 1.0 (+ (sqrt x) t_1)) (+ (* 0.5 (sqrt (/ 1.0 y))) (- t_3 (sqrt z))))
(+
(+ (- t_1 (sqrt x)) t_2)
(+
(/ (+ z (- 1.0 z)) (+ t_3 (sqrt z)))
(- (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 = sqrt((1.0 + x));
double t_2 = sqrt((y + 1.0)) - sqrt(y);
double t_3 = sqrt((1.0 + z));
double tmp;
if (t_2 <= 0.0001) {
tmp = (1.0 / (sqrt(x) + t_1)) + ((0.5 * sqrt((1.0 / y))) + (t_3 - sqrt(z)));
} else {
tmp = ((t_1 - sqrt(x)) + t_2) + (((z + (1.0 - z)) / (t_3 + sqrt(z))) + (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 = sqrt((1.0d0 + x))
t_2 = sqrt((y + 1.0d0)) - sqrt(y)
t_3 = sqrt((1.0d0 + z))
if (t_2 <= 0.0001d0) then
tmp = (1.0d0 / (sqrt(x) + t_1)) + ((0.5d0 * sqrt((1.0d0 / y))) + (t_3 - sqrt(z)))
else
tmp = ((t_1 - sqrt(x)) + t_2) + (((z + (1.0d0 - z)) / (t_3 + sqrt(z))) + (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 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if (t_2 <= 0.0001) {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + ((0.5 * Math.sqrt((1.0 / y))) + (t_3 - Math.sqrt(z)));
} else {
tmp = ((t_1 - Math.sqrt(x)) + t_2) + (((z + (1.0 - z)) / (t_3 + Math.sqrt(z))) + (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 = math.sqrt((1.0 + x)) t_2 = math.sqrt((y + 1.0)) - math.sqrt(y) t_3 = math.sqrt((1.0 + z)) tmp = 0 if t_2 <= 0.0001: tmp = (1.0 / (math.sqrt(x) + t_1)) + ((0.5 * math.sqrt((1.0 / y))) + (t_3 - math.sqrt(z))) else: tmp = ((t_1 - math.sqrt(x)) + t_2) + (((z + (1.0 - z)) / (t_3 + math.sqrt(z))) + (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 = sqrt(Float64(1.0 + x)) t_2 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t_2 <= 0.0001) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(t_3 - sqrt(z)))); else tmp = Float64(Float64(Float64(t_1 - sqrt(x)) + t_2) + Float64(Float64(Float64(z + Float64(1.0 - z)) / Float64(t_3 + sqrt(z))) + 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 = sqrt((1.0 + x));
t_2 = sqrt((y + 1.0)) - sqrt(y);
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if (t_2 <= 0.0001)
tmp = (1.0 / (sqrt(x) + t_1)) + ((0.5 * sqrt((1.0 / y))) + (t_3 - sqrt(z)));
else
tmp = ((t_1 - sqrt(x)) + t_2) + (((z + (1.0 - z)) / (t_3 + sqrt(z))) + (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[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 0.0001], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(N[(N[(z + N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $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 := \sqrt{1 + x}\\
t_2 := \sqrt{y + 1} - \sqrt{y}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;t\_2 \leq 0.0001:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \left(t\_3 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{x}\right) + t\_2\right) + \left(\frac{z + \left(1 - z\right)}{t\_3 + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) < 1.00000000000000005e-4Initial program 88.0%
associate-+l+88.0%
associate-+l+88.0%
+-commutative88.0%
+-commutative88.0%
associate-+l-64.3%
+-commutative64.3%
+-commutative64.3%
Simplified64.3%
flip--64.3%
div-inv64.3%
add-sqr-sqrt49.9%
+-commutative49.9%
add-sqr-sqrt64.3%
associate--l+66.9%
+-commutative66.9%
Applied egg-rr66.9%
+-inverses66.9%
metadata-eval66.9%
*-lft-identity66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in t around inf 53.3%
Taylor expanded in y around inf 56.1%
if 1.00000000000000005e-4 < (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
flip--96.8%
add-sqr-sqrt78.2%
+-commutative78.2%
add-sqr-sqrt97.4%
associate--l+97.4%
Applied egg-rr97.4%
Final simplification80.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= z 13500000000.0)
(+
(+
(/ (+ z (- 1.0 z)) (+ (sqrt (+ 1.0 z)) (sqrt z)))
(- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (- t_1 (sqrt x)) (- 1.0 (sqrt y))))
(+
(/ 1.0 (+ (sqrt x) t_1))
(- (+ (sqrt (+ y 1.0)) (* 0.5 (sqrt (/ 1.0 z)))) (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 + x));
double tmp;
if (z <= 13500000000.0) {
tmp = (((z + (1.0 - z)) / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))) + ((t_1 - sqrt(x)) + (1.0 - sqrt(y)));
} else {
tmp = (1.0 / (sqrt(x) + t_1)) + ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - 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) :: tmp
t_1 = sqrt((1.0d0 + x))
if (z <= 13500000000.0d0) then
tmp = (((z + (1.0d0 - z)) / (sqrt((1.0d0 + z)) + sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((t_1 - sqrt(x)) + (1.0d0 - sqrt(y)))
else
tmp = (1.0d0 / (sqrt(x) + t_1)) + ((sqrt((y + 1.0d0)) + (0.5d0 * sqrt((1.0d0 / z)))) - 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 + x));
double tmp;
if (z <= 13500000000.0) {
tmp = (((z + (1.0 - z)) / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((t_1 - Math.sqrt(x)) + (1.0 - Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + ((Math.sqrt((y + 1.0)) + (0.5 * Math.sqrt((1.0 / z)))) - 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 + x)) tmp = 0 if z <= 13500000000.0: tmp = (((z + (1.0 - z)) / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((t_1 - math.sqrt(x)) + (1.0 - math.sqrt(y))) else: tmp = (1.0 / (math.sqrt(x) + t_1)) + ((math.sqrt((y + 1.0)) + (0.5 * math.sqrt((1.0 / z)))) - 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 + x)) tmp = 0.0 if (z <= 13500000000.0) tmp = Float64(Float64(Float64(Float64(z + Float64(1.0 - z)) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 - sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - 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 + x));
tmp = 0.0;
if (z <= 13500000000.0)
tmp = (((z + (1.0 - z)) / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))) + ((t_1 - sqrt(x)) + (1.0 - sqrt(y)));
else
tmp = (1.0 / (sqrt(x) + t_1)) + ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - 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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 13500000000.0], N[(N[(N[(N[(z + N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 13500000000:\\
\;\;\;\;\left(\frac{z + \left(1 - z\right)}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(t\_1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1} + \left(\left(\sqrt{y + 1} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 1.35e10Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
flip--97.7%
add-sqr-sqrt97.7%
+-commutative97.7%
add-sqr-sqrt97.7%
associate--l+97.7%
Applied egg-rr97.7%
Taylor expanded in y around 0 55.4%
if 1.35e10 < z Initial program 87.2%
associate-+l+87.2%
associate-+l+87.2%
+-commutative87.2%
+-commutative87.2%
associate-+l-87.0%
+-commutative87.0%
+-commutative87.0%
Simplified87.0%
flip--87.1%
div-inv87.1%
add-sqr-sqrt73.3%
+-commutative73.3%
add-sqr-sqrt87.1%
associate--l+89.8%
+-commutative89.8%
Applied egg-rr89.8%
+-inverses89.8%
metadata-eval89.8%
*-lft-identity89.8%
+-commutative89.8%
Simplified89.8%
Taylor expanded in t around inf 46.1%
Taylor expanded in z around inf 46.3%
Final simplification51.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= z 56000000.0)
(+
(+ (- t_1 (sqrt x)) (- 1.0 (sqrt y)))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t))))
(+
(/ 1.0 (+ (sqrt x) t_1))
(- (+ (sqrt (+ y 1.0)) (* 0.5 (sqrt (/ 1.0 z)))) (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 + x));
double tmp;
if (z <= 56000000.0) {
tmp = ((t_1 - sqrt(x)) + (1.0 - sqrt(y))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
} else {
tmp = (1.0 / (sqrt(x) + t_1)) + ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - 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) :: tmp
t_1 = sqrt((1.0d0 + x))
if (z <= 56000000.0d0) then
tmp = ((t_1 - sqrt(x)) + (1.0d0 - sqrt(y))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t)))
else
tmp = (1.0d0 / (sqrt(x) + t_1)) + ((sqrt((y + 1.0d0)) + (0.5d0 * sqrt((1.0d0 / z)))) - 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 + x));
double tmp;
if (z <= 56000000.0) {
tmp = ((t_1 - Math.sqrt(x)) + (1.0 - Math.sqrt(y))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + ((Math.sqrt((y + 1.0)) + (0.5 * Math.sqrt((1.0 / z)))) - 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 + x)) tmp = 0 if z <= 56000000.0: tmp = ((t_1 - math.sqrt(x)) + (1.0 - math.sqrt(y))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) else: tmp = (1.0 / (math.sqrt(x) + t_1)) + ((math.sqrt((y + 1.0)) + (0.5 * math.sqrt((1.0 / z)))) - 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 + x)) tmp = 0.0 if (z <= 56000000.0) tmp = Float64(Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - 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 + x));
tmp = 0.0;
if (z <= 56000000.0)
tmp = ((t_1 - sqrt(x)) + (1.0 - sqrt(y))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
else
tmp = (1.0 / (sqrt(x) + t_1)) + ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - 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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 56000000.0], N[(N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 56000000:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1} + \left(\left(\sqrt{y + 1} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 5.6e7Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in y around 0 55.3%
if 5.6e7 < z Initial program 87.2%
associate-+l+87.2%
associate-+l+87.2%
+-commutative87.2%
+-commutative87.2%
associate-+l-87.0%
+-commutative87.0%
+-commutative87.0%
Simplified87.0%
flip--87.1%
div-inv87.1%
add-sqr-sqrt73.3%
+-commutative73.3%
add-sqr-sqrt87.1%
associate--l+89.8%
+-commutative89.8%
Applied egg-rr89.8%
+-inverses89.8%
metadata-eval89.8%
*-lft-identity89.8%
+-commutative89.8%
Simplified89.8%
Taylor expanded in t around inf 46.1%
Taylor expanded in z around inf 46.3%
Final simplification51.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 (<= t 33000000000000.0)
(-
(+ 2.0 (+ (sqrt (+ 1.0 t)) (+ t_1 (* 0.5 z))))
(+ (sqrt t) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- t_1 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (t <= 33000000000000.0) {
tmp = (2.0 + (sqrt((1.0 + t)) + (t_1 + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((sqrt((1.0 + z)) - sqrt(z)) + (t_1 - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (t <= 33000000000000.0d0) then
tmp = (2.0d0 + (sqrt((1.0d0 + t)) + (t_1 + (0.5d0 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (t_1 - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (t <= 33000000000000.0) {
tmp = (2.0 + (Math.sqrt((1.0 + t)) + (t_1 + (0.5 * z)))) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (t_1 - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if t <= 33000000000000.0: tmp = (2.0 + (math.sqrt((1.0 + t)) + (t_1 + (0.5 * z)))) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (t_1 - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (t <= 33000000000000.0) tmp = Float64(Float64(2.0 + Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 + Float64(0.5 * z)))) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(t_1 - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (t <= 33000000000000.0)
tmp = (2.0 + (sqrt((1.0 + t)) + (t_1 + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((sqrt((1.0 + z)) - sqrt(z)) + (t_1 - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 33000000000000.0], N[(N[(2.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;t \leq 33000000000000:\\
\;\;\;\;\left(2 + \left(\sqrt{1 + t} + \left(t\_1 + 0.5 \cdot z\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(t\_1 - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 3.3e13Initial program 96.1%
associate-+l+96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in z around 0 52.0%
associate--l+52.0%
Simplified52.0%
Taylor expanded in x around 0 16.2%
if 3.3e13 < t Initial program 90.1%
associate-+l+90.1%
associate-+l+90.1%
+-commutative90.1%
+-commutative90.1%
associate-+l-40.7%
+-commutative40.7%
+-commutative40.7%
Simplified40.7%
flip--40.7%
div-inv40.7%
add-sqr-sqrt35.1%
+-commutative35.1%
add-sqr-sqrt40.7%
associate--l+42.9%
+-commutative42.9%
Applied egg-rr42.9%
+-inverses42.9%
metadata-eval42.9%
*-lft-identity42.9%
+-commutative42.9%
Simplified42.9%
Taylor expanded in t around inf 92.4%
Final simplification53.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= t 33000000000000.0)
(+ 2.0 (- (+ (sqrt (+ 1.0 t)) (+ t_1 (* 0.5 z))) (sqrt t)))
(+
(- (sqrt (+ 1.0 x)) (sqrt x))
(+ (- t_1 (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) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (t <= 33000000000000.0) {
tmp = 2.0 + ((sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - sqrt(t));
} else {
tmp = (sqrt((1.0 + x)) - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (t <= 33000000000000.0d0) then
tmp = 2.0d0 + ((sqrt((1.0d0 + t)) + (t_1 + (0.5d0 * z))) - sqrt(t))
else
tmp = (sqrt((1.0d0 + x)) - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0d0 / (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 tmp;
if (t <= 33000000000000.0) {
tmp = 2.0 + ((Math.sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - Math.sqrt(t));
} else {
tmp = (Math.sqrt((1.0 + x)) - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + (1.0 / (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)) tmp = 0 if t <= 33000000000000.0: tmp = 2.0 + ((math.sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - math.sqrt(t)) else: tmp = (math.sqrt((1.0 + x)) - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + (1.0 / (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)) tmp = 0.0 if (t <= 33000000000000.0) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 + Float64(0.5 * z))) - sqrt(t))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 / 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));
tmp = 0.0;
if (t <= 33000000000000.0)
tmp = 2.0 + ((sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - sqrt(t));
else
tmp = (sqrt((1.0 + x)) - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 / (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]}, If[LessEqual[t, 33000000000000.0], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;t \leq 33000000000000:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + t} + \left(t\_1 + 0.5 \cdot z\right)\right) - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right)\\
\end{array}
\end{array}
if t < 3.3e13Initial program 96.1%
associate-+l+96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in z around 0 52.0%
associate--l+52.0%
Simplified52.0%
Taylor expanded in x around 0 16.2%
associate--l+24.3%
*-commutative24.3%
+-commutative24.3%
Simplified24.3%
Taylor expanded in t around inf 18.8%
if 3.3e13 < t Initial program 90.1%
associate-+l+90.1%
associate-+l+90.1%
+-commutative90.1%
+-commutative90.1%
associate-+l-40.7%
+-commutative40.7%
+-commutative40.7%
Simplified40.7%
associate--r-90.1%
flip--90.3%
flip--90.3%
frac-add90.2%
Applied egg-rr94.2%
Taylor expanded in t around inf 91.3%
Final simplification54.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= t 33000000000000.0)
(+ 2.0 (- (+ (sqrt (+ 1.0 t)) (+ t_1 (* 0.5 z))) (sqrt t)))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- t_1 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (t <= 33000000000000.0) {
tmp = 2.0 + ((sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - sqrt(t));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((sqrt((1.0 + z)) - sqrt(z)) + (t_1 - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (t <= 33000000000000.0d0) then
tmp = 2.0d0 + ((sqrt((1.0d0 + t)) + (t_1 + (0.5d0 * z))) - sqrt(t))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (t_1 - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (t <= 33000000000000.0) {
tmp = 2.0 + ((Math.sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - Math.sqrt(t));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (t_1 - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if t <= 33000000000000.0: tmp = 2.0 + ((math.sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - math.sqrt(t)) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (t_1 - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (t <= 33000000000000.0) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 + Float64(0.5 * z))) - sqrt(t))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(t_1 - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (t <= 33000000000000.0)
tmp = 2.0 + ((sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - sqrt(t));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((sqrt((1.0 + z)) - sqrt(z)) + (t_1 - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 33000000000000.0], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;t \leq 33000000000000:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + t} + \left(t\_1 + 0.5 \cdot z\right)\right) - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(t\_1 - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 3.3e13Initial program 96.1%
associate-+l+96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in z around 0 52.0%
associate--l+52.0%
Simplified52.0%
Taylor expanded in x around 0 16.2%
associate--l+24.3%
*-commutative24.3%
+-commutative24.3%
Simplified24.3%
Taylor expanded in t around inf 18.8%
if 3.3e13 < t Initial program 90.1%
associate-+l+90.1%
associate-+l+90.1%
+-commutative90.1%
+-commutative90.1%
associate-+l-40.7%
+-commutative40.7%
+-commutative40.7%
Simplified40.7%
flip--40.7%
div-inv40.7%
add-sqr-sqrt35.1%
+-commutative35.1%
add-sqr-sqrt40.7%
associate--l+42.9%
+-commutative42.9%
Applied egg-rr42.9%
+-inverses42.9%
metadata-eval42.9%
*-lft-identity42.9%
+-commutative42.9%
Simplified42.9%
Taylor expanded in t around inf 92.4%
Final simplification55.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)) (sqrt z))))
(if (<= y 32000000.0)
(+ (+ t_1 (- (sqrt (+ y 1.0)) (sqrt y))) (- 1.0 (sqrt x)))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ (* 0.5 (sqrt (/ 1.0 y))) 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 + z)) - sqrt(z);
double tmp;
if (y <= 32000000.0) {
tmp = (t_1 + (sqrt((y + 1.0)) - sqrt(y))) + (1.0 - sqrt(x));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((0.5 * sqrt((1.0 / 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((1.0d0 + z)) - sqrt(z)
if (y <= 32000000.0d0) then
tmp = (t_1 + (sqrt((y + 1.0d0)) - sqrt(y))) + (1.0d0 - sqrt(x))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + ((0.5d0 * sqrt((1.0d0 / 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((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 32000000.0) {
tmp = (t_1 + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (1.0 - Math.sqrt(x));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((0.5 * Math.sqrt((1.0 / y))) + 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 + z)) - math.sqrt(z) tmp = 0 if y <= 32000000.0: tmp = (t_1 + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (1.0 - math.sqrt(x)) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((0.5 * math.sqrt((1.0 / y))) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 32000000.0) tmp = Float64(Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(1.0 - sqrt(x))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / 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((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 32000000.0)
tmp = (t_1 + (sqrt((y + 1.0)) - sqrt(y))) + (1.0 - sqrt(x));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((0.5 * sqrt((1.0 / 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 32000000.0], N[(N[(t$95$1 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 32000000:\\
\;\;\;\;\left(t\_1 + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + t\_1\right)\\
\end{array}
\end{array}
if y < 3.2e7Initial program 96.8%
associate-+l+96.8%
associate-+l+96.8%
+-commutative96.8%
+-commutative96.8%
associate-+l-72.0%
+-commutative72.0%
+-commutative72.0%
Simplified72.0%
Taylor expanded in t around inf 57.2%
Taylor expanded in x around 0 28.4%
if 3.2e7 < y Initial program 88.0%
associate-+l+88.0%
associate-+l+88.0%
+-commutative88.0%
+-commutative88.0%
associate-+l-64.3%
+-commutative64.3%
+-commutative64.3%
Simplified64.3%
flip--64.3%
div-inv64.3%
add-sqr-sqrt49.9%
+-commutative49.9%
add-sqr-sqrt64.3%
associate--l+66.9%
+-commutative66.9%
Applied egg-rr66.9%
+-inverses66.9%
metadata-eval66.9%
*-lft-identity66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in t around inf 53.3%
Taylor expanded in y around inf 56.1%
Final simplification39.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= z 2400000000.0)
(+ (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- t_1 (sqrt y))) (- 1.0 (sqrt x)))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(- (+ t_1 (* 0.5 (sqrt (/ 1.0 z)))) (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 tmp;
if (z <= 2400000000.0) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (t_1 - sqrt(y))) + (1.0 - sqrt(x));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((t_1 + (0.5 * sqrt((1.0 / z)))) - 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) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 2400000000.0d0) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (t_1 - sqrt(y))) + (1.0d0 - sqrt(x))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + ((t_1 + (0.5d0 * sqrt((1.0d0 / z)))) - 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 tmp;
if (z <= 2400000000.0) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (t_1 - Math.sqrt(y))) + (1.0 - Math.sqrt(x));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((t_1 + (0.5 * Math.sqrt((1.0 / z)))) - 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)) tmp = 0 if z <= 2400000000.0: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (t_1 - math.sqrt(y))) + (1.0 - math.sqrt(x)) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((t_1 + (0.5 * math.sqrt((1.0 / z)))) - 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)) tmp = 0.0 if (z <= 2400000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(t_1 - sqrt(y))) + Float64(1.0 - sqrt(x))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / z)))) - 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));
tmp = 0.0;
if (z <= 2400000000.0)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (t_1 - sqrt(y))) + (1.0 - sqrt(x));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((t_1 + (0.5 * sqrt((1.0 / z)))) - 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]}, If[LessEqual[z, 2400000000.0], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $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 2400000000:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(t\_1 - \sqrt{y}\right)\right) + \left(1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 2.4e9Initial program 97.7%
associate-+l+97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
associate-+l-54.9%
+-commutative54.9%
+-commutative54.9%
Simplified54.9%
Taylor expanded in t around inf 62.7%
Taylor expanded in x around 0 28.8%
if 2.4e9 < z Initial program 87.2%
associate-+l+87.2%
associate-+l+87.2%
+-commutative87.2%
+-commutative87.2%
associate-+l-87.0%
+-commutative87.0%
+-commutative87.0%
Simplified87.0%
flip--87.1%
div-inv87.1%
add-sqr-sqrt73.3%
+-commutative73.3%
add-sqr-sqrt87.1%
associate--l+89.8%
+-commutative89.8%
Applied egg-rr89.8%
+-inverses89.8%
metadata-eval89.8%
*-lft-identity89.8%
+-commutative89.8%
Simplified89.8%
Taylor expanded in t around inf 46.1%
Taylor expanded in z around inf 46.3%
Final simplification36.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= z 3.7e+14)
(+ 1.0 (- (+ t_1 (sqrt (+ 1.0 z))) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+ t_1 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (z <= 3.7e+14) {
tmp = 1.0 + ((t_1 + sqrt((1.0 + z))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (z <= 3.7d+14) then
tmp = 1.0d0 + ((t_1 + sqrt((1.0d0 + z))) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = t_1 + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 3.7e+14) {
tmp = 1.0 + ((t_1 + Math.sqrt((1.0 + z))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = t_1 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if z <= 3.7e+14: tmp = 1.0 + ((t_1 + math.sqrt((1.0 + z))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = t_1 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 3.7e+14) tmp = Float64(1.0 + Float64(Float64(t_1 + sqrt(Float64(1.0 + z))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 3.7e+14)
tmp = 1.0 + ((t_1 + sqrt((1.0 + z))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.7e+14], N[(1.0 + N[(N[(t$95$1 + 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], N[(t$95$1 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 3.7 \cdot 10^{+14}:\\
\;\;\;\;1 + \left(\left(t\_1 + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 3.7e14Initial program 96.8%
associate-+l+96.8%
associate-+l+96.8%
+-commutative96.8%
+-commutative96.8%
associate-+l-55.2%
+-commutative55.2%
+-commutative55.2%
Simplified55.2%
Taylor expanded in t around inf 61.6%
Taylor expanded in y around 0 20.7%
associate--l+29.0%
+-commutative29.0%
+-commutative29.0%
Simplified29.0%
if 3.7e14 < z Initial program 88.0%
associate-+l+88.0%
associate-+l+88.0%
+-commutative88.0%
+-commutative88.0%
associate-+l-88.0%
+-commutative88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in z around inf 88.0%
Taylor expanded in t around inf 17.7%
associate--l+33.8%
Simplified33.8%
Final simplification31.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= t 33000000000000.0)
(+ 2.0 (- (+ (sqrt (+ 1.0 t)) (+ t_1 (* 0.5 z))) (sqrt t)))
(+ (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- t_1 (sqrt y))) (- 1.0 (sqrt x))))))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 (t <= 33000000000000.0) {
tmp = 2.0 + ((sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - sqrt(t));
} else {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (t_1 - sqrt(y))) + (1.0 - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (t <= 33000000000000.0d0) then
tmp = 2.0d0 + ((sqrt((1.0d0 + t)) + (t_1 + (0.5d0 * z))) - sqrt(t))
else
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (t_1 - sqrt(y))) + (1.0d0 - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (t <= 33000000000000.0) {
tmp = 2.0 + ((Math.sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - Math.sqrt(t));
} else {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (t_1 - Math.sqrt(y))) + (1.0 - Math.sqrt(x));
}
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 t <= 33000000000000.0: tmp = 2.0 + ((math.sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - math.sqrt(t)) else: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (t_1 - math.sqrt(y))) + (1.0 - math.sqrt(x)) 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 (t <= 33000000000000.0) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 + Float64(0.5 * z))) - sqrt(t))); else tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(t_1 - sqrt(y))) + Float64(1.0 - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (t <= 33000000000000.0)
tmp = 2.0 + ((sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - sqrt(t));
else
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (t_1 - sqrt(y))) + (1.0 - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 33000000000000.0], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $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}\;t \leq 33000000000000:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + t} + \left(t\_1 + 0.5 \cdot z\right)\right) - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(t\_1 - \sqrt{y}\right)\right) + \left(1 - \sqrt{x}\right)\\
\end{array}
\end{array}
if t < 3.3e13Initial program 96.1%
associate-+l+96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in z around 0 52.0%
associate--l+52.0%
Simplified52.0%
Taylor expanded in x around 0 16.2%
associate--l+24.3%
*-commutative24.3%
+-commutative24.3%
Simplified24.3%
Taylor expanded in t around inf 18.8%
if 3.3e13 < t Initial program 90.1%
associate-+l+90.1%
associate-+l+90.1%
+-commutative90.1%
+-commutative90.1%
associate-+l-40.7%
+-commutative40.7%
+-commutative40.7%
Simplified40.7%
Taylor expanded in t around inf 90.0%
Taylor expanded in x around 0 48.3%
Final simplification33.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.0)
(+ 2.0 (- (+ t_1 (* 0.5 z)) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+ (sqrt (+ 1.0 x)) (- t_1 (+ (sqrt y) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (z <= 2.0) {
tmp = 2.0 + ((t_1 + (0.5 * z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = sqrt((1.0 + x)) + (t_1 - (sqrt(y) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 2.0d0) then
tmp = 2.0d0 + ((t_1 + (0.5d0 * z)) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = sqrt((1.0d0 + x)) + (t_1 - (sqrt(y) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 2.0) {
tmp = 2.0 + ((t_1 + (0.5 * z)) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = Math.sqrt((1.0 + x)) + (t_1 - (Math.sqrt(y) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 2.0: tmp = 2.0 + ((t_1 + (0.5 * z)) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = math.sqrt((1.0 + x)) + (t_1 - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 2.0) tmp = Float64(2.0 + Float64(Float64(t_1 + Float64(0.5 * z)) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(t_1 - Float64(sqrt(y) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 2.0)
tmp = 2.0 + ((t_1 + (0.5 * z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = sqrt((1.0 + x)) + (t_1 - (sqrt(y) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.0], N[(2.0 + N[(N[(t$95$1 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 2:\\
\;\;\;\;2 + \left(\left(t\_1 + 0.5 \cdot z\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(t\_1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 2Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in z around 0 97.4%
associate--l+97.4%
Simplified97.4%
Taylor expanded in x around 0 14.8%
associate--l+38.5%
*-commutative38.5%
+-commutative38.5%
Simplified38.5%
Taylor expanded in t around inf 34.1%
if 2 < z Initial program 87.5%
associate-+l+87.5%
associate-+l+87.5%
+-commutative87.5%
+-commutative87.5%
associate-+l-86.1%
+-commutative86.1%
+-commutative86.1%
Simplified86.1%
Taylor expanded in z around inf 85.0%
Taylor expanded in t around inf 17.2%
associate--l+32.4%
Simplified32.4%
Final simplification33.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 1.85e-22)
(+ 2.0 (- (+ (sqrt (+ 1.0 t)) (+ t_1 (* 0.5 z))) (sqrt t)))
(+ (sqrt (+ 1.0 x)) (- t_1 (+ (sqrt y) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (z <= 1.85e-22) {
tmp = 2.0 + ((sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - sqrt(t));
} else {
tmp = sqrt((1.0 + x)) + (t_1 - (sqrt(y) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 1.85d-22) then
tmp = 2.0d0 + ((sqrt((1.0d0 + t)) + (t_1 + (0.5d0 * z))) - sqrt(t))
else
tmp = sqrt((1.0d0 + x)) + (t_1 - (sqrt(y) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 1.85e-22) {
tmp = 2.0 + ((Math.sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - Math.sqrt(t));
} else {
tmp = Math.sqrt((1.0 + x)) + (t_1 - (Math.sqrt(y) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 1.85e-22: tmp = 2.0 + ((math.sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - math.sqrt(t)) else: tmp = math.sqrt((1.0 + x)) + (t_1 - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 1.85e-22) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 + Float64(0.5 * z))) - sqrt(t))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(t_1 - Float64(sqrt(y) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 1.85e-22)
tmp = 2.0 + ((sqrt((1.0 + t)) + (t_1 + (0.5 * z))) - sqrt(t));
else
tmp = sqrt((1.0 + x)) + (t_1 - (sqrt(y) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.85e-22], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 1.85 \cdot 10^{-22}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + t} + \left(t\_1 + 0.5 \cdot z\right)\right) - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(t\_1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 1.85e-22Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in z around 0 97.6%
associate--l+97.6%
Simplified97.6%
Taylor expanded in x around 0 15.1%
associate--l+39.2%
*-commutative39.2%
+-commutative39.2%
Simplified39.2%
Taylor expanded in t around inf 39.1%
if 1.85e-22 < z Initial program 87.9%
associate-+l+87.9%
associate-+l+87.9%
+-commutative87.9%
+-commutative87.9%
associate-+l-85.2%
+-commutative85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in z around inf 82.7%
Taylor expanded in t around inf 16.9%
associate--l+31.7%
Simplified31.7%
Final simplification35.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 5e-23) (+ 2.0 (- (+ (sqrt (+ 1.0 t)) (+ (sqrt (+ y 1.0)) (* 0.5 z))) (sqrt t))) (- 2.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5e-23) {
tmp = 2.0 + ((sqrt((1.0 + t)) + (sqrt((y + 1.0)) + (0.5 * z))) - sqrt(t));
} else {
tmp = 2.0 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 5d-23) then
tmp = 2.0d0 + ((sqrt((1.0d0 + t)) + (sqrt((y + 1.0d0)) + (0.5d0 * z))) - sqrt(t))
else
tmp = 2.0d0 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5e-23) {
tmp = 2.0 + ((Math.sqrt((1.0 + t)) + (Math.sqrt((y + 1.0)) + (0.5 * z))) - Math.sqrt(t));
} else {
tmp = 2.0 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 5e-23: tmp = 2.0 + ((math.sqrt((1.0 + t)) + (math.sqrt((y + 1.0)) + (0.5 * z))) - math.sqrt(t)) else: tmp = 2.0 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 5e-23) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * z))) - sqrt(t))); else tmp = Float64(2.0 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 5e-23)
tmp = 2.0 + ((sqrt((1.0 + t)) + (sqrt((y + 1.0)) + (0.5 * z))) - sqrt(t));
else
tmp = 2.0 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 5e-23], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{-23}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + t} + \left(\sqrt{y + 1} + 0.5 \cdot z\right)\right) - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;2 - \sqrt{x}\\
\end{array}
\end{array}
if z < 5.0000000000000002e-23Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in z around 0 97.6%
associate--l+97.6%
Simplified97.6%
Taylor expanded in x around 0 15.1%
associate--l+39.2%
*-commutative39.2%
+-commutative39.2%
Simplified39.2%
Taylor expanded in t around inf 39.1%
if 5.0000000000000002e-23 < z Initial program 87.9%
associate-+l+87.9%
sub-neg87.9%
sub-neg87.9%
+-commutative87.9%
+-commutative87.9%
+-commutative87.9%
Simplified87.9%
Taylor expanded in z around 0 8.4%
associate--l+8.4%
Simplified8.4%
Taylor expanded in x around 0 4.0%
associate--l+8.5%
*-commutative8.5%
+-commutative8.5%
Simplified8.5%
Taylor expanded in x around inf 22.4%
mul-1-neg22.4%
Simplified22.4%
Final simplification31.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 4.0) (- 2.0 (sqrt x)) (* 0.5 (+ (sqrt (/ 1.0 y)) (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 <= 4.0) {
tmp = 2.0 - sqrt(x);
} else {
tmp = 0.5 * (sqrt((1.0 / y)) + 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 <= 4.0d0) then
tmp = 2.0d0 - sqrt(x)
else
tmp = 0.5d0 * (sqrt((1.0d0 / y)) + 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 <= 4.0) {
tmp = 2.0 - Math.sqrt(x);
} else {
tmp = 0.5 * (Math.sqrt((1.0 / y)) + 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 <= 4.0: tmp = 2.0 - math.sqrt(x) else: tmp = 0.5 * (math.sqrt((1.0 / y)) + 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 <= 4.0) tmp = Float64(2.0 - sqrt(x)); else tmp = Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + 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 <= 4.0)
tmp = 2.0 - sqrt(x);
else
tmp = 0.5 * (sqrt((1.0 / y)) + 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, 4.0], N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4:\\
\;\;\;\;2 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if x < 4Initial program 97.0%
associate-+l+97.0%
sub-neg97.0%
sub-neg97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in z around 0 53.0%
associate--l+53.0%
Simplified53.0%
Taylor expanded in x around 0 18.0%
associate--l+35.2%
*-commutative35.2%
+-commutative35.2%
Simplified35.2%
Taylor expanded in x around inf 38.6%
mul-1-neg38.6%
Simplified38.6%
if 4 < x Initial program 89.7%
associate-+l+89.7%
associate-+l+89.7%
+-commutative89.7%
+-commutative89.7%
associate-+l-62.8%
+-commutative62.8%
+-commutative62.8%
Simplified62.8%
Taylor expanded in z around inf 40.6%
Taylor expanded in x around inf 42.5%
Taylor expanded in y around inf 18.3%
Taylor expanded in t around inf 10.2%
distribute-lft-out10.2%
Simplified10.2%
Final simplification23.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 3.0) (- 2.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 <= 3.0) {
tmp = 2.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 <= 3.0d0) then
tmp = 2.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 <= 3.0) {
tmp = 2.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 <= 3.0: tmp = 2.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 <= 3.0) tmp = Float64(2.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 <= 3.0)
tmp = 2.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, 3.0], N[(2.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 3:\\
\;\;\;\;2 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 3Initial program 97.0%
associate-+l+97.0%
sub-neg97.0%
sub-neg97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in z around 0 53.0%
associate--l+53.0%
Simplified53.0%
Taylor expanded in x around 0 18.0%
associate--l+35.2%
*-commutative35.2%
+-commutative35.2%
Simplified35.2%
Taylor expanded in x around inf 38.6%
mul-1-neg38.6%
Simplified38.6%
if 3 < x Initial program 89.7%
associate-+l+89.7%
associate-+l+89.7%
+-commutative89.7%
+-commutative89.7%
associate-+l-62.8%
+-commutative62.8%
+-commutative62.8%
Simplified62.8%
Taylor expanded in z around inf 40.6%
Taylor expanded in x around inf 42.5%
Taylor expanded in y around inf 18.3%
Taylor expanded in x around 0 8.5%
Final simplification22.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 2.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 2.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 = 2.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 2.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 2.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(2.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 2.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[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
2 - \sqrt{x}
\end{array}
Initial program 93.1%
associate-+l+93.1%
sub-neg93.1%
sub-neg93.1%
+-commutative93.1%
+-commutative93.1%
+-commutative93.1%
Simplified93.1%
Taylor expanded in z around 0 56.5%
associate--l+56.5%
Simplified56.5%
Taylor expanded in x around 0 10.0%
associate--l+25.1%
*-commutative25.1%
+-commutative25.1%
Simplified25.1%
Taylor expanded in x around inf 19.1%
mul-1-neg19.1%
Simplified19.1%
Final simplification19.1%
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 93.1%
associate-+l+93.1%
sub-neg93.1%
sub-neg93.1%
+-commutative93.1%
+-commutative93.1%
+-commutative93.1%
Simplified93.1%
Taylor expanded in z around 0 56.5%
associate--l+56.5%
Simplified56.5%
Taylor expanded in z around inf 3.5%
Taylor expanded in z around 0 1.6%
neg-mul-11.6%
Simplified1.6%
Final simplification1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024055
(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))))