
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt (+ 1.0 t)) (sqrt t)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ x 1.0)))
(t_5 (sqrt (+ 1.0 y)))
(t_6 (/ 1.0 (+ t_5 (sqrt y))))
(t_7 (+ (+ (- t_4 (sqrt x)) (- t_5 (sqrt y))) t_3))
(t_8 (+ t_2 (sqrt z))))
(if (<= t_7 1e-5)
(+ (* 0.5 (sqrt (/ 1.0 x))) (+ (/ (+ t_1 t_8) (* t_1 t_8)) t_6))
(if (<= t_7 2.5)
(- (+ (+ t_4 t_6) (/ 1.0 t_8)) (sqrt x))
(+ (- 2.0 (+ (sqrt x) (sqrt y))) (+ t_3 (/ 1.0 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 + t)) + sqrt(t);
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((x + 1.0));
double t_5 = sqrt((1.0 + y));
double t_6 = 1.0 / (t_5 + sqrt(y));
double t_7 = ((t_4 - sqrt(x)) + (t_5 - sqrt(y))) + t_3;
double t_8 = t_2 + sqrt(z);
double tmp;
if (t_7 <= 1e-5) {
tmp = (0.5 * sqrt((1.0 / x))) + (((t_1 + t_8) / (t_1 * t_8)) + t_6);
} else if (t_7 <= 2.5) {
tmp = ((t_4 + t_6) + (1.0 / t_8)) - sqrt(x);
} else {
tmp = (2.0 - (sqrt(x) + sqrt(y))) + (t_3 + (1.0 / 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) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) + sqrt(t)
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((x + 1.0d0))
t_5 = sqrt((1.0d0 + y))
t_6 = 1.0d0 / (t_5 + sqrt(y))
t_7 = ((t_4 - sqrt(x)) + (t_5 - sqrt(y))) + t_3
t_8 = t_2 + sqrt(z)
if (t_7 <= 1d-5) then
tmp = (0.5d0 * sqrt((1.0d0 / x))) + (((t_1 + t_8) / (t_1 * t_8)) + t_6)
else if (t_7 <= 2.5d0) then
tmp = ((t_4 + t_6) + (1.0d0 / t_8)) - sqrt(x)
else
tmp = (2.0d0 - (sqrt(x) + sqrt(y))) + (t_3 + (1.0d0 / 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 + t)) + Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((x + 1.0));
double t_5 = Math.sqrt((1.0 + y));
double t_6 = 1.0 / (t_5 + Math.sqrt(y));
double t_7 = ((t_4 - Math.sqrt(x)) + (t_5 - Math.sqrt(y))) + t_3;
double t_8 = t_2 + Math.sqrt(z);
double tmp;
if (t_7 <= 1e-5) {
tmp = (0.5 * Math.sqrt((1.0 / x))) + (((t_1 + t_8) / (t_1 * t_8)) + t_6);
} else if (t_7 <= 2.5) {
tmp = ((t_4 + t_6) + (1.0 / t_8)) - Math.sqrt(x);
} else {
tmp = (2.0 - (Math.sqrt(x) + Math.sqrt(y))) + (t_3 + (1.0 / 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 + t)) + math.sqrt(t) t_2 = math.sqrt((1.0 + z)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((x + 1.0)) t_5 = math.sqrt((1.0 + y)) t_6 = 1.0 / (t_5 + math.sqrt(y)) t_7 = ((t_4 - math.sqrt(x)) + (t_5 - math.sqrt(y))) + t_3 t_8 = t_2 + math.sqrt(z) tmp = 0 if t_7 <= 1e-5: tmp = (0.5 * math.sqrt((1.0 / x))) + (((t_1 + t_8) / (t_1 * t_8)) + t_6) elif t_7 <= 2.5: tmp = ((t_4 + t_6) + (1.0 / t_8)) - math.sqrt(x) else: tmp = (2.0 - (math.sqrt(x) + math.sqrt(y))) + (t_3 + (1.0 / t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) + sqrt(t)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(x + 1.0)) t_5 = sqrt(Float64(1.0 + y)) t_6 = Float64(1.0 / Float64(t_5 + sqrt(y))) t_7 = Float64(Float64(Float64(t_4 - sqrt(x)) + Float64(t_5 - sqrt(y))) + t_3) t_8 = Float64(t_2 + sqrt(z)) tmp = 0.0 if (t_7 <= 1e-5) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(Float64(Float64(t_1 + t_8) / Float64(t_1 * t_8)) + t_6)); elseif (t_7 <= 2.5) tmp = Float64(Float64(Float64(t_4 + t_6) + Float64(1.0 / t_8)) - sqrt(x)); else tmp = Float64(Float64(2.0 - Float64(sqrt(x) + sqrt(y))) + Float64(t_3 + Float64(1.0 / 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 + t)) + sqrt(t);
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((x + 1.0));
t_5 = sqrt((1.0 + y));
t_6 = 1.0 / (t_5 + sqrt(y));
t_7 = ((t_4 - sqrt(x)) + (t_5 - sqrt(y))) + t_3;
t_8 = t_2 + sqrt(z);
tmp = 0.0;
if (t_7 <= 1e-5)
tmp = (0.5 * sqrt((1.0 / x))) + (((t_1 + t_8) / (t_1 * t_8)) + t_6);
elseif (t_7 <= 2.5)
tmp = ((t_4 + t_6) + (1.0 / t_8)) - sqrt(x);
else
tmp = (2.0 - (sqrt(x) + sqrt(y))) + (t_3 + (1.0 / t_1));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(1.0 / N[(t$95$5 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$5 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$7, 1e-5], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$1 + t$95$8), $MachinePrecision] / N[(t$95$1 * t$95$8), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$7, 2.5], N[(N[(N[(t$95$4 + t$95$6), $MachinePrecision] + N[(1.0 / t$95$8), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(1.0 / 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 + t} + \sqrt{t}\\
t_2 := \sqrt{1 + z}\\
t_3 := t\_2 - \sqrt{z}\\
t_4 := \sqrt{x + 1}\\
t_5 := \sqrt{1 + y}\\
t_6 := \frac{1}{t\_5 + \sqrt{y}}\\
t_7 := \left(\left(t\_4 - \sqrt{x}\right) + \left(t\_5 - \sqrt{y}\right)\right) + t\_3\\
t_8 := t\_2 + \sqrt{z}\\
\mathbf{if}\;t\_7 \leq 10^{-5}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(\frac{t\_1 + t\_8}{t\_1 \cdot t\_8} + t\_6\right)\\
\mathbf{elif}\;t\_7 \leq 2.5:\\
\;\;\;\;\left(\left(t\_4 + t\_6\right) + \frac{1}{t\_8}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(t\_3 + \frac{1}{t\_1}\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))) < 1.00000000000000008e-5Initial program 59.4%
associate-+l+59.4%
associate-+l+59.4%
+-commutative59.4%
+-commutative59.4%
associate-+l-59.4%
+-commutative59.4%
+-commutative59.4%
Simplified59.4%
associate--r-59.4%
+-commutative59.4%
flip--59.4%
flip--59.4%
frac-add59.3%
Applied egg-rr60.1%
Simplified69.2%
flip--69.1%
add-sqr-sqrt43.0%
add-sqr-sqrt71.9%
Applied egg-rr71.9%
associate--l+90.8%
+-inverses90.8%
metadata-eval90.8%
Simplified90.8%
Taylor expanded in x around inf 99.9%
if 1.00000000000000008e-5 < (+.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.5Initial program 96.0%
associate-+l+96.0%
associate-+l+96.0%
+-commutative96.0%
+-commutative96.0%
associate-+l-79.4%
+-commutative79.4%
+-commutative79.4%
Simplified79.4%
associate--r-96.0%
+-commutative96.0%
flip--96.0%
flip--96.0%
frac-add96.0%
Applied egg-rr96.8%
Simplified97.8%
flip--98.0%
add-sqr-sqrt78.3%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
associate--l+98.9%
+-inverses98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in t around inf 33.0%
associate-+r+33.0%
Simplified33.0%
if 2.5 < (+.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 97.4%
associate-+l+97.4%
sub-neg97.4%
sub-neg97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 97.4%
associate--l+97.4%
Simplified97.4%
flip--97.5%
add-sqr-sqrt81.2%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
associate--l+99.8%
+-inverses99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 94.4%
Final simplification48.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z)))
(t_2 (- t_1 (sqrt z)))
(t_3 (sqrt (+ x 1.0)))
(t_4 (sqrt (+ 1.0 y)))
(t_5 (+ (+ (- t_3 (sqrt x)) (- t_4 (sqrt y))) t_2)))
(if (<= t_5 0.2)
(/ 1.0 (+ (sqrt x) t_3))
(if (<= t_5 2.5)
(-
(+ (+ t_3 (/ 1.0 (+ t_4 (sqrt y)))) (/ 1.0 (+ t_1 (sqrt z))))
(sqrt x))
(+
(- 2.0 (+ (sqrt x) (sqrt y)))
(+ t_2 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = t_1 - sqrt(z);
double t_3 = sqrt((x + 1.0));
double t_4 = sqrt((1.0 + y));
double t_5 = ((t_3 - sqrt(x)) + (t_4 - sqrt(y))) + t_2;
double tmp;
if (t_5 <= 0.2) {
tmp = 1.0 / (sqrt(x) + t_3);
} else if (t_5 <= 2.5) {
tmp = ((t_3 + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (t_1 + sqrt(z)))) - sqrt(x);
} else {
tmp = (2.0 - (sqrt(x) + sqrt(y))) + (t_2 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = t_1 - sqrt(z)
t_3 = sqrt((x + 1.0d0))
t_4 = sqrt((1.0d0 + y))
t_5 = ((t_3 - sqrt(x)) + (t_4 - sqrt(y))) + t_2
if (t_5 <= 0.2d0) then
tmp = 1.0d0 / (sqrt(x) + t_3)
else if (t_5 <= 2.5d0) then
tmp = ((t_3 + (1.0d0 / (t_4 + sqrt(y)))) + (1.0d0 / (t_1 + sqrt(z)))) - sqrt(x)
else
tmp = (2.0d0 - (sqrt(x) + sqrt(y))) + (t_2 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = t_1 - Math.sqrt(z);
double t_3 = Math.sqrt((x + 1.0));
double t_4 = Math.sqrt((1.0 + y));
double t_5 = ((t_3 - Math.sqrt(x)) + (t_4 - Math.sqrt(y))) + t_2;
double tmp;
if (t_5 <= 0.2) {
tmp = 1.0 / (Math.sqrt(x) + t_3);
} else if (t_5 <= 2.5) {
tmp = ((t_3 + (1.0 / (t_4 + Math.sqrt(y)))) + (1.0 / (t_1 + Math.sqrt(z)))) - Math.sqrt(x);
} else {
tmp = (2.0 - (Math.sqrt(x) + Math.sqrt(y))) + (t_2 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = t_1 - math.sqrt(z) t_3 = math.sqrt((x + 1.0)) t_4 = math.sqrt((1.0 + y)) t_5 = ((t_3 - math.sqrt(x)) + (t_4 - math.sqrt(y))) + t_2 tmp = 0 if t_5 <= 0.2: tmp = 1.0 / (math.sqrt(x) + t_3) elif t_5 <= 2.5: tmp = ((t_3 + (1.0 / (t_4 + math.sqrt(y)))) + (1.0 / (t_1 + math.sqrt(z)))) - math.sqrt(x) else: tmp = (2.0 - (math.sqrt(x) + math.sqrt(y))) + (t_2 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = Float64(t_1 - sqrt(z)) t_3 = sqrt(Float64(x + 1.0)) t_4 = sqrt(Float64(1.0 + y)) t_5 = Float64(Float64(Float64(t_3 - sqrt(x)) + Float64(t_4 - sqrt(y))) + t_2) tmp = 0.0 if (t_5 <= 0.2) tmp = Float64(1.0 / Float64(sqrt(x) + t_3)); elseif (t_5 <= 2.5) tmp = Float64(Float64(Float64(t_3 + Float64(1.0 / Float64(t_4 + sqrt(y)))) + Float64(1.0 / Float64(t_1 + sqrt(z)))) - sqrt(x)); else tmp = Float64(Float64(2.0 - Float64(sqrt(x) + sqrt(y))) + Float64(t_2 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = t_1 - sqrt(z);
t_3 = sqrt((x + 1.0));
t_4 = sqrt((1.0 + y));
t_5 = ((t_3 - sqrt(x)) + (t_4 - sqrt(y))) + t_2;
tmp = 0.0;
if (t_5 <= 0.2)
tmp = 1.0 / (sqrt(x) + t_3);
elseif (t_5 <= 2.5)
tmp = ((t_3 + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (t_1 + sqrt(z)))) - sqrt(x);
else
tmp = (2.0 - (sqrt(x) + sqrt(y))) + (t_2 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[t$95$5, 0.2], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 2.5], N[(N[(N[(t$95$3 + N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := t\_1 - \sqrt{z}\\
t_3 := \sqrt{x + 1}\\
t_4 := \sqrt{1 + y}\\
t_5 := \left(\left(t\_3 - \sqrt{x}\right) + \left(t\_4 - \sqrt{y}\right)\right) + t\_2\\
\mathbf{if}\;t\_5 \leq 0.2:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_3}\\
\mathbf{elif}\;t\_5 \leq 2.5:\\
\;\;\;\;\left(\left(t\_3 + \frac{1}{t\_4 + \sqrt{y}}\right) + \frac{1}{t\_1 + \sqrt{z}}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(t\_2 + \frac{1}{\sqrt{1 + t} + \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.20000000000000001Initial program 61.5%
associate-+l+61.5%
sub-neg61.5%
sub-neg61.5%
+-commutative61.5%
+-commutative61.5%
+-commutative61.5%
Simplified61.5%
Taylor expanded in t around inf 3.2%
associate--l+5.0%
Simplified5.0%
Taylor expanded in x around inf 3.2%
neg-mul-13.2%
Simplified3.2%
+-commutative3.2%
sub-neg3.2%
add-cbrt-cube3.2%
pow33.2%
Applied egg-rr3.2%
rem-cbrt-cube3.2%
flip--3.2%
add-sqr-sqrt3.8%
+-commutative3.8%
add-sqr-sqrt3.2%
+-commutative3.2%
Applied egg-rr3.2%
associate--l+10.8%
+-inverses10.8%
metadata-eval10.8%
+-commutative10.8%
Simplified10.8%
if 0.20000000000000001 < (+.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.5Initial program 96.2%
associate-+l+96.2%
associate-+l+96.2%
+-commutative96.2%
+-commutative96.2%
associate-+l-80.1%
+-commutative80.1%
+-commutative80.1%
Simplified80.1%
associate--r-96.2%
+-commutative96.2%
flip--96.2%
flip--96.2%
frac-add96.2%
Applied egg-rr96.8%
Simplified97.8%
flip--98.0%
add-sqr-sqrt78.5%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
associate--l+98.9%
+-inverses98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in t around inf 33.5%
associate-+r+33.5%
Simplified33.5%
if 2.5 < (+.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 97.4%
associate-+l+97.4%
sub-neg97.4%
sub-neg97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 97.4%
associate--l+97.4%
Simplified97.4%
flip--97.5%
add-sqr-sqrt81.2%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
associate--l+99.8%
+-inverses99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 94.4%
Final simplification37.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 z)) (sqrt z)))
(t_2 (- (sqrt (+ x 1.0)) (sqrt x)))
(t_3 (+ (sqrt (+ 1.0 t)) (sqrt t)))
(t_4 (/ (+ t_3 t_1) (* t_3 t_1)))
(t_5 (sqrt (+ 1.0 y)))
(t_6 (- t_5 (sqrt y))))
(if (<= (+ t_2 t_6) 1e-5)
(+ (* 0.5 (sqrt (/ 1.0 x))) (+ t_4 (/ 1.0 (+ t_5 (sqrt y)))))
(+ t_2 (+ t_4 t_6)))))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 t_2 = sqrt((x + 1.0)) - sqrt(x);
double t_3 = sqrt((1.0 + t)) + sqrt(t);
double t_4 = (t_3 + t_1) / (t_3 * t_1);
double t_5 = sqrt((1.0 + y));
double t_6 = t_5 - sqrt(y);
double tmp;
if ((t_2 + t_6) <= 1e-5) {
tmp = (0.5 * sqrt((1.0 / x))) + (t_4 + (1.0 / (t_5 + sqrt(y))));
} else {
tmp = t_2 + (t_4 + t_6);
}
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) :: tmp
t_1 = sqrt((1.0d0 + z)) + sqrt(z)
t_2 = sqrt((x + 1.0d0)) - sqrt(x)
t_3 = sqrt((1.0d0 + t)) + sqrt(t)
t_4 = (t_3 + t_1) / (t_3 * t_1)
t_5 = sqrt((1.0d0 + y))
t_6 = t_5 - sqrt(y)
if ((t_2 + t_6) <= 1d-5) then
tmp = (0.5d0 * sqrt((1.0d0 / x))) + (t_4 + (1.0d0 / (t_5 + sqrt(y))))
else
tmp = t_2 + (t_4 + t_6)
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 t_2 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
double t_3 = Math.sqrt((1.0 + t)) + Math.sqrt(t);
double t_4 = (t_3 + t_1) / (t_3 * t_1);
double t_5 = Math.sqrt((1.0 + y));
double t_6 = t_5 - Math.sqrt(y);
double tmp;
if ((t_2 + t_6) <= 1e-5) {
tmp = (0.5 * Math.sqrt((1.0 / x))) + (t_4 + (1.0 / (t_5 + Math.sqrt(y))));
} else {
tmp = t_2 + (t_4 + t_6);
}
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) t_2 = math.sqrt((x + 1.0)) - math.sqrt(x) t_3 = math.sqrt((1.0 + t)) + math.sqrt(t) t_4 = (t_3 + t_1) / (t_3 * t_1) t_5 = math.sqrt((1.0 + y)) t_6 = t_5 - math.sqrt(y) tmp = 0 if (t_2 + t_6) <= 1e-5: tmp = (0.5 * math.sqrt((1.0 / x))) + (t_4 + (1.0 / (t_5 + math.sqrt(y)))) else: tmp = t_2 + (t_4 + t_6) 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)) t_2 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) t_3 = Float64(sqrt(Float64(1.0 + t)) + sqrt(t)) t_4 = Float64(Float64(t_3 + t_1) / Float64(t_3 * t_1)) t_5 = sqrt(Float64(1.0 + y)) t_6 = Float64(t_5 - sqrt(y)) tmp = 0.0 if (Float64(t_2 + t_6) <= 1e-5) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(t_4 + Float64(1.0 / Float64(t_5 + sqrt(y))))); else tmp = Float64(t_2 + Float64(t_4 + t_6)); 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);
t_2 = sqrt((x + 1.0)) - sqrt(x);
t_3 = sqrt((1.0 + t)) + sqrt(t);
t_4 = (t_3 + t_1) / (t_3 * t_1);
t_5 = sqrt((1.0 + y));
t_6 = t_5 - sqrt(y);
tmp = 0.0;
if ((t_2 + t_6) <= 1e-5)
tmp = (0.5 * sqrt((1.0 / x))) + (t_4 + (1.0 / (t_5 + sqrt(y))));
else
tmp = t_2 + (t_4 + t_6);
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]}, Block[{t$95$2 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 + t$95$1), $MachinePrecision] / N[(t$95$3 * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 + t$95$6), $MachinePrecision], 1e-5], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + N[(1.0 / N[(t$95$5 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(t$95$4 + t$95$6), $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}\\
t_2 := \sqrt{x + 1} - \sqrt{x}\\
t_3 := \sqrt{1 + t} + \sqrt{t}\\
t_4 := \frac{t\_3 + t\_1}{t\_3 \cdot t\_1}\\
t_5 := \sqrt{1 + y}\\
t_6 := t\_5 - \sqrt{y}\\
\mathbf{if}\;t\_2 + t\_6 \leq 10^{-5}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(t\_4 + \frac{1}{t\_5 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(t\_4 + t\_6\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1.00000000000000008e-5Initial program 75.2%
associate-+l+75.2%
associate-+l+75.2%
+-commutative75.2%
+-commutative75.2%
associate-+l-64.3%
+-commutative64.3%
+-commutative64.3%
Simplified64.3%
associate--r-75.2%
+-commutative75.2%
flip--75.1%
flip--75.1%
frac-add75.1%
Applied egg-rr76.7%
Simplified81.8%
flip--81.8%
add-sqr-sqrt45.2%
add-sqr-sqrt83.3%
Applied egg-rr83.3%
associate--l+94.7%
+-inverses94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in x around inf 99.8%
if 1.00000000000000008e-5 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) Initial program 96.3%
associate-+l+96.3%
associate-+l+96.3%
+-commutative96.3%
+-commutative96.3%
associate-+l-77.7%
+-commutative77.7%
+-commutative77.7%
Simplified77.7%
associate--r-96.3%
+-commutative96.3%
flip--96.3%
flip--96.3%
frac-add96.3%
Applied egg-rr96.9%
Simplified98.1%
Final simplification98.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 t)) (sqrt t)))
(t_2 (- (sqrt (+ x 1.0)) (sqrt x)))
(t_3 (+ (sqrt (+ 1.0 z)) (sqrt z)))
(t_4
(+
(/ (+ t_1 t_3) (* t_1 t_3))
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))))
(if (<= t_2 1e-5) (+ (* 0.5 (sqrt (/ 1.0 x))) t_4) (+ t_2 t_4))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) + sqrt(t);
double t_2 = sqrt((x + 1.0)) - sqrt(x);
double t_3 = sqrt((1.0 + z)) + sqrt(z);
double t_4 = ((t_1 + t_3) / (t_1 * t_3)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)));
double tmp;
if (t_2 <= 1e-5) {
tmp = (0.5 * sqrt((1.0 / x))) + t_4;
} else {
tmp = t_2 + t_4;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) + sqrt(t)
t_2 = sqrt((x + 1.0d0)) - sqrt(x)
t_3 = sqrt((1.0d0 + z)) + sqrt(z)
t_4 = ((t_1 + t_3) / (t_1 * t_3)) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))
if (t_2 <= 1d-5) then
tmp = (0.5d0 * sqrt((1.0d0 / x))) + t_4
else
tmp = t_2 + t_4
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) + Math.sqrt(t);
double t_2 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
double t_3 = Math.sqrt((1.0 + z)) + Math.sqrt(z);
double t_4 = ((t_1 + t_3) / (t_1 * t_3)) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)));
double tmp;
if (t_2 <= 1e-5) {
tmp = (0.5 * Math.sqrt((1.0 / x))) + t_4;
} else {
tmp = t_2 + t_4;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) + math.sqrt(t) t_2 = math.sqrt((x + 1.0)) - math.sqrt(x) t_3 = math.sqrt((1.0 + z)) + math.sqrt(z) t_4 = ((t_1 + t_3) / (t_1 * t_3)) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) tmp = 0 if t_2 <= 1e-5: tmp = (0.5 * math.sqrt((1.0 / x))) + t_4 else: tmp = t_2 + t_4 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) + sqrt(t)) t_2 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) t_3 = Float64(sqrt(Float64(1.0 + z)) + sqrt(z)) t_4 = Float64(Float64(Float64(t_1 + t_3) / Float64(t_1 * t_3)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) tmp = 0.0 if (t_2 <= 1e-5) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_4); else tmp = Float64(t_2 + t_4); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) + sqrt(t);
t_2 = sqrt((x + 1.0)) - sqrt(x);
t_3 = sqrt((1.0 + z)) + sqrt(z);
t_4 = ((t_1 + t_3) / (t_1 * t_3)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)));
tmp = 0.0;
if (t_2 <= 1e-5)
tmp = (0.5 * sqrt((1.0 / x))) + t_4;
else
tmp = t_2 + t_4;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + t$95$3), $MachinePrecision] / N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 1e-5], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision], N[(t$95$2 + t$95$4), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} + \sqrt{t}\\
t_2 := \sqrt{x + 1} - \sqrt{x}\\
t_3 := \sqrt{1 + z} + \sqrt{z}\\
t_4 := \frac{t\_1 + t\_3}{t\_1 \cdot t\_3} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
\mathbf{if}\;t\_2 \leq 10^{-5}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_2 + t\_4\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1.00000000000000008e-5Initial program 87.1%
associate-+l+87.1%
associate-+l+87.1%
+-commutative87.1%
+-commutative87.1%
associate-+l-71.6%
+-commutative71.6%
+-commutative71.6%
Simplified71.6%
associate--r-87.1%
+-commutative87.1%
flip--87.0%
flip--87.0%
frac-add87.0%
Applied egg-rr87.7%
Simplified90.3%
flip--90.3%
add-sqr-sqrt73.8%
add-sqr-sqrt91.1%
Applied egg-rr91.1%
associate--l+96.2%
+-inverses96.2%
metadata-eval96.2%
Simplified96.2%
Taylor expanded in x around inf 99.8%
if 1.00000000000000008e-5 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.0%
associate-+l+96.0%
associate-+l+96.0%
+-commutative96.0%
+-commutative96.0%
associate-+l-77.7%
+-commutative77.7%
+-commutative77.7%
Simplified77.7%
associate--r-96.0%
+-commutative96.0%
flip--96.0%
flip--96.1%
frac-add96.1%
Applied egg-rr97.0%
Simplified98.4%
flip--98.7%
add-sqr-sqrt79.0%
add-sqr-sqrt99.3%
Applied egg-rr99.3%
associate--l+99.8%
+-inverses99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt x) (sqrt y)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (sqrt (+ x 1.0))))
(if (<= y 3e-149)
(+ (- 2.0 t_1) (+ (- t_2 (sqrt z)) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= y 9.2e+18)
(- (+ t_3 (+ (sqrt (+ 1.0 y)) (/ 1.0 (+ t_2 (sqrt z))))) t_1)
(/ 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(x) + sqrt(y);
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((x + 1.0));
double tmp;
if (y <= 3e-149) {
tmp = (2.0 - t_1) + ((t_2 - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else if (y <= 9.2e+18) {
tmp = (t_3 + (sqrt((1.0 + y)) + (1.0 / (t_2 + sqrt(z))))) - t_1;
} else {
tmp = 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(x) + sqrt(y)
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((x + 1.0d0))
if (y <= 3d-149) then
tmp = (2.0d0 - t_1) + ((t_2 - sqrt(z)) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else if (y <= 9.2d+18) then
tmp = (t_3 + (sqrt((1.0d0 + y)) + (1.0d0 / (t_2 + sqrt(z))))) - t_1
else
tmp = 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(x) + Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 3e-149) {
tmp = (2.0 - t_1) + ((t_2 - Math.sqrt(z)) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else if (y <= 9.2e+18) {
tmp = (t_3 + (Math.sqrt((1.0 + y)) + (1.0 / (t_2 + Math.sqrt(z))))) - t_1;
} else {
tmp = 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(x) + math.sqrt(y) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((x + 1.0)) tmp = 0 if y <= 3e-149: tmp = (2.0 - t_1) + ((t_2 - math.sqrt(z)) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) elif y <= 9.2e+18: tmp = (t_3 + (math.sqrt((1.0 + y)) + (1.0 / (t_2 + math.sqrt(z))))) - t_1 else: tmp = 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(x) + sqrt(y)) t_2 = sqrt(Float64(1.0 + z)) t_3 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 3e-149) tmp = Float64(Float64(2.0 - t_1) + Float64(Float64(t_2 - sqrt(z)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); elseif (y <= 9.2e+18) tmp = Float64(Float64(t_3 + Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 / Float64(t_2 + sqrt(z))))) - t_1); else tmp = 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(x) + sqrt(y);
t_2 = sqrt((1.0 + z));
t_3 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 3e-149)
tmp = (2.0 - t_1) + ((t_2 - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
elseif (y <= 9.2e+18)
tmp = (t_3 + (sqrt((1.0 + y)) + (1.0 / (t_2 + sqrt(z))))) - t_1;
else
tmp = 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[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3e-149], N[(N[(2.0 - t$95$1), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e+18], N[(N[(t$95$3 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x} + \sqrt{y}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 3 \cdot 10^{-149}:\\
\;\;\;\;\left(2 - t\_1\right) + \left(\left(t\_2 - \sqrt{z}\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{+18}:\\
\;\;\;\;\left(t\_3 + \left(\sqrt{1 + y} + \frac{1}{t\_2 + \sqrt{z}}\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_3}\\
\end{array}
\end{array}
if y < 3.0000000000000002e-149Initial program 96.9%
associate-+l+96.9%
sub-neg96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 49.3%
associate--l+49.3%
Simplified49.3%
flip--49.4%
add-sqr-sqrt39.6%
add-sqr-sqrt49.4%
Applied egg-rr49.4%
associate--l+49.4%
+-inverses49.4%
metadata-eval49.4%
Simplified49.4%
Taylor expanded in y around 0 49.4%
if 3.0000000000000002e-149 < y < 9.2e18Initial program 92.3%
associate-+l+92.3%
associate-+l+92.3%
+-commutative92.3%
+-commutative92.3%
associate-+l-75.9%
+-commutative75.9%
+-commutative75.9%
Simplified75.9%
associate--r-92.3%
+-commutative92.3%
flip--92.4%
flip--92.4%
frac-add92.4%
Applied egg-rr93.1%
Simplified94.4%
Taylor expanded in t around inf 31.5%
if 9.2e18 < y 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 4.3%
associate--l+22.2%
Simplified22.2%
Taylor expanded in x around inf 21.0%
neg-mul-121.0%
Simplified21.0%
+-commutative21.0%
sub-neg21.0%
add-cbrt-cube21.0%
pow321.0%
Applied egg-rr21.0%
rem-cbrt-cube21.0%
flip--21.0%
add-sqr-sqrt21.4%
+-commutative21.4%
add-sqr-sqrt21.0%
+-commutative21.0%
Applied egg-rr21.0%
associate--l+23.9%
+-inverses23.9%
metadata-eval23.9%
+-commutative23.9%
Simplified23.9%
Final simplification33.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ x 1.0))))
(if (<= y 3.2e-149)
(+
(- 2.0 (+ (sqrt x) (sqrt y)))
(+ (- t_1 (sqrt z)) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= y 2.8e+36)
(+
(- t_2 (sqrt x))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ t_1 (sqrt z)))))
(/ 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((x + 1.0));
double tmp;
if (y <= 3.2e-149) {
tmp = (2.0 - (sqrt(x) + sqrt(y))) + ((t_1 - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else if (y <= 2.8e+36) {
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(z))));
} else {
tmp = 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((x + 1.0d0))
if (y <= 3.2d-149) then
tmp = (2.0d0 - (sqrt(x) + sqrt(y))) + ((t_1 - sqrt(z)) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else if (y <= 2.8d+36) then
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (t_1 + sqrt(z))))
else
tmp = 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((x + 1.0));
double tmp;
if (y <= 3.2e-149) {
tmp = (2.0 - (Math.sqrt(x) + Math.sqrt(y))) + ((t_1 - Math.sqrt(z)) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else if (y <= 2.8e+36) {
tmp = (t_2 - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (t_1 + Math.sqrt(z))));
} else {
tmp = 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((x + 1.0)) tmp = 0 if y <= 3.2e-149: tmp = (2.0 - (math.sqrt(x) + math.sqrt(y))) + ((t_1 - math.sqrt(z)) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) elif y <= 2.8e+36: tmp = (t_2 - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (t_1 + math.sqrt(z)))) else: tmp = 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(x + 1.0)) tmp = 0.0 if (y <= 3.2e-149) tmp = Float64(Float64(2.0 - Float64(sqrt(x) + sqrt(y))) + Float64(Float64(t_1 - sqrt(z)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); elseif (y <= 2.8e+36) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(t_1 + sqrt(z))))); else tmp = 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((x + 1.0));
tmp = 0.0;
if (y <= 3.2e-149)
tmp = (2.0 - (sqrt(x) + sqrt(y))) + ((t_1 - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
elseif (y <= 2.8e+36)
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(z))));
else
tmp = 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.2e-149], N[(N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+36], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $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{x + 1}\\
\mathbf{if}\;y \leq 3.2 \cdot 10^{-149}:\\
\;\;\;\;\left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(\left(t\_1 - \sqrt{z}\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+36}:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{t\_1 + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_2}\\
\end{array}
\end{array}
if y < 3.20000000000000002e-149Initial program 96.9%
associate-+l+96.9%
sub-neg96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 49.3%
associate--l+49.3%
Simplified49.3%
flip--49.4%
add-sqr-sqrt39.6%
add-sqr-sqrt49.4%
Applied egg-rr49.4%
associate--l+49.4%
+-inverses49.4%
metadata-eval49.4%
Simplified49.4%
Taylor expanded in y around 0 49.4%
if 3.20000000000000002e-149 < y < 2.8000000000000001e36Initial program 89.8%
associate-+l+89.8%
associate-+l+89.8%
+-commutative89.8%
+-commutative89.8%
associate-+l-72.0%
+-commutative72.0%
+-commutative72.0%
Simplified72.0%
associate--r-89.8%
+-commutative89.8%
flip--89.9%
flip--89.9%
frac-add89.9%
Applied egg-rr90.6%
Simplified91.7%
Taylor expanded in t around inf 53.2%
if 2.8000000000000001e36 < y 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 3.2%
associate--l+21.8%
Simplified21.8%
Taylor expanded in x around inf 21.3%
neg-mul-121.3%
Simplified21.3%
+-commutative21.3%
sub-neg21.3%
add-cbrt-cube21.3%
pow321.3%
Applied egg-rr21.3%
rem-cbrt-cube21.3%
flip--21.3%
add-sqr-sqrt21.7%
+-commutative21.7%
add-sqr-sqrt21.3%
+-commutative21.3%
Applied egg-rr21.3%
associate--l+24.4%
+-inverses24.4%
metadata-eval24.4%
+-commutative24.4%
Simplified24.4%
Final simplification40.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 1.8e-22)
(+
(- 2.0 (+ (sqrt x) (sqrt y)))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= y 1.6e+15)
(+
t_1
(+
(sqrt (+ 1.0 y))
(+ (* 0.5 (sqrt (/ 1.0 z))) (/ (- x y) (- (sqrt y) (sqrt x))))))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 1.8e-22) {
tmp = (2.0 - (sqrt(x) + sqrt(y))) + ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else if (y <= 1.6e+15) {
tmp = t_1 + (sqrt((1.0 + y)) + ((0.5 * sqrt((1.0 / z))) + ((x - y) / (sqrt(y) - sqrt(x)))));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 1.8d-22) then
tmp = (2.0d0 - (sqrt(x) + sqrt(y))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else if (y <= 1.6d+15) then
tmp = t_1 + (sqrt((1.0d0 + y)) + ((0.5d0 * sqrt((1.0d0 / z))) + ((x - y) / (sqrt(y) - sqrt(x)))))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 1.8e-22) {
tmp = (2.0 - (Math.sqrt(x) + Math.sqrt(y))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else if (y <= 1.6e+15) {
tmp = t_1 + (Math.sqrt((1.0 + y)) + ((0.5 * Math.sqrt((1.0 / z))) + ((x - y) / (Math.sqrt(y) - Math.sqrt(x)))));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 1.8e-22: tmp = (2.0 - (math.sqrt(x) + math.sqrt(y))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) elif y <= 1.6e+15: tmp = t_1 + (math.sqrt((1.0 + y)) + ((0.5 * math.sqrt((1.0 / z))) + ((x - y) / (math.sqrt(y) - math.sqrt(x))))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 1.8e-22) tmp = Float64(Float64(2.0 - Float64(sqrt(x) + sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); elseif (y <= 1.6e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(x - y) / Float64(sqrt(y) - sqrt(x)))))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 1.8e-22)
tmp = (2.0 - (sqrt(x) + sqrt(y))) + ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
elseif (y <= 1.6e+15)
tmp = t_1 + (sqrt((1.0 + y)) + ((0.5 * sqrt((1.0 / z))) + ((x - y) / (sqrt(y) - sqrt(x)))));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.8e-22], N[(N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e+15], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(x - y), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 1.8 \cdot 10^{-22}:\\
\;\;\;\;\left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\sqrt{1 + y} + \left(0.5 \cdot \sqrt{\frac{1}{z}} + \frac{x - y}{\sqrt{y} - \sqrt{x}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 1.7999999999999999e-22Initial program 96.5%
associate-+l+96.5%
sub-neg96.5%
sub-neg96.5%
+-commutative96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in x around 0 45.8%
associate--l+45.8%
Simplified45.8%
flip--45.8%
add-sqr-sqrt37.9%
add-sqr-sqrt46.3%
Applied egg-rr46.3%
associate--l+46.9%
+-inverses46.9%
metadata-eval46.9%
Simplified46.9%
Taylor expanded in y around 0 46.9%
if 1.7999999999999999e-22 < y < 1.6e15Initial program 84.6%
associate-+l+84.6%
sub-neg84.6%
sub-neg84.6%
+-commutative84.6%
+-commutative84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in t around inf 25.4%
associate--l+30.2%
Simplified30.2%
Taylor expanded in z around inf 16.6%
associate--l+16.6%
Simplified16.6%
flip-+16.7%
add-sqr-sqrt16.4%
add-sqr-sqrt16.4%
Applied egg-rr16.4%
if 1.6e15 < y Initial program 87.3%
associate-+l+87.3%
sub-neg87.3%
sub-neg87.3%
+-commutative87.3%
+-commutative87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in t around inf 4.3%
associate--l+22.1%
Simplified22.1%
Taylor expanded in x around inf 20.9%
neg-mul-120.9%
Simplified20.9%
+-commutative20.9%
sub-neg20.9%
add-cbrt-cube20.9%
pow320.9%
Applied egg-rr20.9%
rem-cbrt-cube20.9%
flip--20.8%
add-sqr-sqrt21.3%
+-commutative21.3%
add-sqr-sqrt20.8%
+-commutative20.8%
Applied egg-rr20.8%
associate--l+23.7%
+-inverses23.7%
metadata-eval23.7%
+-commutative23.7%
Simplified23.7%
Final simplification34.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 (+ x 1.0))))
(if (<= y 1.95e-22)
(+
(- 2.0 (+ (sqrt x) (sqrt y)))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= y 1.6e+15)
(+
t_1
(+
(sqrt (+ 1.0 y))
(+ (* 0.5 (sqrt (/ 1.0 z))) (/ (- x y) (- (sqrt y) (sqrt x))))))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 1.95e-22) {
tmp = (2.0 - (sqrt(x) + sqrt(y))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
} else if (y <= 1.6e+15) {
tmp = t_1 + (sqrt((1.0 + y)) + ((0.5 * sqrt((1.0 / z))) + ((x - y) / (sqrt(y) - sqrt(x)))));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 1.95d-22) then
tmp = (2.0d0 - (sqrt(x) + sqrt(y))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t)))
else if (y <= 1.6d+15) then
tmp = t_1 + (sqrt((1.0d0 + y)) + ((0.5d0 * sqrt((1.0d0 / z))) + ((x - y) / (sqrt(y) - sqrt(x)))))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 1.95e-22) {
tmp = (2.0 - (Math.sqrt(x) + Math.sqrt(y))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
} else if (y <= 1.6e+15) {
tmp = t_1 + (Math.sqrt((1.0 + y)) + ((0.5 * Math.sqrt((1.0 / z))) + ((x - y) / (Math.sqrt(y) - Math.sqrt(x)))));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 1.95e-22: tmp = (2.0 - (math.sqrt(x) + math.sqrt(y))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) elif y <= 1.6e+15: tmp = t_1 + (math.sqrt((1.0 + y)) + ((0.5 * math.sqrt((1.0 / z))) + ((x - y) / (math.sqrt(y) - math.sqrt(x))))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 1.95e-22) tmp = Float64(Float64(2.0 - Float64(sqrt(x) + sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); elseif (y <= 1.6e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(x - y) / Float64(sqrt(y) - sqrt(x)))))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 1.95e-22)
tmp = (2.0 - (sqrt(x) + sqrt(y))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
elseif (y <= 1.6e+15)
tmp = t_1 + (sqrt((1.0 + y)) + ((0.5 * sqrt((1.0 / z))) + ((x - y) / (sqrt(y) - sqrt(x)))));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.95e-22], N[(N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e+15], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(x - y), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 1.95 \cdot 10^{-22}:\\
\;\;\;\;\left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\sqrt{1 + y} + \left(0.5 \cdot \sqrt{\frac{1}{z}} + \frac{x - y}{\sqrt{y} - \sqrt{x}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 1.94999999999999999e-22Initial program 96.5%
associate-+l+96.5%
sub-neg96.5%
sub-neg96.5%
+-commutative96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in x around 0 45.8%
associate--l+45.8%
Simplified45.8%
Taylor expanded in y around 0 45.8%
if 1.94999999999999999e-22 < y < 1.6e15Initial program 84.6%
associate-+l+84.6%
sub-neg84.6%
sub-neg84.6%
+-commutative84.6%
+-commutative84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in t around inf 25.4%
associate--l+30.2%
Simplified30.2%
Taylor expanded in z around inf 16.6%
associate--l+16.6%
Simplified16.6%
flip-+16.7%
add-sqr-sqrt16.4%
add-sqr-sqrt16.4%
Applied egg-rr16.4%
if 1.6e15 < y Initial program 87.3%
associate-+l+87.3%
sub-neg87.3%
sub-neg87.3%
+-commutative87.3%
+-commutative87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in t around inf 4.3%
associate--l+22.1%
Simplified22.1%
Taylor expanded in x around inf 20.9%
neg-mul-120.9%
Simplified20.9%
+-commutative20.9%
sub-neg20.9%
add-cbrt-cube20.9%
pow320.9%
Applied egg-rr20.9%
rem-cbrt-cube20.9%
flip--20.8%
add-sqr-sqrt21.3%
+-commutative21.3%
add-sqr-sqrt20.8%
+-commutative20.8%
Applied egg-rr20.8%
associate--l+23.7%
+-inverses23.7%
metadata-eval23.7%
+-commutative23.7%
Simplified23.7%
Final simplification34.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))) (t_2 (sqrt (+ x 1.0))))
(if (<= y 1.4e-28)
(+ 1.0 (+ t_1 (- (sqrt (+ 1.0 z)) (+ (sqrt z) (+ (sqrt x) (sqrt y))))))
(if (<= y 2.7e+15)
(+
t_2
(+ t_1 (+ (* 0.5 (sqrt (/ 1.0 z))) (/ (- x y) (- (sqrt y) (sqrt x))))))
(/ 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 + y));
double t_2 = sqrt((x + 1.0));
double tmp;
if (y <= 1.4e-28) {
tmp = 1.0 + (t_1 + (sqrt((1.0 + z)) - (sqrt(z) + (sqrt(x) + sqrt(y)))));
} else if (y <= 2.7e+15) {
tmp = t_2 + (t_1 + ((0.5 * sqrt((1.0 / z))) + ((x - y) / (sqrt(y) - sqrt(x)))));
} else {
tmp = 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 + y))
t_2 = sqrt((x + 1.0d0))
if (y <= 1.4d-28) then
tmp = 1.0d0 + (t_1 + (sqrt((1.0d0 + z)) - (sqrt(z) + (sqrt(x) + sqrt(y)))))
else if (y <= 2.7d+15) then
tmp = t_2 + (t_1 + ((0.5d0 * sqrt((1.0d0 / z))) + ((x - y) / (sqrt(y) - sqrt(x)))))
else
tmp = 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 + y));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 1.4e-28) {
tmp = 1.0 + (t_1 + (Math.sqrt((1.0 + z)) - (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(y)))));
} else if (y <= 2.7e+15) {
tmp = t_2 + (t_1 + ((0.5 * Math.sqrt((1.0 / z))) + ((x - y) / (Math.sqrt(y) - Math.sqrt(x)))));
} else {
tmp = 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 + y)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if y <= 1.4e-28: tmp = 1.0 + (t_1 + (math.sqrt((1.0 + z)) - (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y))))) elif y <= 2.7e+15: tmp = t_2 + (t_1 + ((0.5 * math.sqrt((1.0 / z))) + ((x - y) / (math.sqrt(y) - math.sqrt(x))))) else: tmp = 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 + y)) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 1.4e-28) tmp = Float64(1.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y)))))); elseif (y <= 2.7e+15) tmp = Float64(t_2 + Float64(t_1 + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(x - y) / Float64(sqrt(y) - sqrt(x)))))); else tmp = 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 + y));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 1.4e-28)
tmp = 1.0 + (t_1 + (sqrt((1.0 + z)) - (sqrt(z) + (sqrt(x) + sqrt(y)))));
elseif (y <= 2.7e+15)
tmp = t_2 + (t_1 + ((0.5 * sqrt((1.0 / z))) + ((x - y) / (sqrt(y) - sqrt(x)))));
else
tmp = 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 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.4e-28], N[(1.0 + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+15], N[(t$95$2 + N[(t$95$1 + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(x - y), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 1.4 \cdot 10^{-28}:\\
\;\;\;\;1 + \left(t\_1 + \left(\sqrt{1 + z} - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+15}:\\
\;\;\;\;t\_2 + \left(t\_1 + \left(0.5 \cdot \sqrt{\frac{1}{z}} + \frac{x - y}{\sqrt{y} - \sqrt{x}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_2}\\
\end{array}
\end{array}
if y < 1.3999999999999999e-28Initial program 96.6%
associate-+l+96.6%
sub-neg96.6%
sub-neg96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in t around inf 18.5%
associate--l+22.4%
Simplified22.4%
Taylor expanded in x around 0 15.2%
associate-+r+15.2%
associate--l+22.8%
associate-+r-32.6%
+-commutative32.6%
Simplified32.6%
if 1.3999999999999999e-28 < y < 2.7e15Initial program 85.4%
associate-+l+85.4%
sub-neg85.4%
sub-neg85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 26.4%
associate--l+31.5%
Simplified31.5%
Taylor expanded in z around inf 19.1%
associate--l+19.1%
Simplified19.1%
flip-+19.3%
add-sqr-sqrt19.0%
add-sqr-sqrt19.0%
Applied egg-rr19.0%
if 2.7e15 < y Initial program 87.3%
associate-+l+87.3%
sub-neg87.3%
sub-neg87.3%
+-commutative87.3%
+-commutative87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in t around inf 4.3%
associate--l+22.1%
Simplified22.1%
Taylor expanded in x around inf 20.9%
neg-mul-120.9%
Simplified20.9%
+-commutative20.9%
sub-neg20.9%
add-cbrt-cube20.9%
pow320.9%
Applied egg-rr20.9%
rem-cbrt-cube20.9%
flip--20.8%
add-sqr-sqrt21.3%
+-commutative21.3%
add-sqr-sqrt20.8%
+-commutative20.8%
Applied egg-rr20.8%
associate--l+23.7%
+-inverses23.7%
metadata-eval23.7%
+-commutative23.7%
Simplified23.7%
Final simplification27.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 x) (sqrt y)))
(t_2 (sqrt (+ 1.0 y)))
(t_3 (sqrt (+ x 1.0))))
(if (<= y 1.4e-28)
(+ 1.0 (+ t_2 (- (sqrt (+ 1.0 z)) (+ (sqrt z) t_1))))
(if (<= y 4.5e+15)
(+ t_3 (+ t_2 (- (* 0.5 (sqrt (/ 1.0 z))) t_1)))
(/ 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(x) + sqrt(y);
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((x + 1.0));
double tmp;
if (y <= 1.4e-28) {
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(z) + t_1)));
} else if (y <= 4.5e+15) {
tmp = t_3 + (t_2 + ((0.5 * sqrt((1.0 / z))) - t_1));
} else {
tmp = 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(x) + sqrt(y)
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((x + 1.0d0))
if (y <= 1.4d-28) then
tmp = 1.0d0 + (t_2 + (sqrt((1.0d0 + z)) - (sqrt(z) + t_1)))
else if (y <= 4.5d+15) then
tmp = t_3 + (t_2 + ((0.5d0 * sqrt((1.0d0 / z))) - t_1))
else
tmp = 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(x) + Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 1.4e-28) {
tmp = 1.0 + (t_2 + (Math.sqrt((1.0 + z)) - (Math.sqrt(z) + t_1)));
} else if (y <= 4.5e+15) {
tmp = t_3 + (t_2 + ((0.5 * Math.sqrt((1.0 / z))) - t_1));
} else {
tmp = 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(x) + math.sqrt(y) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((x + 1.0)) tmp = 0 if y <= 1.4e-28: tmp = 1.0 + (t_2 + (math.sqrt((1.0 + z)) - (math.sqrt(z) + t_1))) elif y <= 4.5e+15: tmp = t_3 + (t_2 + ((0.5 * math.sqrt((1.0 / z))) - t_1)) else: tmp = 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(x) + sqrt(y)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 1.4e-28) tmp = Float64(1.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(z) + t_1)))); elseif (y <= 4.5e+15) tmp = Float64(t_3 + Float64(t_2 + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - t_1))); else tmp = 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(x) + sqrt(y);
t_2 = sqrt((1.0 + y));
t_3 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 1.4e-28)
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(z) + t_1)));
elseif (y <= 4.5e+15)
tmp = t_3 + (t_2 + ((0.5 * sqrt((1.0 / z))) - t_1));
else
tmp = 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[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.4e-28], N[(1.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(t$95$3 + N[(t$95$2 + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x} + \sqrt{y}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 1.4 \cdot 10^{-28}:\\
\;\;\;\;1 + \left(t\_2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + t\_1\right)\right)\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;t\_3 + \left(t\_2 + \left(0.5 \cdot \sqrt{\frac{1}{z}} - t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_3}\\
\end{array}
\end{array}
if y < 1.3999999999999999e-28Initial program 96.6%
associate-+l+96.6%
sub-neg96.6%
sub-neg96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in t around inf 18.5%
associate--l+22.4%
Simplified22.4%
Taylor expanded in x around 0 15.2%
associate-+r+15.2%
associate--l+22.8%
associate-+r-32.6%
+-commutative32.6%
Simplified32.6%
if 1.3999999999999999e-28 < y < 4.5e15Initial program 85.4%
associate-+l+85.4%
sub-neg85.4%
sub-neg85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 26.4%
associate--l+31.5%
Simplified31.5%
Taylor expanded in z around inf 19.1%
associate--l+19.1%
Simplified19.1%
if 4.5e15 < y Initial program 87.3%
associate-+l+87.3%
sub-neg87.3%
sub-neg87.3%
+-commutative87.3%
+-commutative87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in t around inf 4.3%
associate--l+22.1%
Simplified22.1%
Taylor expanded in x around inf 20.9%
neg-mul-120.9%
Simplified20.9%
+-commutative20.9%
sub-neg20.9%
add-cbrt-cube20.9%
pow320.9%
Applied egg-rr20.9%
rem-cbrt-cube20.9%
flip--20.8%
add-sqr-sqrt21.3%
+-commutative21.3%
add-sqr-sqrt20.8%
+-commutative20.8%
Applied egg-rr20.8%
associate--l+23.7%
+-inverses23.7%
metadata-eval23.7%
+-commutative23.7%
Simplified23.7%
Final simplification27.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 x) (sqrt y))) (t_2 (sqrt (+ 1.0 y))))
(if (<= y 1.4e-28)
(+ 1.0 (+ t_2 (- (sqrt (+ 1.0 z)) (+ (sqrt z) t_1))))
(if (<= y 65000000000.0)
(- (+ (* 0.5 (sqrt (/ 1.0 z))) (+ 1.0 t_2)) t_1)
(/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(x) + sqrt(y);
double t_2 = sqrt((1.0 + y));
double tmp;
if (y <= 1.4e-28) {
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(z) + t_1)));
} else if (y <= 65000000000.0) {
tmp = ((0.5 * sqrt((1.0 / z))) + (1.0 + t_2)) - t_1;
} else {
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
}
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(x) + sqrt(y)
t_2 = sqrt((1.0d0 + y))
if (y <= 1.4d-28) then
tmp = 1.0d0 + (t_2 + (sqrt((1.0d0 + z)) - (sqrt(z) + t_1)))
else if (y <= 65000000000.0d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / z))) + (1.0d0 + t_2)) - t_1
else
tmp = 1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))
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(x) + Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (y <= 1.4e-28) {
tmp = 1.0 + (t_2 + (Math.sqrt((1.0 + z)) - (Math.sqrt(z) + t_1)));
} else if (y <= 65000000000.0) {
tmp = ((0.5 * Math.sqrt((1.0 / z))) + (1.0 + t_2)) - t_1;
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(x) + math.sqrt(y) t_2 = math.sqrt((1.0 + y)) tmp = 0 if y <= 1.4e-28: tmp = 1.0 + (t_2 + (math.sqrt((1.0 + z)) - (math.sqrt(z) + t_1))) elif y <= 65000000000.0: tmp = ((0.5 * math.sqrt((1.0 / z))) + (1.0 + t_2)) - t_1 else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(x) + sqrt(y)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (y <= 1.4e-28) tmp = Float64(1.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(z) + t_1)))); elseif (y <= 65000000000.0) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(1.0 + t_2)) - t_1); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); 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(x) + sqrt(y);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (y <= 1.4e-28)
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(z) + t_1)));
elseif (y <= 65000000000.0)
tmp = ((0.5 * sqrt((1.0 / z))) + (1.0 + t_2)) - t_1;
else
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
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[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.4e-28], N[(1.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 65000000000.0], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x} + \sqrt{y}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;y \leq 1.4 \cdot 10^{-28}:\\
\;\;\;\;1 + \left(t\_2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + t\_1\right)\right)\right)\\
\mathbf{elif}\;y \leq 65000000000:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{z}} + \left(1 + t\_2\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 1.3999999999999999e-28Initial program 96.6%
associate-+l+96.6%
sub-neg96.6%
sub-neg96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in t around inf 18.5%
associate--l+22.4%
Simplified22.4%
Taylor expanded in x around 0 15.2%
associate-+r+15.2%
associate--l+22.8%
associate-+r-32.6%
+-commutative32.6%
Simplified32.6%
if 1.3999999999999999e-28 < y < 6.5e10Initial 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 28.0%
associate--l+32.3%
Simplified32.3%
Taylor expanded in z around inf 17.6%
associate--l+17.6%
Simplified17.6%
Taylor expanded in x around 0 11.5%
associate-+r+11.5%
Simplified11.5%
if 6.5e10 < y Initial program 86.7%
associate-+l+86.7%
sub-neg86.7%
sub-neg86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in t around inf 4.8%
associate--l+22.3%
Simplified22.3%
Taylor expanded in x around inf 20.9%
neg-mul-120.9%
Simplified20.9%
+-commutative20.9%
sub-neg20.9%
add-cbrt-cube20.9%
pow320.9%
Applied egg-rr20.9%
rem-cbrt-cube20.9%
flip--20.9%
add-sqr-sqrt21.3%
+-commutative21.3%
add-sqr-sqrt20.9%
+-commutative20.9%
Applied egg-rr20.9%
associate--l+23.7%
+-inverses23.7%
metadata-eval23.7%
+-commutative23.7%
Simplified23.7%
Final simplification27.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 x) (sqrt y))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 1.3)
(-
(+ 1.0 (+ 1.0 (+ t_2 (* z (+ 0.5 (* z (- (* z 0.0625) 0.125)))))))
(+ (sqrt x) (+ (sqrt y) (sqrt z))))
(if (<= z 1.02e+45)
(- (+ (* 0.5 (sqrt (/ 1.0 z))) (+ 1.0 t_2)) t_1)
(+ (sqrt (+ x 1.0)) (- t_2 t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(x) + sqrt(y);
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 1.3) {
tmp = (1.0 + (1.0 + (t_2 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else if (z <= 1.02e+45) {
tmp = ((0.5 * sqrt((1.0 / z))) + (1.0 + t_2)) - t_1;
} else {
tmp = sqrt((x + 1.0)) + (t_2 - t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(x) + sqrt(y)
t_2 = sqrt((1.0d0 + y))
if (z <= 1.3d0) then
tmp = (1.0d0 + (1.0d0 + (t_2 + (z * (0.5d0 + (z * ((z * 0.0625d0) - 0.125d0))))))) - (sqrt(x) + (sqrt(y) + sqrt(z)))
else if (z <= 1.02d+45) then
tmp = ((0.5d0 * sqrt((1.0d0 / z))) + (1.0d0 + t_2)) - t_1
else
tmp = sqrt((x + 1.0d0)) + (t_2 - 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(x) + Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.3) {
tmp = (1.0 + (1.0 + (t_2 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else if (z <= 1.02e+45) {
tmp = ((0.5 * Math.sqrt((1.0 / z))) + (1.0 + t_2)) - t_1;
} else {
tmp = Math.sqrt((x + 1.0)) + (t_2 - t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(x) + math.sqrt(y) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.3: tmp = (1.0 + (1.0 + (t_2 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) elif z <= 1.02e+45: tmp = ((0.5 * math.sqrt((1.0 / z))) + (1.0 + t_2)) - t_1 else: tmp = math.sqrt((x + 1.0)) + (t_2 - t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(x) + sqrt(y)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.3) tmp = Float64(Float64(1.0 + Float64(1.0 + Float64(t_2 + Float64(z * Float64(0.5 + Float64(z * Float64(Float64(z * 0.0625) - 0.125))))))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); elseif (z <= 1.02e+45) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(1.0 + t_2)) - t_1); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(t_2 - 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(x) + sqrt(y);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.3)
tmp = (1.0 + (1.0 + (t_2 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
elseif (z <= 1.02e+45)
tmp = ((0.5 * sqrt((1.0 / z))) + (1.0 + t_2)) - t_1;
else
tmp = sqrt((x + 1.0)) + (t_2 - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.3], N[(N[(1.0 + N[(1.0 + N[(t$95$2 + N[(z * N[(0.5 + N[(z * N[(N[(z * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+45], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(t$95$2 - t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x} + \sqrt{y}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.3:\\
\;\;\;\;\left(1 + \left(1 + \left(t\_2 + z \cdot \left(0.5 + z \cdot \left(z \cdot 0.0625 - 0.125\right)\right)\right)\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+45}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{z}} + \left(1 + t\_2\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(t\_2 - t\_1\right)\\
\end{array}
\end{array}
if z < 1.30000000000000004Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in t around inf 22.0%
associate--l+26.1%
Simplified26.1%
Taylor expanded in z around 0 22.0%
Taylor expanded in x around 0 19.3%
if 1.30000000000000004 < z < 1.02e45Initial program 76.8%
associate-+l+76.8%
sub-neg76.8%
sub-neg76.8%
+-commutative76.8%
+-commutative76.8%
+-commutative76.8%
Simplified76.8%
Taylor expanded in t around inf 20.4%
associate--l+24.9%
Simplified24.9%
Taylor expanded in z around inf 36.1%
associate--l+36.1%
Simplified36.1%
Taylor expanded in x around 0 21.0%
associate-+r+21.0%
Simplified21.0%
if 1.02e45 < z Initial program 87.6%
associate-+l+87.6%
sub-neg87.6%
sub-neg87.6%
+-commutative87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
Taylor expanded in t around inf 3.2%
associate--l+19.8%
Simplified19.8%
Taylor expanded in z around inf 17.7%
associate--l+28.8%
Simplified28.8%
Final simplification24.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 4.5e+15)
(- (+ (sqrt (+ 1.0 y)) t_1) (+ (sqrt x) (sqrt y)))
(/ 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((x + 1.0));
double tmp;
if (y <= 4.5e+15) {
tmp = (sqrt((1.0 + y)) + t_1) - (sqrt(x) + sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 4.5d+15) then
tmp = (sqrt((1.0d0 + y)) + t_1) - (sqrt(x) + sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 4.5e+15) {
tmp = (Math.sqrt((1.0 + y)) + t_1) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 4.5e+15: tmp = (math.sqrt((1.0 + y)) + t_1) - (math.sqrt(x) + math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 4.5e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + y)) + t_1) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 4.5e+15)
tmp = (sqrt((1.0 + y)) + t_1) - (sqrt(x) + sqrt(y));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.5e+15], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + y} + t\_1\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 4.5e15Initial program 95.0%
associate-+l+95.0%
sub-neg95.0%
sub-neg95.0%
+-commutative95.0%
+-commutative95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in t around inf 19.6%
associate--l+23.7%
Simplified23.7%
Taylor expanded in z around inf 21.6%
if 4.5e15 < y Initial program 87.3%
associate-+l+87.3%
sub-neg87.3%
sub-neg87.3%
+-commutative87.3%
+-commutative87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in t around inf 4.3%
associate--l+22.1%
Simplified22.1%
Taylor expanded in x around inf 20.9%
neg-mul-120.9%
Simplified20.9%
+-commutative20.9%
sub-neg20.9%
add-cbrt-cube20.9%
pow320.9%
Applied egg-rr20.9%
rem-cbrt-cube20.9%
flip--20.8%
add-sqr-sqrt21.3%
+-commutative21.3%
add-sqr-sqrt20.8%
+-commutative20.8%
Applied egg-rr20.8%
associate--l+23.7%
+-inverses23.7%
metadata-eval23.7%
+-commutative23.7%
Simplified23.7%
Final simplification22.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 (+ x 1.0))))
(if (<= y 5e+15)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))
(/ 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((x + 1.0));
double tmp;
if (y <= 5e+15) {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 5d+15) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 5e+15) {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 5e+15: tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 5e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 5e+15)
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5e+15], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 5 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 5e15Initial program 95.0%
associate-+l+95.0%
sub-neg95.0%
sub-neg95.0%
+-commutative95.0%
+-commutative95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in t around inf 19.6%
associate--l+23.7%
Simplified23.7%
Taylor expanded in z around inf 21.6%
associate--l+21.6%
Simplified21.6%
if 5e15 < y Initial program 87.3%
associate-+l+87.3%
sub-neg87.3%
sub-neg87.3%
+-commutative87.3%
+-commutative87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in t around inf 4.3%
associate--l+22.1%
Simplified22.1%
Taylor expanded in x around inf 20.9%
neg-mul-120.9%
Simplified20.9%
+-commutative20.9%
sub-neg20.9%
add-cbrt-cube20.9%
pow320.9%
Applied egg-rr20.9%
rem-cbrt-cube20.9%
flip--20.8%
add-sqr-sqrt21.3%
+-commutative21.3%
add-sqr-sqrt20.8%
+-commutative20.8%
Applied egg-rr20.8%
associate--l+23.7%
+-inverses23.7%
metadata-eval23.7%
+-commutative23.7%
Simplified23.7%
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 (+ x 1.0)) (sqrt x)))) (if (<= t_1 1e-5) (* 0.5 (sqrt (/ 1.0 x))) t_1)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0)) - sqrt(x);
double tmp;
if (t_1 <= 1e-5) {
tmp = 0.5 * sqrt((1.0 / x));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0)) - sqrt(x)
if (t_1 <= 1d-5) then
tmp = 0.5d0 * sqrt((1.0d0 / x))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
double tmp;
if (t_1 <= 1e-5) {
tmp = 0.5 * Math.sqrt((1.0 / x));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) - math.sqrt(x) tmp = 0 if t_1 <= 1e-5: tmp = 0.5 * math.sqrt((1.0 / x)) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) tmp = 0.0 if (t_1 <= 1e-5) tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0)) - sqrt(x);
tmp = 0.0;
if (t_1 <= 1e-5)
tmp = 0.5 * sqrt((1.0 / x));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-5], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1} - \sqrt{x}\\
\mathbf{if}\;t\_1 \leq 10^{-5}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1.00000000000000008e-5Initial program 87.1%
associate-+l+87.1%
sub-neg87.1%
sub-neg87.1%
+-commutative87.1%
+-commutative87.1%
+-commutative87.1%
Simplified87.1%
Taylor expanded in t around inf 5.4%
associate--l+6.9%
Simplified6.9%
Taylor expanded in x around inf 3.2%
neg-mul-13.2%
Simplified3.2%
Taylor expanded in x around inf 7.9%
if 1.00000000000000008e-5 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.0%
associate-+l+96.0%
sub-neg96.0%
sub-neg96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 19.9%
associate--l+38.6%
Simplified38.6%
Taylor expanded in x around inf 27.0%
neg-mul-127.0%
Simplified27.0%
+-commutative27.0%
sub-neg27.0%
Applied egg-rr27.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 / (sqrt(x) + sqrt((x + 1.0)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{x} + \sqrt{x + 1}}
\end{array}
Initial program 91.6%
associate-+l+91.6%
sub-neg91.6%
sub-neg91.6%
+-commutative91.6%
+-commutative91.6%
+-commutative91.6%
Simplified91.6%
Taylor expanded in t around inf 12.8%
associate--l+23.0%
Simplified23.0%
Taylor expanded in x around inf 15.3%
neg-mul-115.3%
Simplified15.3%
+-commutative15.3%
sub-neg15.3%
add-cbrt-cube15.3%
pow315.3%
Applied egg-rr15.3%
rem-cbrt-cube15.3%
flip--15.3%
add-sqr-sqrt15.6%
+-commutative15.6%
add-sqr-sqrt15.3%
+-commutative15.3%
Applied egg-rr15.3%
associate--l+17.6%
+-inverses17.6%
metadata-eval17.6%
+-commutative17.6%
Simplified17.6%
Final simplification17.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 1.3) (- (+ 1.0 (* x (+ 0.5 (* x (- (* x 0.0625) 0.125))))) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.3) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.3d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * ((x * 0.0625d0) - 0.125d0))))) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.3) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.3: tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.3) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.0625) - 0.125))))) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.3)
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.3], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.3:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.0625 - 0.125\right)\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1.30000000000000004Initial program 96.0%
associate-+l+96.0%
sub-neg96.0%
sub-neg96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 20.3%
associate--l+39.1%
Simplified39.1%
Taylor expanded in x around inf 27.3%
neg-mul-127.3%
Simplified27.3%
Taylor expanded in x around 0 27.3%
if 1.30000000000000004 < x Initial program 87.2%
associate-+l+87.2%
sub-neg87.2%
sub-neg87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in t around inf 5.4%
associate--l+7.1%
Simplified7.1%
Taylor expanded in x around inf 3.5%
neg-mul-13.5%
Simplified3.5%
Taylor expanded in x around inf 8.0%
Final simplification17.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 1.12) (- (+ 1.0 (* x (+ 0.5 (* x -0.125)))) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.12) {
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.12d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * (-0.125d0))))) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.12) {
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.12: tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.12) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * -0.125)))) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.12)
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.12], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.12:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot -0.125\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1.1200000000000001Initial program 96.0%
associate-+l+96.0%
sub-neg96.0%
sub-neg96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 20.3%
associate--l+39.1%
Simplified39.1%
Taylor expanded in x around inf 27.3%
neg-mul-127.3%
Simplified27.3%
Taylor expanded in x around 0 27.3%
if 1.1200000000000001 < x Initial program 87.2%
associate-+l+87.2%
sub-neg87.2%
sub-neg87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in t around inf 5.4%
associate--l+7.1%
Simplified7.1%
Taylor expanded in x around inf 3.5%
neg-mul-13.5%
Simplified3.5%
Taylor expanded in x around inf 8.0%
Final simplification17.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 5.4) (- (+ 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 <= 5.4) {
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 <= 5.4d0) 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 <= 5.4) {
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 <= 5.4: 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 <= 5.4) 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 <= 5.4)
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, 5.4], 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 5.4:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 5.4000000000000004Initial program 96.0%
associate-+l+96.0%
sub-neg96.0%
sub-neg96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 20.2%
associate--l+38.9%
Simplified38.9%
Taylor expanded in x around inf 27.2%
neg-mul-127.2%
Simplified27.2%
Taylor expanded in x around 0 27.2%
if 5.4000000000000004 < x Initial program 87.1%
associate-+l+87.1%
sub-neg87.1%
sub-neg87.1%
+-commutative87.1%
+-commutative87.1%
+-commutative87.1%
Simplified87.1%
Taylor expanded in t around inf 5.4%
associate--l+7.0%
Simplified7.0%
Taylor expanded in x around inf 3.4%
neg-mul-13.4%
Simplified3.4%
Taylor expanded in x around inf 8.0%
Final simplification17.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 0.086) (+ (- 2.0 (sqrt x)) -1.0) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.086) {
tmp = (2.0 - sqrt(x)) + -1.0;
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 0.086d0) then
tmp = (2.0d0 - sqrt(x)) + (-1.0d0)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.086) {
tmp = (2.0 - Math.sqrt(x)) + -1.0;
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.086: tmp = (2.0 - math.sqrt(x)) + -1.0 else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.086) tmp = Float64(Float64(2.0 - sqrt(x)) + -1.0); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.086)
tmp = (2.0 - sqrt(x)) + -1.0;
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.086], N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.086:\\
\;\;\;\;\left(2 - \sqrt{x}\right) + -1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.085999999999999993Initial program 96.1%
associate-+l+96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in t around inf 20.1%
associate--l+39.1%
Simplified39.1%
Taylor expanded in x around inf 27.3%
neg-mul-127.3%
Simplified27.3%
Taylor expanded in x around 0 27.1%
expm1-log1p-u27.1%
Applied egg-rr27.1%
expm1-undefine27.1%
sub-neg27.1%
log1p-undefine27.1%
rem-exp-log27.1%
associate-+r-27.1%
metadata-eval27.1%
metadata-eval27.1%
Simplified27.1%
if 0.085999999999999993 < x Initial program 87.2%
associate-+l+87.2%
sub-neg87.2%
sub-neg87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in t around inf 5.6%
associate--l+7.4%
Simplified7.4%
Taylor expanded in x around inf 3.6%
neg-mul-13.6%
Simplified3.6%
Taylor expanded in x around inf 8.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 0.049) (- 1.0 (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.049) {
tmp = 1.0 - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 0.049d0) then
tmp = 1.0d0 - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.049) {
tmp = 1.0 - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.049: tmp = 1.0 - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.049) tmp = Float64(1.0 - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.049)
tmp = 1.0 - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.049], N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.049:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.049000000000000002Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
sub-neg96.2%
+-commutative96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in t around inf 20.1%
associate--l+39.2%
Simplified39.2%
Taylor expanded in x around inf 27.4%
neg-mul-127.4%
Simplified27.4%
Taylor expanded in x around 0 27.2%
if 0.049000000000000002 < x Initial program 87.2%
associate-+l+87.2%
sub-neg87.2%
sub-neg87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in t around inf 5.7%
associate--l+7.5%
Simplified7.5%
Taylor expanded in x around inf 3.7%
neg-mul-13.7%
Simplified3.7%
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 (- 1.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 91.6%
associate-+l+91.6%
sub-neg91.6%
sub-neg91.6%
+-commutative91.6%
+-commutative91.6%
+-commutative91.6%
Simplified91.6%
Taylor expanded in t around inf 12.8%
associate--l+23.0%
Simplified23.0%
Taylor expanded in x around inf 15.3%
neg-mul-115.3%
Simplified15.3%
Taylor expanded in x around 0 14.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 91.6%
associate-+l+91.6%
sub-neg91.6%
sub-neg91.6%
+-commutative91.6%
+-commutative91.6%
+-commutative91.6%
Simplified91.6%
Taylor expanded in x around 0 36.9%
associate--l+48.3%
Simplified48.3%
flip--48.4%
add-sqr-sqrt39.6%
add-sqr-sqrt48.7%
Applied egg-rr48.7%
associate--l+49.0%
+-inverses49.0%
metadata-eval49.0%
Simplified49.0%
Taylor expanded in x around inf 1.6%
neg-mul-11.6%
Simplified1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024180
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (/ 1 (+ (sqrt (+ x 1)) (sqrt x))) (/ 1 (+ (sqrt (+ y 1)) (sqrt y)))) (/ 1 (+ (sqrt (+ z 1)) (sqrt z)))) (- (sqrt (+ t 1)) (sqrt t))))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))