
(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)))
(t_2 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_3 (/ 1.0 (+ (sqrt y) t_1)))
(t_4 (- (sqrt (+ 1.0 x)) (sqrt x)))
(t_5 (+ t_4 (- t_1 (sqrt y))))
(t_6 (+ t_2 t_5))
(t_7 (sqrt (+ 1.0 t))))
(if (<= t_6 0.0)
(+ (+ (* 0.5 (sqrt (/ 1.0 x))) t_3) (+ t_2 (* (sqrt (/ 1.0 t)) -0.5)))
(if (<= t_6 2.0002)
(+ (+ t_4 t_3) (+ (- t_7 (sqrt t)) (* 0.5 (sqrt (/ 1.0 z)))))
(+ t_5 (+ t_2 (/ 1.0 (+ t_7 (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 = 1.0 / (sqrt(y) + t_1);
double t_4 = sqrt((1.0 + x)) - sqrt(x);
double t_5 = t_4 + (t_1 - sqrt(y));
double t_6 = t_2 + t_5;
double t_7 = sqrt((1.0 + t));
double tmp;
if (t_6 <= 0.0) {
tmp = ((0.5 * sqrt((1.0 / x))) + t_3) + (t_2 + (sqrt((1.0 / t)) * -0.5));
} else if (t_6 <= 2.0002) {
tmp = (t_4 + t_3) + ((t_7 - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
} else {
tmp = t_5 + (t_2 + (1.0 / (t_7 + 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) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
t_3 = 1.0d0 / (sqrt(y) + t_1)
t_4 = sqrt((1.0d0 + x)) - sqrt(x)
t_5 = t_4 + (t_1 - sqrt(y))
t_6 = t_2 + t_5
t_7 = sqrt((1.0d0 + t))
if (t_6 <= 0.0d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / x))) + t_3) + (t_2 + (sqrt((1.0d0 / t)) * (-0.5d0)))
else if (t_6 <= 2.0002d0) then
tmp = (t_4 + t_3) + ((t_7 - sqrt(t)) + (0.5d0 * sqrt((1.0d0 / z))))
else
tmp = t_5 + (t_2 + (1.0d0 / (t_7 + 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 = 1.0 / (Math.sqrt(y) + t_1);
double t_4 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double t_5 = t_4 + (t_1 - Math.sqrt(y));
double t_6 = t_2 + t_5;
double t_7 = Math.sqrt((1.0 + t));
double tmp;
if (t_6 <= 0.0) {
tmp = ((0.5 * Math.sqrt((1.0 / x))) + t_3) + (t_2 + (Math.sqrt((1.0 / t)) * -0.5));
} else if (t_6 <= 2.0002) {
tmp = (t_4 + t_3) + ((t_7 - Math.sqrt(t)) + (0.5 * Math.sqrt((1.0 / z))));
} else {
tmp = t_5 + (t_2 + (1.0 / (t_7 + 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 = 1.0 / (math.sqrt(y) + t_1) t_4 = math.sqrt((1.0 + x)) - math.sqrt(x) t_5 = t_4 + (t_1 - math.sqrt(y)) t_6 = t_2 + t_5 t_7 = math.sqrt((1.0 + t)) tmp = 0 if t_6 <= 0.0: tmp = ((0.5 * math.sqrt((1.0 / x))) + t_3) + (t_2 + (math.sqrt((1.0 / t)) * -0.5)) elif t_6 <= 2.0002: tmp = (t_4 + t_3) + ((t_7 - math.sqrt(t)) + (0.5 * math.sqrt((1.0 / z)))) else: tmp = t_5 + (t_2 + (1.0 / (t_7 + 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 = Float64(1.0 / Float64(sqrt(y) + t_1)) t_4 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) t_5 = Float64(t_4 + Float64(t_1 - sqrt(y))) t_6 = Float64(t_2 + t_5) t_7 = sqrt(Float64(1.0 + t)) tmp = 0.0 if (t_6 <= 0.0) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_3) + Float64(t_2 + Float64(sqrt(Float64(1.0 / t)) * -0.5))); elseif (t_6 <= 2.0002) tmp = Float64(Float64(t_4 + t_3) + Float64(Float64(t_7 - sqrt(t)) + Float64(0.5 * sqrt(Float64(1.0 / z))))); else tmp = Float64(t_5 + Float64(t_2 + Float64(1.0 / Float64(t_7 + 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 = 1.0 / (sqrt(y) + t_1);
t_4 = sqrt((1.0 + x)) - sqrt(x);
t_5 = t_4 + (t_1 - sqrt(y));
t_6 = t_2 + t_5;
t_7 = sqrt((1.0 + t));
tmp = 0.0;
if (t_6 <= 0.0)
tmp = ((0.5 * sqrt((1.0 / x))) + t_3) + (t_2 + (sqrt((1.0 / t)) * -0.5));
elseif (t_6 <= 2.0002)
tmp = (t_4 + t_3) + ((t_7 - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
else
tmp = t_5 + (t_2 + (1.0 / (t_7 + 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[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$2 + t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$6, 0.0], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(t$95$2 + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 2.0002], N[(N[(t$95$4 + t$95$3), $MachinePrecision] + N[(N[(t$95$7 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$5 + N[(t$95$2 + N[(1.0 / N[(t$95$7 + 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 := \frac{1}{\sqrt{y} + t\_1}\\
t_4 := \sqrt{1 + x} - \sqrt{x}\\
t_5 := t\_4 + \left(t\_1 - \sqrt{y}\right)\\
t_6 := t\_2 + t\_5\\
t_7 := \sqrt{1 + t}\\
\mathbf{if}\;t\_6 \leq 0:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{x}} + t\_3\right) + \left(t\_2 + \sqrt{\frac{1}{t}} \cdot -0.5\right)\\
\mathbf{elif}\;t\_6 \leq 2.0002:\\
\;\;\;\;\left(t\_4 + t\_3\right) + \left(\left(t\_7 - \sqrt{t}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_5 + \left(t\_2 + \frac{1}{t\_7 + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 0.0Initial program 43.5%
associate-+l+43.5%
sub-neg43.5%
sub-neg43.5%
+-commutative43.5%
+-commutative43.5%
+-commutative43.5%
Simplified43.5%
+-commutative43.5%
flip--43.5%
flip--43.5%
frac-add43.5%
Applied egg-rr44.3%
*-commutative44.3%
*-commutative44.3%
+-commutative44.3%
*-commutative44.3%
associate-/r*44.3%
Simplified75.2%
add-cbrt-cube74.9%
pow374.9%
Applied egg-rr74.9%
Taylor expanded in t around -inf 33.4%
*-commutative33.4%
Simplified33.4%
Taylor expanded in x around inf 33.7%
if 0.0 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 2.00019999999999998Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in z around inf 47.9%
flip--48.0%
div-inv48.0%
add-sqr-sqrt41.7%
add-sqr-sqrt48.2%
Applied egg-rr48.2%
associate-*r/48.2%
*-rgt-identity48.2%
associate--l+48.4%
+-inverses48.4%
metadata-eval48.4%
+-commutative48.4%
Simplified48.4%
if 2.00019999999999998 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 99.6%
associate-+l+99.6%
sub-neg99.6%
sub-neg99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
flip--99.8%
div-inv99.8%
add-sqr-sqrt78.9%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
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)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_5 (- (sqrt (+ 1.0 x)) (sqrt x)))
(t_6 (+ t_3 (+ t_5 (- t_1 (sqrt y)))))
(t_7 (/ 1.0 (+ (sqrt y) t_1))))
(if (<= t_6 0.0)
(+ (+ (* 0.5 (sqrt (/ 1.0 x))) t_7) (+ t_3 (* (sqrt (/ 1.0 t)) -0.5)))
(if (<= t_6 1.2)
(+ (+ t_5 t_7) (+ t_4 (* 0.5 (sqrt (/ 1.0 z)))))
(+
(+ t_4 (/ 1.0 (+ t_2 (sqrt z))))
(+ 1.0 (- 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 t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + t)) - sqrt(t);
double t_5 = sqrt((1.0 + x)) - sqrt(x);
double t_6 = t_3 + (t_5 + (t_1 - sqrt(y)));
double t_7 = 1.0 / (sqrt(y) + t_1);
double tmp;
if (t_6 <= 0.0) {
tmp = ((0.5 * sqrt((1.0 / x))) + t_7) + (t_3 + (sqrt((1.0 / t)) * -0.5));
} else if (t_6 <= 1.2) {
tmp = (t_5 + t_7) + (t_4 + (0.5 * sqrt((1.0 / z))));
} else {
tmp = (t_4 + (1.0 / (t_2 + sqrt(z)))) + (1.0 + (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) :: 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))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + t)) - sqrt(t)
t_5 = sqrt((1.0d0 + x)) - sqrt(x)
t_6 = t_3 + (t_5 + (t_1 - sqrt(y)))
t_7 = 1.0d0 / (sqrt(y) + t_1)
if (t_6 <= 0.0d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / x))) + t_7) + (t_3 + (sqrt((1.0d0 / t)) * (-0.5d0)))
else if (t_6 <= 1.2d0) then
tmp = (t_5 + t_7) + (t_4 + (0.5d0 * sqrt((1.0d0 / z))))
else
tmp = (t_4 + (1.0d0 / (t_2 + sqrt(z)))) + (1.0d0 + (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 t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_5 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double t_6 = t_3 + (t_5 + (t_1 - Math.sqrt(y)));
double t_7 = 1.0 / (Math.sqrt(y) + t_1);
double tmp;
if (t_6 <= 0.0) {
tmp = ((0.5 * Math.sqrt((1.0 / x))) + t_7) + (t_3 + (Math.sqrt((1.0 / t)) * -0.5));
} else if (t_6 <= 1.2) {
tmp = (t_5 + t_7) + (t_4 + (0.5 * Math.sqrt((1.0 / z))));
} else {
tmp = (t_4 + (1.0 / (t_2 + Math.sqrt(z)))) + (1.0 + (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)) t_2 = math.sqrt((1.0 + z)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((1.0 + t)) - math.sqrt(t) t_5 = math.sqrt((1.0 + x)) - math.sqrt(x) t_6 = t_3 + (t_5 + (t_1 - math.sqrt(y))) t_7 = 1.0 / (math.sqrt(y) + t_1) tmp = 0 if t_6 <= 0.0: tmp = ((0.5 * math.sqrt((1.0 / x))) + t_7) + (t_3 + (math.sqrt((1.0 / t)) * -0.5)) elif t_6 <= 1.2: tmp = (t_5 + t_7) + (t_4 + (0.5 * math.sqrt((1.0 / z)))) else: tmp = (t_4 + (1.0 / (t_2 + math.sqrt(z)))) + (1.0 + (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)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(t_2 - sqrt(z)) t_4 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_5 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) t_6 = Float64(t_3 + Float64(t_5 + Float64(t_1 - sqrt(y)))) t_7 = Float64(1.0 / Float64(sqrt(y) + t_1)) tmp = 0.0 if (t_6 <= 0.0) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_7) + Float64(t_3 + Float64(sqrt(Float64(1.0 / t)) * -0.5))); elseif (t_6 <= 1.2) tmp = Float64(Float64(t_5 + t_7) + Float64(t_4 + Float64(0.5 * sqrt(Float64(1.0 / z))))); else tmp = Float64(Float64(t_4 + Float64(1.0 / Float64(t_2 + sqrt(z)))) + Float64(1.0 + 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));
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((1.0 + t)) - sqrt(t);
t_5 = sqrt((1.0 + x)) - sqrt(x);
t_6 = t_3 + (t_5 + (t_1 - sqrt(y)));
t_7 = 1.0 / (sqrt(y) + t_1);
tmp = 0.0;
if (t_6 <= 0.0)
tmp = ((0.5 * sqrt((1.0 / x))) + t_7) + (t_3 + (sqrt((1.0 / t)) * -0.5));
elseif (t_6 <= 1.2)
tmp = (t_5 + t_7) + (t_4 + (0.5 * sqrt((1.0 / z))));
else
tmp = (t_4 + (1.0 / (t_2 + sqrt(z)))) + (1.0 + (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]}, 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[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$3 + N[(t$95$5 + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, 0.0], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision] + N[(t$95$3 + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 1.2], N[(N[(t$95$5 + t$95$7), $MachinePrecision] + N[(t$95$4 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$4 + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{1 + z}\\
t_3 := t\_2 - \sqrt{z}\\
t_4 := \sqrt{1 + t} - \sqrt{t}\\
t_5 := \sqrt{1 + x} - \sqrt{x}\\
t_6 := t\_3 + \left(t\_5 + \left(t\_1 - \sqrt{y}\right)\right)\\
t_7 := \frac{1}{\sqrt{y} + t\_1}\\
\mathbf{if}\;t\_6 \leq 0:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{x}} + t\_7\right) + \left(t\_3 + \sqrt{\frac{1}{t}} \cdot -0.5\right)\\
\mathbf{elif}\;t\_6 \leq 1.2:\\
\;\;\;\;\left(t\_5 + t\_7\right) + \left(t\_4 + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_4 + \frac{1}{t\_2 + \sqrt{z}}\right) + \left(1 + \left(t\_1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 0.0Initial program 43.5%
associate-+l+43.5%
sub-neg43.5%
sub-neg43.5%
+-commutative43.5%
+-commutative43.5%
+-commutative43.5%
Simplified43.5%
+-commutative43.5%
flip--43.5%
flip--43.5%
frac-add43.5%
Applied egg-rr44.3%
*-commutative44.3%
*-commutative44.3%
+-commutative44.3%
*-commutative44.3%
associate-/r*44.3%
Simplified75.2%
add-cbrt-cube74.9%
pow374.9%
Applied egg-rr74.9%
Taylor expanded in t around -inf 33.4%
*-commutative33.4%
Simplified33.4%
Taylor expanded in x around inf 33.7%
if 0.0 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 1.19999999999999996Initial program 96.4%
associate-+l+96.4%
sub-neg96.4%
sub-neg96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
Taylor expanded in z around inf 56.7%
flip--56.9%
div-inv56.9%
add-sqr-sqrt45.4%
add-sqr-sqrt57.2%
Applied egg-rr57.2%
associate-*r/57.2%
*-rgt-identity57.2%
associate--l+57.6%
+-inverses57.6%
metadata-eval57.6%
+-commutative57.6%
Simplified57.6%
if 1.19999999999999996 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 55.7%
associate--l+70.2%
+-commutative70.2%
Simplified70.2%
flip--98.0%
div-inv98.0%
add-sqr-sqrt86.8%
add-sqr-sqrt98.0%
Applied egg-rr70.2%
associate-*r/98.0%
*-rgt-identity98.0%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified70.4%
Final simplification62.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) (sqrt (+ y 1.0))))
(t_2 (+ (sqrt x) (sqrt (+ 1.0 x)))))
(+
(/ (/ (+ t_1 t_2) t_2) t_1)
(+ (- (sqrt (+ 1.0 z)) (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(y) + sqrt((y + 1.0));
double t_2 = sqrt(x) + sqrt((1.0 + x));
return (((t_1 + t_2) / t_2) / t_1) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
}
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
t_1 = sqrt(y) + sqrt((y + 1.0d0))
t_2 = sqrt(x) + sqrt((1.0d0 + x))
code = (((t_1 + t_2) / t_2) / t_1) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt((y + 1.0));
double t_2 = Math.sqrt(x) + Math.sqrt((1.0 + x));
return (((t_1 + t_2) / t_2) / t_1) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt((y + 1.0)) t_2 = math.sqrt(x) + math.sqrt((1.0 + x)) return (((t_1 + t_2) / t_2) / t_1) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(Float64(y + 1.0))) t_2 = Float64(sqrt(x) + sqrt(Float64(1.0 + x))) return Float64(Float64(Float64(Float64(t_1 + t_2) / t_2) / t_1) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
t_1 = sqrt(y) + sqrt((y + 1.0));
t_2 = sqrt(x) + sqrt((1.0 + x));
tmp = (((t_1 + t_2) / t_2) / t_1) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(t$95$1 + t$95$2), $MachinePrecision] / t$95$2), $MachinePrecision] / t$95$1), $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]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{y + 1}\\
t_2 := \sqrt{x} + \sqrt{1 + x}\\
\frac{\frac{t\_1 + t\_2}{t\_2}}{t\_1} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
\end{array}
Initial program 93.3%
associate-+l+93.3%
sub-neg93.3%
sub-neg93.3%
+-commutative93.3%
+-commutative93.3%
+-commutative93.3%
Simplified93.3%
+-commutative93.3%
flip--93.3%
flip--93.4%
frac-add93.4%
Applied egg-rr93.9%
*-commutative93.9%
*-commutative93.9%
+-commutative93.9%
*-commutative93.9%
associate-/r*93.9%
Simplified96.7%
Final simplification96.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)) (sqrt x)))
(t_2 (sqrt (+ y 1.0)))
(t_3 (sqrt (+ 1.0 z))))
(if (<= t_1 0.0)
(+
(+ (* 0.5 (sqrt (/ 1.0 x))) (/ 1.0 (+ (sqrt y) t_2)))
(+ (- t_3 (sqrt z)) (* (sqrt (/ 1.0 t)) -0.5)))
(+
(+ t_1 (- t_2 (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_3 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double t_2 = sqrt((y + 1.0));
double t_3 = sqrt((1.0 + z));
double tmp;
if (t_1 <= 0.0) {
tmp = ((0.5 * sqrt((1.0 / x))) + (1.0 / (sqrt(y) + t_2))) + ((t_3 - sqrt(z)) + (sqrt((1.0 / t)) * -0.5));
} else {
tmp = (t_1 + (t_2 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_3 + sqrt(z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
t_2 = sqrt((y + 1.0d0))
t_3 = sqrt((1.0d0 + z))
if (t_1 <= 0.0d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / x))) + (1.0d0 / (sqrt(y) + t_2))) + ((t_3 - sqrt(z)) + (sqrt((1.0d0 / t)) * (-0.5d0)))
else
tmp = (t_1 + (t_2 - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_3 + sqrt(z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double t_2 = Math.sqrt((y + 1.0));
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if (t_1 <= 0.0) {
tmp = ((0.5 * Math.sqrt((1.0 / x))) + (1.0 / (Math.sqrt(y) + t_2))) + ((t_3 - Math.sqrt(z)) + (Math.sqrt((1.0 / t)) * -0.5));
} else {
tmp = (t_1 + (t_2 - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_3 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) t_2 = math.sqrt((y + 1.0)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if t_1 <= 0.0: tmp = ((0.5 * math.sqrt((1.0 / x))) + (1.0 / (math.sqrt(y) + t_2))) + ((t_3 - math.sqrt(z)) + (math.sqrt((1.0 / t)) * -0.5)) else: tmp = (t_1 + (t_2 - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_3 + math.sqrt(z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) t_2 = sqrt(Float64(y + 1.0)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(1.0 / Float64(sqrt(y) + t_2))) + Float64(Float64(t_3 - sqrt(z)) + Float64(sqrt(Float64(1.0 / t)) * -0.5))); else tmp = Float64(Float64(t_1 + Float64(t_2 - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_3 + sqrt(z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
t_2 = sqrt((y + 1.0));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if (t_1 <= 0.0)
tmp = ((0.5 * sqrt((1.0 / x))) + (1.0 / (sqrt(y) + t_2))) + ((t_3 - sqrt(z)) + (sqrt((1.0 / t)) * -0.5));
else
tmp = (t_1 + (t_2 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_3 + sqrt(z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
t_2 := \sqrt{y + 1}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{x}} + \frac{1}{\sqrt{y} + t\_2}\right) + \left(\left(t\_3 - \sqrt{z}\right) + \sqrt{\frac{1}{t}} \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \left(t\_2 - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t\_3 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.0Initial program 89.3%
associate-+l+89.3%
sub-neg89.3%
sub-neg89.3%
+-commutative89.3%
+-commutative89.3%
+-commutative89.3%
Simplified89.3%
+-commutative89.3%
flip--89.3%
flip--89.3%
frac-add89.3%
Applied egg-rr89.8%
*-commutative89.8%
*-commutative89.8%
+-commutative89.8%
*-commutative89.8%
associate-/r*89.8%
Simplified94.9%
add-cbrt-cube94.9%
pow394.8%
Applied egg-rr94.8%
Taylor expanded in t around -inf 52.5%
*-commutative52.5%
Simplified52.5%
Taylor expanded in x around inf 52.6%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
flip--97.6%
div-inv97.6%
add-sqr-sqrt76.5%
add-sqr-sqrt97.6%
Applied egg-rr97.6%
associate-*r/97.6%
*-rgt-identity97.6%
associate--l+98.3%
+-inverses98.3%
metadata-eval98.3%
+-commutative98.3%
Simplified98.3%
Final simplification74.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= (- t_1 (sqrt x)) 0.9999999999999998)
(+ (+ t_2 (* (sqrt (/ 1.0 t)) -0.5)) (/ 1.0 (+ (sqrt x) t_1)))
(+
(+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if ((t_1 - sqrt(x)) <= 0.9999999999999998) {
tmp = (t_2 + (sqrt((1.0 / t)) * -0.5)) + (1.0 / (sqrt(x) + t_1));
} else {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if ((t_1 - sqrt(x)) <= 0.9999999999999998d0) then
tmp = (t_2 + (sqrt((1.0d0 / t)) * (-0.5d0))) + (1.0d0 / (sqrt(x) + t_1))
else
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if ((t_1 - Math.sqrt(x)) <= 0.9999999999999998) {
tmp = (t_2 + (Math.sqrt((1.0 / t)) * -0.5)) + (1.0 / (Math.sqrt(x) + t_1));
} else {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if (t_1 - math.sqrt(x)) <= 0.9999999999999998: tmp = (t_2 + (math.sqrt((1.0 / t)) * -0.5)) + (1.0 / (math.sqrt(x) + t_1)) else: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (Float64(t_1 - sqrt(x)) <= 0.9999999999999998) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 / t)) * -0.5)) + Float64(1.0 / Float64(sqrt(x) + t_1))); else tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if ((t_1 - sqrt(x)) <= 0.9999999999999998)
tmp = (t_2 + (sqrt((1.0 / t)) * -0.5)) + (1.0 / (sqrt(x) + t_1));
else
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.9999999999999998], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;t\_1 - \sqrt{x} \leq 0.9999999999999998:\\
\;\;\;\;\left(t\_2 + \sqrt{\frac{1}{t}} \cdot -0.5\right) + \frac{1}{\sqrt{x} + t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.99999999999999978Initial program 89.5%
associate-+l+89.5%
sub-neg89.5%
sub-neg89.5%
+-commutative89.5%
+-commutative89.5%
+-commutative89.5%
Simplified89.5%
+-commutative89.5%
flip--89.5%
flip--89.7%
frac-add89.7%
Applied egg-rr90.3%
*-commutative90.3%
*-commutative90.3%
+-commutative90.3%
*-commutative90.3%
associate-/r*90.3%
Simplified95.1%
add-cbrt-cube95.0%
pow395.0%
Applied egg-rr95.0%
Taylor expanded in t around -inf 52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in y around inf 27.5%
if 0.99999999999999978 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 64.7%
associate--l+97.9%
+-commutative97.9%
Simplified97.9%
Final simplification58.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= x 6e-32)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_1 (sqrt z))))
(+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x)))))
(+
(+ (- t_1 (sqrt z)) (* (sqrt (/ 1.0 t)) -0.5))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (x <= 6e-32) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x))));
} else {
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0 / t)) * -0.5)) + (1.0 / (sqrt(x) + sqrt((1.0 + x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (x <= 6d-32) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_1 + sqrt(z)))) + (1.0d0 + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x))))
else
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0d0 / t)) * (-0.5d0))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (x <= 6e-32) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_1 + Math.sqrt(z)))) + (1.0 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x))));
} else {
tmp = ((t_1 - Math.sqrt(z)) + (Math.sqrt((1.0 / t)) * -0.5)) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if x <= 6e-32: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_1 + math.sqrt(z)))) + (1.0 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x)))) else: tmp = ((t_1 - math.sqrt(z)) + (math.sqrt((1.0 / t)) * -0.5)) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (x <= 6e-32) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_1 + sqrt(z)))) + Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x))))); else tmp = Float64(Float64(Float64(t_1 - sqrt(z)) + Float64(sqrt(Float64(1.0 / t)) * -0.5)) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (x <= 6e-32)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x))));
else
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0 / t)) * -0.5)) + (1.0 / (sqrt(x) + sqrt((1.0 + x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 6e-32], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;x \leq 6 \cdot 10^{-32}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t\_1 + \sqrt{z}}\right) + \left(1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{z}\right) + \sqrt{\frac{1}{t}} \cdot -0.5\right) + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if x < 6.0000000000000001e-32Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 64.7%
associate--l+97.9%
+-commutative97.9%
Simplified97.9%
flip--97.9%
div-inv97.9%
add-sqr-sqrt76.7%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
associate--l+98.7%
+-inverses98.7%
metadata-eval98.7%
+-commutative98.7%
Simplified98.7%
if 6.0000000000000001e-32 < x Initial program 89.5%
associate-+l+89.5%
sub-neg89.5%
sub-neg89.5%
+-commutative89.5%
+-commutative89.5%
+-commutative89.5%
Simplified89.5%
+-commutative89.5%
flip--89.5%
flip--89.7%
frac-add89.7%
Applied egg-rr90.3%
*-commutative90.3%
*-commutative90.3%
+-commutative90.3%
*-commutative90.3%
associate-/r*90.3%
Simplified95.1%
add-cbrt-cube95.0%
pow395.0%
Applied egg-rr95.0%
Taylor expanded in t around -inf 52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in y around inf 27.5%
Final simplification59.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 1.55e+16)
(+
(+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t)))
(- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x))))
(+
(+ t_1 (* (sqrt (/ 1.0 t)) -0.5))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 1.55e+16) {
tmp = (t_1 + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x)));
} else {
tmp = (t_1 + (sqrt((1.0 / t)) * -0.5)) + (1.0 / (sqrt(x) + sqrt((1.0 + x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 1.55d+16) then
tmp = (t_1 + (sqrt((1.0d0 + t)) - sqrt(t))) + ((1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x)))
else
tmp = (t_1 + (sqrt((1.0d0 / t)) * (-0.5d0))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 1.55e+16) {
tmp = (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (t_1 + (Math.sqrt((1.0 / t)) * -0.5)) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 1.55e+16: tmp = (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (t_1 + (math.sqrt((1.0 / t)) * -0.5)) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 1.55e+16) tmp = Float64(Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(t_1 + Float64(sqrt(Float64(1.0 / t)) * -0.5)) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 1.55e+16)
tmp = (t_1 + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x)));
else
tmp = (t_1 + (sqrt((1.0 / t)) * -0.5)) + (1.0 / (sqrt(x) + sqrt((1.0 + x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.55e+16], N[(N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 1.55 \cdot 10^{+16}:\\
\;\;\;\;\left(t\_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \sqrt{\frac{1}{t}} \cdot -0.5\right) + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 1.55e16Initial program 97.3%
associate-+l+97.3%
sub-neg97.3%
sub-neg97.3%
+-commutative97.3%
+-commutative97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in x around 0 49.8%
if 1.55e16 < y Initial program 88.5%
associate-+l+88.5%
sub-neg88.5%
sub-neg88.5%
+-commutative88.5%
+-commutative88.5%
+-commutative88.5%
Simplified88.5%
+-commutative88.5%
flip--88.5%
flip--88.5%
frac-add88.5%
Applied egg-rr88.7%
*-commutative88.7%
*-commutative88.7%
+-commutative88.7%
*-commutative88.7%
associate-/r*88.7%
Simplified94.2%
add-cbrt-cube94.2%
pow394.2%
Applied egg-rr94.2%
Taylor expanded in t around -inf 45.4%
*-commutative45.4%
Simplified45.4%
Taylor expanded in y around inf 43.4%
Final simplification46.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (* (sqrt (/ 1.0 t)) -0.5))
(t_3 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 5.5e-31)
(+ (+ t_3 (- (sqrt (+ 1.0 t)) (sqrt t))) (- 2.0 (+ (sqrt y) (sqrt x))))
(if (<= y 1.25e+29)
(+
(+ (- t_1 (sqrt x)) (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0)))))
(+ t_2 (* 0.5 (sqrt (/ 1.0 z)))))
(+ (+ t_3 t_2) (/ 1.0 (+ (sqrt x) t_1)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 / t)) * -0.5;
double t_3 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 5.5e-31) {
tmp = (t_3 + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - (sqrt(y) + sqrt(x)));
} else if (y <= 1.25e+29) {
tmp = ((t_1 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) + (t_2 + (0.5 * sqrt((1.0 / z))));
} else {
tmp = (t_3 + t_2) + (1.0 / (sqrt(x) + t_1));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 / t)) * (-0.5d0)
t_3 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 5.5d-31) then
tmp = (t_3 + (sqrt((1.0d0 + t)) - sqrt(t))) + (2.0d0 - (sqrt(y) + sqrt(x)))
else if (y <= 1.25d+29) then
tmp = ((t_1 - sqrt(x)) + (1.0d0 / (sqrt(y) + sqrt((y + 1.0d0))))) + (t_2 + (0.5d0 * sqrt((1.0d0 / z))))
else
tmp = (t_3 + t_2) + (1.0d0 / (sqrt(x) + t_1))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 / t)) * -0.5;
double t_3 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 5.5e-31) {
tmp = (t_3 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (2.0 - (Math.sqrt(y) + Math.sqrt(x)));
} else if (y <= 1.25e+29) {
tmp = ((t_1 - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0))))) + (t_2 + (0.5 * Math.sqrt((1.0 / z))));
} else {
tmp = (t_3 + t_2) + (1.0 / (Math.sqrt(x) + t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 / t)) * -0.5 t_3 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 5.5e-31: tmp = (t_3 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (2.0 - (math.sqrt(y) + math.sqrt(x))) elif y <= 1.25e+29: tmp = ((t_1 - math.sqrt(x)) + (1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))))) + (t_2 + (0.5 * math.sqrt((1.0 / z)))) else: tmp = (t_3 + t_2) + (1.0 / (math.sqrt(x) + t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(sqrt(Float64(1.0 / t)) * -0.5) t_3 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 5.5e-31) tmp = Float64(Float64(t_3 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(2.0 - Float64(sqrt(y) + sqrt(x)))); elseif (y <= 1.25e+29) tmp = Float64(Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0))))) + Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / z))))); else tmp = Float64(Float64(t_3 + t_2) + Float64(1.0 / Float64(sqrt(x) + t_1))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 / t)) * -0.5;
t_3 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 5.5e-31)
tmp = (t_3 + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - (sqrt(y) + sqrt(x)));
elseif (y <= 1.25e+29)
tmp = ((t_1 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) + (t_2 + (0.5 * sqrt((1.0 / z))));
else
tmp = (t_3 + t_2) + (1.0 / (sqrt(x) + t_1));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.5e-31], N[(N[(t$95$3 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e+29], N[(N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 + t$95$2), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{\frac{1}{t}} \cdot -0.5\\
t_3 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 5.5 \cdot 10^{-31}:\\
\;\;\;\;\left(t\_3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(2 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+29}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \sqrt{y + 1}}\right) + \left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_3 + t\_2\right) + \frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 5.49999999999999958e-31Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 50.6%
Taylor expanded in y around 0 50.6%
if 5.49999999999999958e-31 < y < 1.25e29Initial program 90.0%
associate-+l+90.0%
sub-neg90.0%
sub-neg90.0%
+-commutative90.0%
+-commutative90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in z around inf 39.2%
flip--40.1%
div-inv40.1%
add-sqr-sqrt38.0%
add-sqr-sqrt41.9%
Applied egg-rr41.9%
associate-*r/41.9%
*-rgt-identity41.9%
associate--l+43.7%
+-inverses43.7%
metadata-eval43.7%
+-commutative43.7%
Simplified43.7%
Taylor expanded in t around -inf 8.2%
*-commutative43.9%
Simplified8.2%
if 1.25e29 < y Initial program 88.6%
associate-+l+88.6%
sub-neg88.6%
sub-neg88.6%
+-commutative88.6%
+-commutative88.6%
+-commutative88.6%
Simplified88.6%
+-commutative88.6%
flip--88.6%
flip--88.6%
frac-add88.6%
Applied egg-rr88.9%
*-commutative88.9%
*-commutative88.9%
+-commutative88.9%
*-commutative88.9%
associate-/r*88.9%
Simplified94.1%
add-cbrt-cube94.0%
pow394.0%
Applied egg-rr94.0%
Taylor expanded in t around -inf 44.9%
*-commutative44.9%
Simplified44.9%
Taylor expanded in y around inf 43.1%
Final simplification43.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) (sqrt x)))
(t_2 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_3 (sqrt (+ 1.0 x))))
(if (<= y 1.12e-29)
(+ (+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t))) (- 2.0 t_1))
(if (<= y 1.15e+15)
(+ t_3 (+ (sqrt (+ y 1.0)) (- (* 0.5 (sqrt (/ 1.0 z))) t_1)))
(+ (+ t_2 (* (sqrt (/ 1.0 t)) -0.5)) (/ 1.0 (+ (sqrt x) t_3)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(x);
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double t_3 = sqrt((1.0 + x));
double tmp;
if (y <= 1.12e-29) {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - t_1);
} else if (y <= 1.15e+15) {
tmp = t_3 + (sqrt((y + 1.0)) + ((0.5 * sqrt((1.0 / z))) - t_1));
} else {
tmp = (t_2 + (sqrt((1.0 / t)) * -0.5)) + (1.0 / (sqrt(x) + t_3));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
t_3 = sqrt((1.0d0 + x))
if (y <= 1.12d-29) then
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + (2.0d0 - t_1)
else if (y <= 1.15d+15) then
tmp = t_3 + (sqrt((y + 1.0d0)) + ((0.5d0 * sqrt((1.0d0 / z))) - t_1))
else
tmp = (t_2 + (sqrt((1.0d0 / t)) * (-0.5d0))) + (1.0d0 / (sqrt(x) + 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(y) + Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 1.12e-29) {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (2.0 - t_1);
} else if (y <= 1.15e+15) {
tmp = t_3 + (Math.sqrt((y + 1.0)) + ((0.5 * Math.sqrt((1.0 / z))) - t_1));
} else {
tmp = (t_2 + (Math.sqrt((1.0 / t)) * -0.5)) + (1.0 / (Math.sqrt(x) + t_3));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(x) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) t_3 = math.sqrt((1.0 + x)) tmp = 0 if y <= 1.12e-29: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (2.0 - t_1) elif y <= 1.15e+15: tmp = t_3 + (math.sqrt((y + 1.0)) + ((0.5 * math.sqrt((1.0 / z))) - t_1)) else: tmp = (t_2 + (math.sqrt((1.0 / t)) * -0.5)) + (1.0 / (math.sqrt(x) + t_3)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 1.12e-29) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(2.0 - t_1)); elseif (y <= 1.15e+15) tmp = Float64(t_3 + Float64(sqrt(Float64(y + 1.0)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - t_1))); else tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 / t)) * -0.5)) + Float64(1.0 / Float64(sqrt(x) + 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(y) + sqrt(x);
t_2 = sqrt((1.0 + z)) - sqrt(z);
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 1.12e-29)
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - t_1);
elseif (y <= 1.15e+15)
tmp = t_3 + (sqrt((y + 1.0)) + ((0.5 * sqrt((1.0 / z))) - t_1));
else
tmp = (t_2 + (sqrt((1.0 / t)) * -0.5)) + (1.0 / (sqrt(x) + 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[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $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]}, If[LessEqual[y, 1.12e-29], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+15], N[(t$95$3 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 1.12 \cdot 10^{-29}:\\
\;\;\;\;\left(t\_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(2 - t\_1\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+15}:\\
\;\;\;\;t\_3 + \left(\sqrt{y + 1} + \left(0.5 \cdot \sqrt{\frac{1}{z}} - t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 + \sqrt{\frac{1}{t}} \cdot -0.5\right) + \frac{1}{\sqrt{x} + t\_3}\\
\end{array}
\end{array}
if y < 1.11999999999999995e-29Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 50.6%
Taylor expanded in y around 0 50.6%
if 1.11999999999999995e-29 < y < 1.15e15Initial program 91.2%
associate-+l+91.2%
sub-neg91.2%
sub-neg91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 15.0%
associate--l+18.6%
+-commutative18.6%
Simplified18.6%
Taylor expanded in z around inf 8.3%
associate--l+8.3%
Simplified8.3%
if 1.15e15 < y Initial program 88.5%
associate-+l+88.5%
sub-neg88.5%
sub-neg88.5%
+-commutative88.5%
+-commutative88.5%
+-commutative88.5%
Simplified88.5%
+-commutative88.5%
flip--88.5%
flip--88.5%
frac-add88.5%
Applied egg-rr88.7%
*-commutative88.7%
*-commutative88.7%
+-commutative88.7%
*-commutative88.7%
associate-/r*88.7%
Simplified94.2%
add-cbrt-cube94.2%
pow394.2%
Applied egg-rr94.2%
Taylor expanded in t around -inf 45.4%
*-commutative45.4%
Simplified45.4%
Taylor expanded in y around inf 43.4%
Final simplification44.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 5.5e-31)
(+ t_2 (+ 1.0 (- (- t_1 (sqrt x)) (+ (sqrt y) (sqrt z)))))
(if (<= y 8.2e+14)
(+
t_2
(+
(sqrt (+ y 1.0))
(- (* 0.5 (sqrt (/ 1.0 z))) (+ (sqrt y) (sqrt x)))))
(+
(+ (- t_1 (sqrt z)) (* (sqrt (/ 1.0 t)) -0.5))
(/ 1.0 (+ (sqrt x) t_2)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 5.5e-31) {
tmp = t_2 + (1.0 + ((t_1 - sqrt(x)) - (sqrt(y) + sqrt(z))));
} else if (y <= 8.2e+14) {
tmp = t_2 + (sqrt((y + 1.0)) + ((0.5 * sqrt((1.0 / z))) - (sqrt(y) + sqrt(x))));
} else {
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0 / t)) * -0.5)) + (1.0 / (sqrt(x) + t_2));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (y <= 5.5d-31) then
tmp = t_2 + (1.0d0 + ((t_1 - sqrt(x)) - (sqrt(y) + sqrt(z))))
else if (y <= 8.2d+14) then
tmp = t_2 + (sqrt((y + 1.0d0)) + ((0.5d0 * sqrt((1.0d0 / z))) - (sqrt(y) + sqrt(x))))
else
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0d0 / t)) * (-0.5d0))) + (1.0d0 / (sqrt(x) + t_2))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 5.5e-31) {
tmp = t_2 + (1.0 + ((t_1 - Math.sqrt(x)) - (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 8.2e+14) {
tmp = t_2 + (Math.sqrt((y + 1.0)) + ((0.5 * Math.sqrt((1.0 / z))) - (Math.sqrt(y) + Math.sqrt(x))));
} else {
tmp = ((t_1 - Math.sqrt(z)) + (Math.sqrt((1.0 / t)) * -0.5)) + (1.0 / (Math.sqrt(x) + t_2));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 5.5e-31: tmp = t_2 + (1.0 + ((t_1 - math.sqrt(x)) - (math.sqrt(y) + math.sqrt(z)))) elif y <= 8.2e+14: tmp = t_2 + (math.sqrt((y + 1.0)) + ((0.5 * math.sqrt((1.0 / z))) - (math.sqrt(y) + math.sqrt(x)))) else: tmp = ((t_1 - math.sqrt(z)) + (math.sqrt((1.0 / t)) * -0.5)) + (1.0 / (math.sqrt(x) + t_2)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 5.5e-31) tmp = Float64(t_2 + Float64(1.0 + Float64(Float64(t_1 - sqrt(x)) - Float64(sqrt(y) + sqrt(z))))); elseif (y <= 8.2e+14) tmp = Float64(t_2 + Float64(sqrt(Float64(y + 1.0)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - Float64(sqrt(y) + sqrt(x))))); else tmp = Float64(Float64(Float64(t_1 - sqrt(z)) + Float64(sqrt(Float64(1.0 / t)) * -0.5)) + Float64(1.0 / Float64(sqrt(x) + t_2))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 5.5e-31)
tmp = t_2 + (1.0 + ((t_1 - sqrt(x)) - (sqrt(y) + sqrt(z))));
elseif (y <= 8.2e+14)
tmp = t_2 + (sqrt((y + 1.0)) + ((0.5 * sqrt((1.0 / z))) - (sqrt(y) + sqrt(x))));
else
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0 / t)) * -0.5)) + (1.0 / (sqrt(x) + t_2));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.5e-31], N[(t$95$2 + N[(1.0 + N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+14], N[(t$95$2 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 5.5 \cdot 10^{-31}:\\
\;\;\;\;t\_2 + \left(1 + \left(\left(t\_1 - \sqrt{x}\right) - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+14}:\\
\;\;\;\;t\_2 + \left(\sqrt{y + 1} + \left(0.5 \cdot \sqrt{\frac{1}{z}} - \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{z}\right) + \sqrt{\frac{1}{t}} \cdot -0.5\right) + \frac{1}{\sqrt{x} + t\_2}\\
\end{array}
\end{array}
if y < 5.49999999999999958e-31Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in t around inf 19.3%
associate--l+23.1%
+-commutative23.1%
Simplified23.1%
Taylor expanded in y around 0 23.1%
associate--l+31.5%
+-commutative31.5%
associate--r+31.5%
+-commutative31.5%
Simplified31.5%
if 5.49999999999999958e-31 < y < 8.2e14Initial program 91.2%
associate-+l+91.2%
sub-neg91.2%
sub-neg91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 15.0%
associate--l+18.6%
+-commutative18.6%
Simplified18.6%
Taylor expanded in z around inf 8.3%
associate--l+8.3%
Simplified8.3%
if 8.2e14 < y Initial program 88.5%
associate-+l+88.5%
sub-neg88.5%
sub-neg88.5%
+-commutative88.5%
+-commutative88.5%
+-commutative88.5%
Simplified88.5%
+-commutative88.5%
flip--88.5%
flip--88.5%
frac-add88.5%
Applied egg-rr88.7%
*-commutative88.7%
*-commutative88.7%
+-commutative88.7%
*-commutative88.7%
associate-/r*88.7%
Simplified94.2%
add-cbrt-cube94.2%
pow394.2%
Applied egg-rr94.2%
Taylor expanded in t around -inf 45.4%
*-commutative45.4%
Simplified45.4%
Taylor expanded in y around inf 43.4%
Final simplification35.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 (<= y 5.5e-31)
(+ t_1 (+ 1.0 (- (- (sqrt (+ 1.0 z)) (sqrt x)) (+ (sqrt y) (sqrt z)))))
(if (<= y 1.3e+15)
(+
t_1
(+
(sqrt (+ y 1.0))
(- (* 0.5 (sqrt (/ 1.0 z))) (+ (sqrt y) (sqrt x)))))
(pow (cbrt (/ 1.0 (+ (sqrt x) t_1))) 3.0)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 5.5e-31) {
tmp = t_1 + (1.0 + ((sqrt((1.0 + z)) - sqrt(x)) - (sqrt(y) + sqrt(z))));
} else if (y <= 1.3e+15) {
tmp = t_1 + (sqrt((y + 1.0)) + ((0.5 * sqrt((1.0 / z))) - (sqrt(y) + sqrt(x))));
} else {
tmp = pow(cbrt((1.0 / (sqrt(x) + t_1))), 3.0);
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 5.5e-31) {
tmp = t_1 + (1.0 + ((Math.sqrt((1.0 + z)) - Math.sqrt(x)) - (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 1.3e+15) {
tmp = t_1 + (Math.sqrt((y + 1.0)) + ((0.5 * Math.sqrt((1.0 / z))) - (Math.sqrt(y) + Math.sqrt(x))));
} else {
tmp = Math.pow(Math.cbrt((1.0 / (Math.sqrt(x) + t_1))), 3.0);
}
return tmp;
}
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 5.5e-31) tmp = Float64(t_1 + Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(x)) - Float64(sqrt(y) + sqrt(z))))); elseif (y <= 1.3e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - Float64(sqrt(y) + sqrt(x))))); else tmp = cbrt(Float64(1.0 / Float64(sqrt(x) + t_1))) ^ 3.0; end return tmp end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.5e-31], N[(t$95$1 + N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e+15], N[(t$95$1 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 5.5 \cdot 10^{-31}:\\
\;\;\;\;t\_1 + \left(1 + \left(\left(\sqrt{1 + z} - \sqrt{x}\right) - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\sqrt{y + 1} + \left(0.5 \cdot \sqrt{\frac{1}{z}} - \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{\frac{1}{\sqrt{x} + t\_1}}\right)}^{3}\\
\end{array}
\end{array}
if y < 5.49999999999999958e-31Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in t around inf 19.3%
associate--l+23.1%
+-commutative23.1%
Simplified23.1%
Taylor expanded in y around 0 23.1%
associate--l+31.5%
+-commutative31.5%
associate--r+31.5%
+-commutative31.5%
Simplified31.5%
if 5.49999999999999958e-31 < y < 1.3e15Initial program 91.2%
associate-+l+91.2%
sub-neg91.2%
sub-neg91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 15.0%
associate--l+18.6%
+-commutative18.6%
Simplified18.6%
Taylor expanded in z around inf 8.3%
associate--l+8.3%
Simplified8.3%
if 1.3e15 < y Initial program 88.5%
associate-+l+88.5%
sub-neg88.5%
sub-neg88.5%
+-commutative88.5%
+-commutative88.5%
+-commutative88.5%
Simplified88.5%
Taylor expanded in t around inf 3.1%
associate--l+19.0%
+-commutative19.0%
Simplified19.0%
Taylor expanded in x around inf 18.2%
mul-1-neg18.2%
Simplified18.2%
add-cube-cbrt18.2%
pow318.2%
unsub-neg18.2%
Applied egg-rr18.2%
flip--18.2%
add-sqr-sqrt18.4%
add-sqr-sqrt18.3%
Applied egg-rr18.3%
associate--l+23.3%
+-inverses23.3%
metadata-eval23.3%
+-commutative23.3%
Simplified23.3%
Final simplification26.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 5e-31)
(+ t_1 (+ 1.0 (- (- (sqrt (+ 1.0 z)) (sqrt x)) (+ (sqrt y) (sqrt z)))))
(if (<= y 4.5e+15)
(+ t_1 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))
(pow (cbrt (/ 1.0 (+ (sqrt x) t_1))) 3.0)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 5e-31) {
tmp = t_1 + (1.0 + ((sqrt((1.0 + z)) - sqrt(x)) - (sqrt(y) + sqrt(z))));
} else if (y <= 4.5e+15) {
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
} else {
tmp = pow(cbrt((1.0 / (sqrt(x) + t_1))), 3.0);
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 5e-31) {
tmp = t_1 + (1.0 + ((Math.sqrt((1.0 + z)) - Math.sqrt(x)) - (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 4.5e+15) {
tmp = t_1 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = Math.pow(Math.cbrt((1.0 / (Math.sqrt(x) + t_1))), 3.0);
}
return tmp;
}
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 5e-31) tmp = Float64(t_1 + Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(x)) - Float64(sqrt(y) + sqrt(z))))); elseif (y <= 4.5e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); else tmp = cbrt(Float64(1.0 / Float64(sqrt(x) + t_1))) ^ 3.0; end return tmp end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5e-31], N[(t$95$1 + N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(t$95$1 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 5 \cdot 10^{-31}:\\
\;\;\;\;t\_1 + \left(1 + \left(\left(\sqrt{1 + z} - \sqrt{x}\right) - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{\frac{1}{\sqrt{x} + t\_1}}\right)}^{3}\\
\end{array}
\end{array}
if y < 5e-31Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in t around inf 19.3%
associate--l+23.1%
+-commutative23.1%
Simplified23.1%
Taylor expanded in y around 0 23.1%
associate--l+31.5%
+-commutative31.5%
associate--r+31.5%
+-commutative31.5%
Simplified31.5%
if 5e-31 < y < 4.5e15Initial program 91.2%
associate-+l+91.2%
sub-neg91.2%
sub-neg91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 15.0%
associate--l+18.6%
+-commutative18.6%
Simplified18.6%
Taylor expanded in z around inf 10.7%
if 4.5e15 < y Initial program 88.5%
associate-+l+88.5%
sub-neg88.5%
sub-neg88.5%
+-commutative88.5%
+-commutative88.5%
+-commutative88.5%
Simplified88.5%
Taylor expanded in t around inf 3.1%
associate--l+19.0%
+-commutative19.0%
Simplified19.0%
Taylor expanded in x around inf 18.2%
mul-1-neg18.2%
Simplified18.2%
add-cube-cbrt18.2%
pow318.2%
unsub-neg18.2%
Applied egg-rr18.2%
flip--18.2%
add-sqr-sqrt18.4%
add-sqr-sqrt18.3%
Applied egg-rr18.3%
associate--l+23.3%
+-inverses23.3%
metadata-eval23.3%
+-commutative23.3%
Simplified23.3%
Final simplification26.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 0.066)
(- (+ t_1 2.0) (+ (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 <= 0.066) {
tmp = (t_1 + 2.0) - (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 <= 0.066d0) then
tmp = (t_1 + 2.0d0) - (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 <= 0.066) {
tmp = (t_1 + 2.0) - (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 <= 0.066: tmp = (t_1 + 2.0) - (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 <= 0.066) tmp = Float64(Float64(t_1 + 2.0) - 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 <= 0.066)
tmp = (t_1 + 2.0) - (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, 0.066], N[(N[(t$95$1 + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $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 0.066:\\
\;\;\;\;\left(t\_1 + 2\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(t\_1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 0.066000000000000003Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 42.1%
associate--l+45.2%
+-commutative45.2%
Simplified45.2%
Taylor expanded in z around 0 45.0%
Taylor expanded in t around inf 16.7%
if 0.066000000000000003 < 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 t around inf 3.3%
associate--l+20.4%
+-commutative20.4%
Simplified20.4%
Taylor expanded in z around inf 29.9%
Final simplification22.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))))
(if (<= x 1.05e-27)
(+ t_1 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))
(pow (cbrt (/ 1.0 (+ (sqrt x) t_1))) 3.0))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (x <= 1.05e-27) {
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
} else {
tmp = pow(cbrt((1.0 / (sqrt(x) + t_1))), 3.0);
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (x <= 1.05e-27) {
tmp = t_1 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = Math.pow(Math.cbrt((1.0 / (Math.sqrt(x) + t_1))), 3.0);
}
return tmp;
}
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (x <= 1.05e-27) tmp = Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); else tmp = cbrt(Float64(1.0 / Float64(sqrt(x) + t_1))) ^ 3.0; end return tmp end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 1.05e-27], N[(t$95$1 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;x \leq 1.05 \cdot 10^{-27}:\\
\;\;\;\;t\_1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{\frac{1}{\sqrt{x} + t\_1}}\right)}^{3}\\
\end{array}
\end{array}
if x < 1.05000000000000008e-27Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in t around inf 19.6%
associate--l+38.0%
+-commutative38.0%
Simplified38.0%
Taylor expanded in z around inf 35.5%
if 1.05000000000000008e-27 < x Initial program 89.5%
associate-+l+89.5%
sub-neg89.5%
sub-neg89.5%
+-commutative89.5%
+-commutative89.5%
+-commutative89.5%
Simplified89.5%
Taylor expanded in t around inf 5.2%
associate--l+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in x around inf 4.5%
mul-1-neg4.5%
Simplified4.5%
add-cube-cbrt4.5%
pow34.5%
unsub-neg4.5%
Applied egg-rr4.5%
flip--4.5%
add-sqr-sqrt4.8%
add-sqr-sqrt4.6%
Applied egg-rr4.6%
associate--l+10.3%
+-inverses10.3%
metadata-eval10.3%
+-commutative10.3%
Simplified10.3%
Final simplification21.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 118000000.0) (exp (log (- (sqrt (+ 1.0 x)) (sqrt x)))) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 118000000.0) {
tmp = exp(log((sqrt((1.0 + x)) - sqrt(x))));
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 118000000.0d0) then
tmp = exp(log((sqrt((1.0d0 + x)) - sqrt(x))))
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 118000000.0) {
tmp = Math.exp(Math.log((Math.sqrt((1.0 + x)) - Math.sqrt(x))));
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 118000000.0: tmp = math.exp(math.log((math.sqrt((1.0 + x)) - math.sqrt(x)))) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 118000000.0) tmp = exp(log(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)))); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 118000000.0)
tmp = exp(log((sqrt((1.0 + x)) - sqrt(x))));
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 118000000.0], N[Exp[N[Log[N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 118000000:\\
\;\;\;\;e^{\log \left(\sqrt{1 + x} - \sqrt{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1.18e8Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in t around inf 20.1%
associate--l+38.2%
+-commutative38.2%
Simplified38.2%
Taylor expanded in x around inf 26.0%
mul-1-neg26.0%
Simplified26.0%
add-exp-log26.0%
unsub-neg26.0%
Applied egg-rr26.0%
if 1.18e8 < x Initial program 89.2%
associate-+l+89.2%
sub-neg89.2%
sub-neg89.2%
+-commutative89.2%
+-commutative89.2%
+-commutative89.2%
Simplified89.2%
Taylor expanded in t around inf 3.9%
associate--l+5.2%
+-commutative5.2%
Simplified5.2%
Taylor expanded in x around inf 3.2%
mul-1-neg3.2%
Simplified3.2%
Taylor expanded in x around inf 9.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (pow (cbrt (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))) 3.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return pow(cbrt((1.0 / (sqrt(x) + sqrt((1.0 + x))))), 3.0);
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.pow(Math.cbrt((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))))), 3.0);
}
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return cbrt(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))) ^ 3.0 end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[Power[N[Power[N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
{\left(\sqrt[3]{\frac{1}{\sqrt{x} + \sqrt{1 + x}}}\right)}^{3}
\end{array}
Initial program 93.3%
associate-+l+93.3%
sub-neg93.3%
sub-neg93.3%
+-commutative93.3%
+-commutative93.3%
+-commutative93.3%
Simplified93.3%
Taylor expanded in t around inf 11.6%
associate--l+20.9%
+-commutative20.9%
Simplified20.9%
Taylor expanded in x around inf 14.1%
mul-1-neg14.1%
Simplified14.1%
add-cube-cbrt14.1%
pow314.1%
unsub-neg14.1%
Applied egg-rr14.1%
flip--14.1%
add-sqr-sqrt14.3%
add-sqr-sqrt14.1%
Applied egg-rr14.1%
associate--l+17.3%
+-inverses17.3%
metadata-eval17.3%
+-commutative17.3%
Simplified17.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 118000000.0) (- (sqrt (+ 1.0 x)) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 118000000.0) {
tmp = sqrt((1.0 + x)) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 118000000.0d0) then
tmp = sqrt((1.0d0 + x)) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 118000000.0) {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 118000000.0: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 118000000.0) tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 118000000.0)
tmp = sqrt((1.0 + x)) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 118000000.0], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 118000000:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1.18e8Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in t around inf 20.1%
associate--l+38.2%
+-commutative38.2%
Simplified38.2%
Taylor expanded in x around inf 26.0%
mul-1-neg26.0%
Simplified26.0%
unsub-neg26.0%
Applied egg-rr26.0%
if 1.18e8 < x Initial program 89.2%
associate-+l+89.2%
sub-neg89.2%
sub-neg89.2%
+-commutative89.2%
+-commutative89.2%
+-commutative89.2%
Simplified89.2%
Taylor expanded in t around inf 3.9%
associate--l+5.2%
+-commutative5.2%
Simplified5.2%
Taylor expanded in x around inf 3.2%
mul-1-neg3.2%
Simplified3.2%
Taylor expanded in x around inf 9.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 1.0) (- (+ 1.0 (* x 0.5)) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.0) {
tmp = (1.0 + (x * 0.5)) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.0d0) then
tmp = (1.0d0 + (x * 0.5d0)) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.0) {
tmp = (1.0 + (x * 0.5)) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.0: tmp = (1.0 + (x * 0.5)) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.0) tmp = Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.0)
tmp = (1.0 + (x * 0.5)) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.0], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in t around inf 20.2%
associate--l+38.4%
+-commutative38.4%
Simplified38.4%
Taylor expanded in x around inf 26.1%
mul-1-neg26.1%
Simplified26.1%
Taylor expanded in x around 0 26.1%
if 1 < x Initial program 89.1%
associate-+l+89.1%
sub-neg89.1%
sub-neg89.1%
+-commutative89.1%
+-commutative89.1%
+-commutative89.1%
Simplified89.1%
Taylor expanded in t around inf 3.9%
associate--l+5.2%
+-commutative5.2%
Simplified5.2%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
Simplified3.3%
Taylor expanded in x around inf 9.4%
Final simplification17.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* 0.5 (sqrt (/ 1.0 x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 0.5 * sqrt((1.0 / x));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 0.5d0 * sqrt((1.0d0 / x))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 0.5 * Math.sqrt((1.0 / x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 0.5 * math.sqrt((1.0 / x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(0.5 * sqrt(Float64(1.0 / x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 0.5 * sqrt((1.0 / x));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
0.5 \cdot \sqrt{\frac{1}{x}}
\end{array}
Initial program 93.3%
associate-+l+93.3%
sub-neg93.3%
sub-neg93.3%
+-commutative93.3%
+-commutative93.3%
+-commutative93.3%
Simplified93.3%
Taylor expanded in t around inf 11.6%
associate--l+20.9%
+-commutative20.9%
Simplified20.9%
Taylor expanded in x around inf 14.1%
mul-1-neg14.1%
Simplified14.1%
Taylor expanded in x around inf 8.2%
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.3%
associate-+l+93.3%
sub-neg93.3%
sub-neg93.3%
+-commutative93.3%
+-commutative93.3%
+-commutative93.3%
Simplified93.3%
Taylor expanded in x around 0 39.4%
associate--l+48.1%
+-commutative48.1%
Simplified48.1%
Taylor expanded in z around 0 25.8%
Taylor expanded in z around inf 1.6%
mul-1-neg1.6%
Simplified1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024111
(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))))