
(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 31 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 z)) (sqrt z)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (sqrt (+ y 1.0)))
(t_4 (- t_3 (sqrt y)))
(t_5 (sqrt (+ 1.0 t))))
(if (<= t_4 1e-6)
(+
(/
(*
y
(+
(* 2.0 (sqrt (/ 1.0 y)))
(+ (* (/ 1.0 y) (sqrt x)) (* (/ 1.0 y) t_2))))
(* (+ (sqrt y) t_3) (+ (sqrt x) (hypot 1.0 (sqrt x)))))
(+ t_1 (- t_5 (sqrt t))))
(+ (+ (- t_2 (sqrt x)) t_4) (+ t_1 (/ 1.0 (+ t_5 (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)) - sqrt(z);
double t_2 = sqrt((1.0 + x));
double t_3 = sqrt((y + 1.0));
double t_4 = t_3 - sqrt(y);
double t_5 = sqrt((1.0 + t));
double tmp;
if (t_4 <= 1e-6) {
tmp = ((y * ((2.0 * sqrt((1.0 / y))) + (((1.0 / y) * sqrt(x)) + ((1.0 / y) * t_2)))) / ((sqrt(y) + t_3) * (sqrt(x) + hypot(1.0, sqrt(x))))) + (t_1 + (t_5 - sqrt(t)));
} else {
tmp = ((t_2 - sqrt(x)) + t_4) + (t_1 + (1.0 / (t_5 + sqrt(t))));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + x));
double t_3 = Math.sqrt((y + 1.0));
double t_4 = t_3 - Math.sqrt(y);
double t_5 = Math.sqrt((1.0 + t));
double tmp;
if (t_4 <= 1e-6) {
tmp = ((y * ((2.0 * Math.sqrt((1.0 / y))) + (((1.0 / y) * Math.sqrt(x)) + ((1.0 / y) * t_2)))) / ((Math.sqrt(y) + t_3) * (Math.sqrt(x) + Math.hypot(1.0, Math.sqrt(x))))) + (t_1 + (t_5 - Math.sqrt(t)));
} else {
tmp = ((t_2 - Math.sqrt(x)) + t_4) + (t_1 + (1.0 / (t_5 + 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)) - math.sqrt(z) t_2 = math.sqrt((1.0 + x)) t_3 = math.sqrt((y + 1.0)) t_4 = t_3 - math.sqrt(y) t_5 = math.sqrt((1.0 + t)) tmp = 0 if t_4 <= 1e-6: tmp = ((y * ((2.0 * math.sqrt((1.0 / y))) + (((1.0 / y) * math.sqrt(x)) + ((1.0 / y) * t_2)))) / ((math.sqrt(y) + t_3) * (math.sqrt(x) + math.hypot(1.0, math.sqrt(x))))) + (t_1 + (t_5 - math.sqrt(t))) else: tmp = ((t_2 - math.sqrt(x)) + t_4) + (t_1 + (1.0 / (t_5 + math.sqrt(t)))) 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 = sqrt(Float64(1.0 + x)) t_3 = sqrt(Float64(y + 1.0)) t_4 = Float64(t_3 - sqrt(y)) t_5 = sqrt(Float64(1.0 + t)) tmp = 0.0 if (t_4 <= 1e-6) tmp = Float64(Float64(Float64(y * Float64(Float64(2.0 * sqrt(Float64(1.0 / y))) + Float64(Float64(Float64(1.0 / y) * sqrt(x)) + Float64(Float64(1.0 / y) * t_2)))) / Float64(Float64(sqrt(y) + t_3) * Float64(sqrt(x) + hypot(1.0, sqrt(x))))) + Float64(t_1 + Float64(t_5 - sqrt(t)))); else tmp = Float64(Float64(Float64(t_2 - sqrt(x)) + t_4) + Float64(t_1 + Float64(1.0 / Float64(t_5 + 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)) - sqrt(z);
t_2 = sqrt((1.0 + x));
t_3 = sqrt((y + 1.0));
t_4 = t_3 - sqrt(y);
t_5 = sqrt((1.0 + t));
tmp = 0.0;
if (t_4 <= 1e-6)
tmp = ((y * ((2.0 * sqrt((1.0 / y))) + (((1.0 / y) * sqrt(x)) + ((1.0 / y) * t_2)))) / ((sqrt(y) + t_3) * (sqrt(x) + hypot(1.0, sqrt(x))))) + (t_1 + (t_5 - sqrt(t)));
else
tmp = ((t_2 - sqrt(x)) + t_4) + (t_1 + (1.0 / (t_5 + 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 1e-6], N[(N[(N[(y * N[(N[(2.0 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 / y), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / y), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[Sqrt[y], $MachinePrecision] + t$95$3), $MachinePrecision] * N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[x], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(t$95$5 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(t$95$5 + 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} - \sqrt{z}\\
t_2 := \sqrt{1 + x}\\
t_3 := \sqrt{y + 1}\\
t_4 := t\_3 - \sqrt{y}\\
t_5 := \sqrt{1 + t}\\
\mathbf{if}\;t\_4 \leq 10^{-6}:\\
\;\;\;\;\frac{y \cdot \left(2 \cdot \sqrt{\frac{1}{y}} + \left(\frac{1}{y} \cdot \sqrt{x} + \frac{1}{y} \cdot t\_2\right)\right)}{\left(\sqrt{y} + t\_3\right) \cdot \left(\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)\right)} + \left(t\_1 + \left(t\_5 - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_2 - \sqrt{x}\right) + t\_4\right) + \left(t\_1 + \frac{1}{t\_5 + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 9.99999999999999955e-7Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
flip--84.4%
flip--84.4%
frac-add84.4%
Applied egg-rr85.1%
Simplified87.8%
Taylor expanded in y around inf 92.2%
if 9.99999999999999955e-7 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 97.4%
associate-+l+97.4%
sub-neg97.4%
sub-neg97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
flip--97.4%
div-inv97.4%
add-sqr-sqrt76.3%
add-sqr-sqrt97.4%
Applied egg-rr97.4%
associate-*r/97.4%
*-rgt-identity97.4%
associate--l+97.8%
+-inverses97.8%
metadata-eval97.8%
Simplified97.8%
Final simplification94.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t))))
(t_2 (- (sqrt (+ 1.0 x)) (sqrt x)))
(t_3 (sqrt (+ y 1.0)))
(t_4 (/ 1.0 (+ (sqrt y) t_3))))
(if (<= (+ t_2 (- t_3 (sqrt y))) 1e-8)
(+
t_1
(+
(* -0.125 (sqrt (/ 1.0 (pow x 3.0))))
(+ (* 0.5 (sqrt (/ 1.0 x))) t_4)))
(+ t_1 (+ 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 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
double t_2 = sqrt((1.0 + x)) - sqrt(x);
double t_3 = sqrt((y + 1.0));
double t_4 = 1.0 / (sqrt(y) + t_3);
double tmp;
if ((t_2 + (t_3 - sqrt(y))) <= 1e-8) {
tmp = t_1 + ((-0.125 * sqrt((1.0 / pow(x, 3.0)))) + ((0.5 * sqrt((1.0 / x))) + t_4));
} else {
tmp = t_1 + (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 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))
t_2 = sqrt((1.0d0 + x)) - sqrt(x)
t_3 = sqrt((y + 1.0d0))
t_4 = 1.0d0 / (sqrt(y) + t_3)
if ((t_2 + (t_3 - sqrt(y))) <= 1d-8) then
tmp = t_1 + (((-0.125d0) * sqrt((1.0d0 / (x ** 3.0d0)))) + ((0.5d0 * sqrt((1.0d0 / x))) + t_4))
else
tmp = t_1 + (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 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
double t_2 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double t_3 = Math.sqrt((y + 1.0));
double t_4 = 1.0 / (Math.sqrt(y) + t_3);
double tmp;
if ((t_2 + (t_3 - Math.sqrt(y))) <= 1e-8) {
tmp = t_1 + ((-0.125 * Math.sqrt((1.0 / Math.pow(x, 3.0)))) + ((0.5 * Math.sqrt((1.0 / x))) + t_4));
} else {
tmp = t_1 + (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 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)) t_2 = math.sqrt((1.0 + x)) - math.sqrt(x) t_3 = math.sqrt((y + 1.0)) t_4 = 1.0 / (math.sqrt(y) + t_3) tmp = 0 if (t_2 + (t_3 - math.sqrt(y))) <= 1e-8: tmp = t_1 + ((-0.125 * math.sqrt((1.0 / math.pow(x, 3.0)))) + ((0.5 * math.sqrt((1.0 / x))) + t_4)) else: tmp = t_1 + (t_2 + t_4) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) t_2 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) t_3 = sqrt(Float64(y + 1.0)) t_4 = Float64(1.0 / Float64(sqrt(y) + t_3)) tmp = 0.0 if (Float64(t_2 + Float64(t_3 - sqrt(y))) <= 1e-8) tmp = Float64(t_1 + Float64(Float64(-0.125 * sqrt(Float64(1.0 / (x ^ 3.0)))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_4))); else tmp = Float64(t_1 + 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 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
t_2 = sqrt((1.0 + x)) - sqrt(x);
t_3 = sqrt((y + 1.0));
t_4 = 1.0 / (sqrt(y) + t_3);
tmp = 0.0;
if ((t_2 + (t_3 - sqrt(y))) <= 1e-8)
tmp = t_1 + ((-0.125 * sqrt((1.0 / (x ^ 3.0)))) + ((0.5 * sqrt((1.0 / x))) + t_4));
else
tmp = t_1 + (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[(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]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-8], N[(t$95$1 + N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(t$95$2 + t$95$4), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
t_2 := \sqrt{1 + x} - \sqrt{x}\\
t_3 := \sqrt{y + 1}\\
t_4 := \frac{1}{\sqrt{y} + t\_3}\\
\mathbf{if}\;t\_2 + \left(t\_3 - \sqrt{y}\right) \leq 10^{-8}:\\
\;\;\;\;t\_1 + \left(-0.125 \cdot \sqrt{\frac{1}{{x}^{3}}} + \left(0.5 \cdot \sqrt{\frac{1}{x}} + t\_4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(t\_2 + t\_4\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))) < 1e-8Initial program 73.0%
associate-+l+73.0%
sub-neg73.0%
sub-neg73.0%
+-commutative73.0%
+-commutative73.0%
+-commutative73.0%
Simplified73.0%
flip--73.0%
flip--73.0%
frac-add73.0%
Applied egg-rr73.4%
Simplified77.0%
Taylor expanded in x around inf 86.5%
if 1e-8 < (+.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.5%
associate-+l+96.5%
sub-neg96.5%
sub-neg96.5%
+-commutative96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
flip--96.5%
div-inv96.5%
add-sqr-sqrt83.5%
add-sqr-sqrt96.9%
Applied egg-rr96.9%
associate-*r/96.9%
*-rgt-identity96.9%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified97.5%
Final simplification94.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 x)) (sqrt x)))
(t_2 (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t))))
(t_3 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))))
(if (<= t_1 1e-8)
(+ t_2 (+ (* 0.5 (sqrt (/ 1.0 x))) t_3))
(+ t_2 (+ t_1 t_3)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double t_2 = (sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
double t_3 = 1.0 / (sqrt(y) + sqrt((y + 1.0)));
double tmp;
if (t_1 <= 1e-8) {
tmp = t_2 + ((0.5 * sqrt((1.0 / x))) + t_3);
} else {
tmp = t_2 + (t_1 + 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((1.0d0 + x)) - sqrt(x)
t_2 = (sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))
t_3 = 1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))
if (t_1 <= 1d-8) then
tmp = t_2 + ((0.5d0 * sqrt((1.0d0 / x))) + t_3)
else
tmp = t_2 + (t_1 + t_3)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double t_2 = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
double t_3 = 1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)));
double tmp;
if (t_1 <= 1e-8) {
tmp = t_2 + ((0.5 * Math.sqrt((1.0 / x))) + t_3);
} else {
tmp = t_2 + (t_1 + t_3);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) t_2 = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)) t_3 = 1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))) tmp = 0 if t_1 <= 1e-8: tmp = t_2 + ((0.5 * math.sqrt((1.0 / x))) + t_3) else: tmp = t_2 + (t_1 + t_3) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) t_2 = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) t_3 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))) tmp = 0.0 if (t_1 <= 1e-8) tmp = Float64(t_2 + Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_3)); else tmp = Float64(t_2 + Float64(t_1 + t_3)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
t_2 = (sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
t_3 = 1.0 / (sqrt(y) + sqrt((y + 1.0)));
tmp = 0.0;
if (t_1 <= 1e-8)
tmp = t_2 + ((0.5 * sqrt((1.0 / x))) + t_3);
else
tmp = t_2 + (t_1 + 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[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-8], N[(t$95$2 + N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(t$95$1 + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
t_2 := \left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
t_3 := \frac{1}{\sqrt{y} + \sqrt{y + 1}}\\
\mathbf{if}\;t\_1 \leq 10^{-8}:\\
\;\;\;\;t\_2 + \left(0.5 \cdot \sqrt{\frac{1}{x}} + t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(t\_1 + t\_3\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1e-8Initial program 83.6%
associate-+l+83.6%
sub-neg83.6%
sub-neg83.6%
+-commutative83.6%
+-commutative83.6%
+-commutative83.6%
Simplified83.6%
flip--83.6%
flip--83.6%
frac-add83.6%
Applied egg-rr84.1%
Simplified86.1%
Taylor expanded in x around inf 91.8%
if 1e-8 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.4%
associate-+l+96.4%
sub-neg96.4%
sub-neg96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
flip--96.3%
div-inv96.3%
add-sqr-sqrt78.7%
add-sqr-sqrt96.7%
Applied egg-rr96.7%
associate-*r/96.7%
*-rgt-identity96.7%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified97.5%
Final simplification95.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)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t))))
(t_2 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))))
(if (<= (- (sqrt (+ 1.0 x)) (sqrt x)) 1e-8)
(+ t_1 (+ (* 0.5 (sqrt (/ 1.0 x))) t_2))
(+ t_1 (- (+ 1.0 (+ t_2 (* x 0.5))) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
double t_2 = 1.0 / (sqrt(y) + sqrt((y + 1.0)));
double tmp;
if ((sqrt((1.0 + x)) - sqrt(x)) <= 1e-8) {
tmp = t_1 + ((0.5 * sqrt((1.0 / x))) + t_2);
} else {
tmp = t_1 + ((1.0 + (t_2 + (x * 0.5))) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))
t_2 = 1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))
if ((sqrt((1.0d0 + x)) - sqrt(x)) <= 1d-8) then
tmp = t_1 + ((0.5d0 * sqrt((1.0d0 / x))) + t_2)
else
tmp = t_1 + ((1.0d0 + (t_2 + (x * 0.5d0))) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
double t_2 = 1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)));
double tmp;
if ((Math.sqrt((1.0 + x)) - Math.sqrt(x)) <= 1e-8) {
tmp = t_1 + ((0.5 * Math.sqrt((1.0 / x))) + t_2);
} else {
tmp = t_1 + ((1.0 + (t_2 + (x * 0.5))) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)) t_2 = 1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))) tmp = 0 if (math.sqrt((1.0 + x)) - math.sqrt(x)) <= 1e-8: tmp = t_1 + ((0.5 * math.sqrt((1.0 / x))) + t_2) else: tmp = t_1 + ((1.0 + (t_2 + (x * 0.5))) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) t_2 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))) tmp = 0.0 if (Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) <= 1e-8) tmp = Float64(t_1 + Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_2)); else tmp = Float64(t_1 + Float64(Float64(1.0 + Float64(t_2 + Float64(x * 0.5))) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
t_2 = 1.0 / (sqrt(y) + sqrt((y + 1.0)));
tmp = 0.0;
if ((sqrt((1.0 + x)) - sqrt(x)) <= 1e-8)
tmp = t_1 + ((0.5 * sqrt((1.0 / x))) + t_2);
else
tmp = t_1 + ((1.0 + (t_2 + (x * 0.5))) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(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]}, Block[{t$95$2 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 1e-8], N[(t$95$1 + N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 + N[(t$95$2 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
t_2 := \frac{1}{\sqrt{y} + \sqrt{y + 1}}\\
\mathbf{if}\;\sqrt{1 + x} - \sqrt{x} \leq 10^{-8}:\\
\;\;\;\;t\_1 + \left(0.5 \cdot \sqrt{\frac{1}{x}} + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(1 + \left(t\_2 + x \cdot 0.5\right)\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1e-8Initial program 83.6%
associate-+l+83.6%
sub-neg83.6%
sub-neg83.6%
+-commutative83.6%
+-commutative83.6%
+-commutative83.6%
Simplified83.6%
flip--83.6%
flip--83.6%
frac-add83.6%
Applied egg-rr84.1%
Simplified86.1%
Taylor expanded in x around inf 91.8%
if 1e-8 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.4%
associate-+l+96.4%
sub-neg96.4%
sub-neg96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
flip--96.3%
div-inv96.3%
add-sqr-sqrt78.7%
add-sqr-sqrt96.7%
Applied egg-rr96.7%
associate-*r/96.7%
*-rgt-identity96.7%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in x around 0 94.1%
Final simplification93.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0)))
(t_2 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_3 (sqrt (+ 1.0 t))))
(if (<= x 59000000.0)
(+
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) (- t_1 (sqrt y)))
(+ t_2 (/ 1.0 (+ t_3 (sqrt t)))))
(+
(+ t_2 (- t_3 (sqrt t)))
(+ (* 0.5 (sqrt (/ 1.0 x))) (/ 1.0 (+ (sqrt y) t_1)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double t_3 = sqrt((1.0 + t));
double tmp;
if (x <= 59000000.0) {
tmp = ((sqrt((1.0 + x)) - sqrt(x)) + (t_1 - sqrt(y))) + (t_2 + (1.0 / (t_3 + sqrt(t))));
} else {
tmp = (t_2 + (t_3 - sqrt(t))) + ((0.5 * sqrt((1.0 / x))) + (1.0 / (sqrt(y) + t_1)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
t_3 = sqrt((1.0d0 + t))
if (x <= 59000000.0d0) then
tmp = ((sqrt((1.0d0 + x)) - sqrt(x)) + (t_1 - sqrt(y))) + (t_2 + (1.0d0 / (t_3 + sqrt(t))))
else
tmp = (t_2 + (t_3 - sqrt(t))) + ((0.5d0 * sqrt((1.0d0 / x))) + (1.0d0 / (sqrt(y) + t_1)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + t));
double tmp;
if (x <= 59000000.0) {
tmp = ((Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (t_1 - Math.sqrt(y))) + (t_2 + (1.0 / (t_3 + Math.sqrt(t))));
} else {
tmp = (t_2 + (t_3 - Math.sqrt(t))) + ((0.5 * Math.sqrt((1.0 / x))) + (1.0 / (Math.sqrt(y) + t_1)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) t_3 = math.sqrt((1.0 + t)) tmp = 0 if x <= 59000000.0: tmp = ((math.sqrt((1.0 + x)) - math.sqrt(x)) + (t_1 - math.sqrt(y))) + (t_2 + (1.0 / (t_3 + math.sqrt(t)))) else: tmp = (t_2 + (t_3 - math.sqrt(t))) + ((0.5 * math.sqrt((1.0 / x))) + (1.0 / (math.sqrt(y) + t_1))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_3 = sqrt(Float64(1.0 + t)) tmp = 0.0 if (x <= 59000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(t_1 - sqrt(y))) + Float64(t_2 + Float64(1.0 / Float64(t_3 + sqrt(t))))); else tmp = Float64(Float64(t_2 + Float64(t_3 - sqrt(t))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(1.0 / Float64(sqrt(y) + t_1)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = sqrt((1.0 + z)) - sqrt(z);
t_3 = sqrt((1.0 + t));
tmp = 0.0;
if (x <= 59000000.0)
tmp = ((sqrt((1.0 + x)) - sqrt(x)) + (t_1 - sqrt(y))) + (t_2 + (1.0 / (t_3 + sqrt(t))));
else
tmp = (t_2 + (t_3 - sqrt(t))) + ((0.5 * sqrt((1.0 / x))) + (1.0 / (sqrt(y) + t_1)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 59000000.0], N[(N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(t$95$3 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 + N[(t$95$3 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
t_3 := \sqrt{1 + t}\\
\mathbf{if}\;x \leq 59000000:\\
\;\;\;\;\left(\left(\sqrt{1 + x} - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\right) + \left(t\_2 + \frac{1}{t\_3 + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 + \left(t\_3 - \sqrt{t}\right)\right) + \left(0.5 \cdot \sqrt{\frac{1}{x}} + \frac{1}{\sqrt{y} + t\_1}\right)\\
\end{array}
\end{array}
if x < 5.9e7Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
flip--96.9%
div-inv96.9%
add-sqr-sqrt69.7%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
associate-*r/97.1%
*-rgt-identity97.1%
associate--l+97.4%
+-inverses97.4%
metadata-eval97.4%
Simplified97.4%
if 5.9e7 < x Initial program 83.5%
associate-+l+83.5%
sub-neg83.5%
sub-neg83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
Simplified83.5%
flip--83.7%
flip--83.7%
frac-add83.7%
Applied egg-rr84.3%
Simplified86.4%
Taylor expanded in x around inf 91.9%
Final simplification95.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 t)))
(t_2 (sqrt (+ y 1.0)))
(t_3 (/ 1.0 (+ (sqrt y) t_2)))
(t_4 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= x 2.6e-109)
(+ (+ t_4 (/ 1.0 (+ t_1 (sqrt t)))) (+ (- t_2 (sqrt y)) (- 1.0 (sqrt x))))
(if (<= x 21000000.0)
(+
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) t_3)
(+ t_4 (* 0.5 (sqrt (/ 1.0 t)))))
(+ (+ t_4 (- t_1 (sqrt t))) (+ (* 0.5 (sqrt (/ 1.0 x))) t_3))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t));
double t_2 = sqrt((y + 1.0));
double t_3 = 1.0 / (sqrt(y) + t_2);
double t_4 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (x <= 2.6e-109) {
tmp = (t_4 + (1.0 / (t_1 + sqrt(t)))) + ((t_2 - sqrt(y)) + (1.0 - sqrt(x)));
} else if (x <= 21000000.0) {
tmp = ((sqrt((1.0 + x)) - sqrt(x)) + t_3) + (t_4 + (0.5 * sqrt((1.0 / t))));
} else {
tmp = (t_4 + (t_1 - sqrt(t))) + ((0.5 * sqrt((1.0 / 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) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + t))
t_2 = sqrt((y + 1.0d0))
t_3 = 1.0d0 / (sqrt(y) + t_2)
t_4 = sqrt((1.0d0 + z)) - sqrt(z)
if (x <= 2.6d-109) then
tmp = (t_4 + (1.0d0 / (t_1 + sqrt(t)))) + ((t_2 - sqrt(y)) + (1.0d0 - sqrt(x)))
else if (x <= 21000000.0d0) then
tmp = ((sqrt((1.0d0 + x)) - sqrt(x)) + t_3) + (t_4 + (0.5d0 * sqrt((1.0d0 / t))))
else
tmp = (t_4 + (t_1 - sqrt(t))) + ((0.5d0 * sqrt((1.0d0 / 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((1.0 + t));
double t_2 = Math.sqrt((y + 1.0));
double t_3 = 1.0 / (Math.sqrt(y) + t_2);
double t_4 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (x <= 2.6e-109) {
tmp = (t_4 + (1.0 / (t_1 + Math.sqrt(t)))) + ((t_2 - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else if (x <= 21000000.0) {
tmp = ((Math.sqrt((1.0 + x)) - Math.sqrt(x)) + t_3) + (t_4 + (0.5 * Math.sqrt((1.0 / t))));
} else {
tmp = (t_4 + (t_1 - Math.sqrt(t))) + ((0.5 * Math.sqrt((1.0 / x))) + t_3);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) t_2 = math.sqrt((y + 1.0)) t_3 = 1.0 / (math.sqrt(y) + t_2) t_4 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if x <= 2.6e-109: tmp = (t_4 + (1.0 / (t_1 + math.sqrt(t)))) + ((t_2 - math.sqrt(y)) + (1.0 - math.sqrt(x))) elif x <= 21000000.0: tmp = ((math.sqrt((1.0 + x)) - math.sqrt(x)) + t_3) + (t_4 + (0.5 * math.sqrt((1.0 / t)))) else: tmp = (t_4 + (t_1 - math.sqrt(t))) + ((0.5 * math.sqrt((1.0 / x))) + t_3) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + t)) t_2 = sqrt(Float64(y + 1.0)) t_3 = Float64(1.0 / Float64(sqrt(y) + t_2)) t_4 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (x <= 2.6e-109) tmp = Float64(Float64(t_4 + Float64(1.0 / Float64(t_1 + sqrt(t)))) + Float64(Float64(t_2 - sqrt(y)) + Float64(1.0 - sqrt(x)))); elseif (x <= 21000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + t_3) + Float64(t_4 + Float64(0.5 * sqrt(Float64(1.0 / t))))); else tmp = Float64(Float64(t_4 + Float64(t_1 - sqrt(t))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / 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((1.0 + t));
t_2 = sqrt((y + 1.0));
t_3 = 1.0 / (sqrt(y) + t_2);
t_4 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (x <= 2.6e-109)
tmp = (t_4 + (1.0 / (t_1 + sqrt(t)))) + ((t_2 - sqrt(y)) + (1.0 - sqrt(x)));
elseif (x <= 21000000.0)
tmp = ((sqrt((1.0 + x)) - sqrt(x)) + t_3) + (t_4 + (0.5 * sqrt((1.0 / t))));
else
tmp = (t_4 + (t_1 - sqrt(t))) + ((0.5 * sqrt((1.0 / 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[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2.6e-109], N[(N[(t$95$4 + N[(1.0 / N[(t$95$1 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 21000000.0], N[(N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(t$95$4 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$4 + N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $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{1 + t}\\
t_2 := \sqrt{y + 1}\\
t_3 := \frac{1}{\sqrt{y} + t\_2}\\
t_4 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;x \leq 2.6 \cdot 10^{-109}:\\
\;\;\;\;\left(t\_4 + \frac{1}{t\_1 + \sqrt{t}}\right) + \left(\left(t\_2 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{elif}\;x \leq 21000000:\\
\;\;\;\;\left(\left(\sqrt{1 + x} - \sqrt{x}\right) + t\_3\right) + \left(t\_4 + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_4 + \left(t\_1 - \sqrt{t}\right)\right) + \left(0.5 \cdot \sqrt{\frac{1}{x}} + t\_3\right)\\
\end{array}
\end{array}
if x < 2.5999999999999998e-109Initial program 96.6%
associate-+l+96.6%
sub-neg96.6%
sub-neg96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 96.6%
flip--96.9%
div-inv96.9%
add-sqr-sqrt74.4%
add-sqr-sqrt97.2%
Applied egg-rr97.2%
associate-*r/97.2%
*-rgt-identity97.2%
associate--l+97.7%
+-inverses97.7%
metadata-eval97.7%
Simplified97.7%
if 2.5999999999999998e-109 < x < 2.1e7Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
flip--96.7%
div-inv96.7%
add-sqr-sqrt71.0%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
associate-*r/97.3%
*-rgt-identity97.3%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in t around inf 58.5%
if 2.1e7 < x Initial program 83.5%
associate-+l+83.5%
sub-neg83.5%
sub-neg83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
Simplified83.5%
flip--83.7%
flip--83.7%
frac-add83.7%
Applied egg-rr84.3%
Simplified86.4%
Taylor expanded in x around inf 91.9%
Final simplification88.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 t)) (sqrt t))))
(if (<= y 1.66e+24)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) t_1)
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0)))) (- 1.0 (sqrt x))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ t_1 (* 0.5 (sqrt (/ 1.0 z))))))))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 tmp;
if (y <= 1.66e+24) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + t_1) + ((1.0 / (sqrt(y) + sqrt((y + 1.0)))) + (1.0 - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 + (0.5 * sqrt((1.0 / z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 1.66d+24) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + t_1) + ((1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))) + (1.0d0 - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (t_1 + (0.5d0 * sqrt((1.0d0 / z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 1.66e+24) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + t_1) + ((1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)))) + (1.0 - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (t_1 + (0.5 * Math.sqrt((1.0 / z))));
}
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) tmp = 0 if y <= 1.66e+24: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + t_1) + ((1.0 / (math.sqrt(y) + math.sqrt((y + 1.0)))) + (1.0 - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_1 + (0.5 * math.sqrt((1.0 / z)))) 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)) tmp = 0.0 if (y <= 1.66e+24) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + t_1) + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 1.66e+24)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + t_1) + ((1.0 / (sqrt(y) + sqrt((y + 1.0)))) + (1.0 - sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 + (0.5 * sqrt((1.0 / z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.66e+24], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 1.66 \cdot 10^{+24}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + t\_1\right) + \left(\frac{1}{\sqrt{y} + \sqrt{y + 1}} + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if y < 1.65999999999999991e24Initial program 95.7%
associate-+l+95.7%
sub-neg95.7%
sub-neg95.7%
+-commutative95.7%
+-commutative95.7%
+-commutative95.7%
Simplified95.7%
Taylor expanded in x around 0 55.8%
flip--95.6%
div-inv95.6%
add-sqr-sqrt95.7%
add-sqr-sqrt96.2%
Applied egg-rr56.1%
associate-*r/96.2%
*-rgt-identity96.2%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
Simplified56.7%
if 1.65999999999999991e24 < y Initial program 85.6%
associate-+l+85.6%
sub-neg85.6%
sub-neg85.6%
+-commutative85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
flip--85.6%
flip--85.6%
frac-add85.6%
Applied egg-rr85.9%
Simplified87.2%
Taylor expanded in y around inf 90.7%
Taylor expanded in z around inf 44.2%
Final simplification50.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 t))))
(if (<= y 1.5e+24)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (/ 1.0 (+ t_1 (sqrt t))))
(+ (- (sqrt (+ y 1.0)) (sqrt y)) (- 1.0 (sqrt x))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ (- t_1 (sqrt t)) (* 0.5 (sqrt (/ 1.0 z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t));
double tmp;
if (y <= 1.5e+24) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 / (t_1 + sqrt(t)))) + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((t_1 - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + t))
if (y <= 1.5d+24) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 / (t_1 + sqrt(t)))) + ((sqrt((y + 1.0d0)) - sqrt(y)) + (1.0d0 - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + ((t_1 - sqrt(t)) + (0.5d0 * sqrt((1.0d0 / z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t));
double tmp;
if (y <= 1.5e+24) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 / (t_1 + Math.sqrt(t)))) + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((t_1 - Math.sqrt(t)) + (0.5 * Math.sqrt((1.0 / z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) tmp = 0 if y <= 1.5e+24: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 / (t_1 + math.sqrt(t)))) + ((math.sqrt((y + 1.0)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((t_1 - math.sqrt(t)) + (0.5 * math.sqrt((1.0 / z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + t)) tmp = 0.0 if (y <= 1.5e+24) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 / Float64(t_1 + sqrt(t)))) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(t_1 - sqrt(t)) + Float64(0.5 * sqrt(Float64(1.0 / z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t));
tmp = 0.0;
if (y <= 1.5e+24)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 / (t_1 + sqrt(t)))) + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((t_1 - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.5e+24], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t}\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{+24}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1}{t\_1 + \sqrt{t}}\right) + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\left(t\_1 - \sqrt{t}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if y < 1.49999999999999997e24Initial program 95.7%
associate-+l+95.7%
sub-neg95.7%
sub-neg95.7%
+-commutative95.7%
+-commutative95.7%
+-commutative95.7%
Simplified95.7%
Taylor expanded in x around 0 55.8%
flip--95.7%
div-inv95.7%
add-sqr-sqrt74.0%
add-sqr-sqrt95.7%
Applied egg-rr55.8%
associate-*r/95.7%
*-rgt-identity95.7%
associate--l+96.1%
+-inverses96.1%
metadata-eval96.1%
Simplified55.9%
if 1.49999999999999997e24 < y Initial program 85.6%
associate-+l+85.6%
sub-neg85.6%
sub-neg85.6%
+-commutative85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
flip--85.6%
flip--85.6%
frac-add85.6%
Applied egg-rr85.9%
Simplified87.2%
Taylor expanded in y around inf 90.7%
Taylor expanded in z around inf 44.2%
Final simplification50.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= y 1.5e+24)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) t_1)
(- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ t_1 (* 0.5 (sqrt (/ 1.0 z))))))))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 tmp;
if (y <= 1.5e+24) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + t_1) + ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 + (0.5 * sqrt((1.0 / z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 1.5d+24) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + t_1) + ((1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (t_1 + (0.5d0 * sqrt((1.0d0 / z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 1.5e+24) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + t_1) + ((1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (t_1 + (0.5 * Math.sqrt((1.0 / z))));
}
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) tmp = 0 if y <= 1.5e+24: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + t_1) + ((1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_1 + (0.5 * math.sqrt((1.0 / z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (y <= 1.5e+24) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + t_1) + Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 1.5e+24)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + t_1) + ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 + (0.5 * sqrt((1.0 / z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.5e+24], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{+24}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + t\_1\right) + \left(\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if y < 1.49999999999999997e24Initial program 95.7%
associate-+l+95.7%
sub-neg95.7%
sub-neg95.7%
+-commutative95.7%
+-commutative95.7%
+-commutative95.7%
Simplified95.7%
Taylor expanded in x around 0 55.8%
if 1.49999999999999997e24 < y Initial program 85.6%
associate-+l+85.6%
sub-neg85.6%
sub-neg85.6%
+-commutative85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
flip--85.6%
flip--85.6%
frac-add85.6%
Applied egg-rr85.9%
Simplified87.2%
Taylor expanded in y around inf 90.7%
Taylor expanded in z around inf 44.2%
Final simplification50.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= y 1.5e+24)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) t_1)
(+ (- (sqrt (+ y 1.0)) (sqrt y)) (- 1.0 (sqrt x))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ t_1 (* 0.5 (sqrt (/ 1.0 z))))))))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 tmp;
if (y <= 1.5e+24) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + t_1) + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 + (0.5 * sqrt((1.0 / z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 1.5d+24) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + t_1) + ((sqrt((y + 1.0d0)) - sqrt(y)) + (1.0d0 - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (t_1 + (0.5d0 * sqrt((1.0d0 / z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 1.5e+24) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + t_1) + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (t_1 + (0.5 * Math.sqrt((1.0 / z))));
}
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) tmp = 0 if y <= 1.5e+24: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + t_1) + ((math.sqrt((y + 1.0)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_1 + (0.5 * math.sqrt((1.0 / z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (y <= 1.5e+24) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + t_1) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 1.5e+24)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + t_1) + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 + (0.5 * sqrt((1.0 / z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.5e+24], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{+24}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + t\_1\right) + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if y < 1.49999999999999997e24Initial program 95.7%
associate-+l+95.7%
sub-neg95.7%
sub-neg95.7%
+-commutative95.7%
+-commutative95.7%
+-commutative95.7%
Simplified95.7%
Taylor expanded in x around 0 55.8%
if 1.49999999999999997e24 < y Initial program 85.6%
associate-+l+85.6%
sub-neg85.6%
sub-neg85.6%
+-commutative85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
flip--85.6%
flip--85.6%
frac-add85.6%
Applied egg-rr85.9%
Simplified87.2%
Taylor expanded in y around inf 90.7%
Taylor expanded in z around inf 44.2%
Final simplification50.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 5e-80)
(+ (+ t_2 t_1) (- 2.0 (+ (sqrt y) (sqrt x))))
(if (<= y 1.66e+24)
(+
(+ t_2 (* 0.5 (sqrt (/ 1.0 t))))
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0)))) (- 1.0 (sqrt x))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ t_1 (* 0.5 (sqrt (/ 1.0 z)))))))))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)) - sqrt(z);
double tmp;
if (y <= 5e-80) {
tmp = (t_2 + t_1) + (2.0 - (sqrt(y) + sqrt(x)));
} else if (y <= 1.66e+24) {
tmp = (t_2 + (0.5 * sqrt((1.0 / t)))) + ((1.0 / (sqrt(y) + sqrt((y + 1.0)))) + (1.0 - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 + (0.5 * sqrt((1.0 / z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 5d-80) then
tmp = (t_2 + t_1) + (2.0d0 - (sqrt(y) + sqrt(x)))
else if (y <= 1.66d+24) then
tmp = (t_2 + (0.5d0 * sqrt((1.0d0 / t)))) + ((1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))) + (1.0d0 - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (t_1 + (0.5d0 * sqrt((1.0d0 / z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 5e-80) {
tmp = (t_2 + t_1) + (2.0 - (Math.sqrt(y) + Math.sqrt(x)));
} else if (y <= 1.66e+24) {
tmp = (t_2 + (0.5 * Math.sqrt((1.0 / t)))) + ((1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)))) + (1.0 - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (t_1 + (0.5 * Math.sqrt((1.0 / z))));
}
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)) - math.sqrt(z) tmp = 0 if y <= 5e-80: tmp = (t_2 + t_1) + (2.0 - (math.sqrt(y) + math.sqrt(x))) elif y <= 1.66e+24: tmp = (t_2 + (0.5 * math.sqrt((1.0 / t)))) + ((1.0 / (math.sqrt(y) + math.sqrt((y + 1.0)))) + (1.0 - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_1 + (0.5 * math.sqrt((1.0 / z)))) 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(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 5e-80) tmp = Float64(Float64(t_2 + t_1) + Float64(2.0 - Float64(sqrt(y) + sqrt(x)))); elseif (y <= 1.66e+24) tmp = Float64(Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / t)))) + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 5e-80)
tmp = (t_2 + t_1) + (2.0 - (sqrt(y) + sqrt(x)));
elseif (y <= 1.66e+24)
tmp = (t_2 + (0.5 * sqrt((1.0 / t)))) + ((1.0 / (sqrt(y) + sqrt((y + 1.0)))) + (1.0 - sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 + (0.5 * sqrt((1.0 / z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5e-80], N[(N[(t$95$2 + t$95$1), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.66e+24], N[(N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 5 \cdot 10^{-80}:\\
\;\;\;\;\left(t\_2 + t\_1\right) + \left(2 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{+24}:\\
\;\;\;\;\left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{t}}\right) + \left(\frac{1}{\sqrt{y} + \sqrt{y + 1}} + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if y < 5e-80Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 58.4%
Taylor expanded in y around 0 58.4%
if 5e-80 < y < 1.65999999999999991e24Initial program 89.7%
associate-+l+89.7%
sub-neg89.7%
sub-neg89.7%
+-commutative89.7%
+-commutative89.7%
+-commutative89.7%
Simplified89.7%
Taylor expanded in x around 0 47.2%
Taylor expanded in t around inf 24.8%
flip--89.5%
div-inv89.5%
add-sqr-sqrt90.0%
add-sqr-sqrt92.0%
Applied egg-rr25.2%
associate-*r/92.0%
*-rgt-identity92.0%
associate--l+97.8%
+-inverses97.8%
metadata-eval97.8%
Simplified27.0%
if 1.65999999999999991e24 < y Initial program 85.6%
associate-+l+85.6%
sub-neg85.6%
sub-neg85.6%
+-commutative85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
flip--85.6%
flip--85.6%
frac-add85.6%
Applied egg-rr85.9%
Simplified87.2%
Taylor expanded in y around inf 90.7%
Taylor expanded in z around inf 44.2%
Final simplification47.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 t)) (sqrt t)))
(t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 1e-18)
(+ (+ t_2 t_1) (- 2.0 (+ (sqrt y) (sqrt x))))
(if (<= y 1.66e+24)
(+
t_2
(-
(+ 1.0 (+ (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0)))) (* x 0.5)))
(sqrt x)))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ t_1 (* 0.5 (sqrt (/ 1.0 z)))))))))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)) - sqrt(z);
double tmp;
if (y <= 1e-18) {
tmp = (t_2 + t_1) + (2.0 - (sqrt(y) + sqrt(x)));
} else if (y <= 1.66e+24) {
tmp = t_2 + ((1.0 + ((1.0 / (sqrt(y) + sqrt((y + 1.0)))) + (x * 0.5))) - sqrt(x));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 + (0.5 * sqrt((1.0 / z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 1d-18) then
tmp = (t_2 + t_1) + (2.0d0 - (sqrt(y) + sqrt(x)))
else if (y <= 1.66d+24) then
tmp = t_2 + ((1.0d0 + ((1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))) + (x * 0.5d0))) - sqrt(x))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (t_1 + (0.5d0 * sqrt((1.0d0 / z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 1e-18) {
tmp = (t_2 + t_1) + (2.0 - (Math.sqrt(y) + Math.sqrt(x)));
} else if (y <= 1.66e+24) {
tmp = t_2 + ((1.0 + ((1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)))) + (x * 0.5))) - Math.sqrt(x));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (t_1 + (0.5 * Math.sqrt((1.0 / z))));
}
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)) - math.sqrt(z) tmp = 0 if y <= 1e-18: tmp = (t_2 + t_1) + (2.0 - (math.sqrt(y) + math.sqrt(x))) elif y <= 1.66e+24: tmp = t_2 + ((1.0 + ((1.0 / (math.sqrt(y) + math.sqrt((y + 1.0)))) + (x * 0.5))) - math.sqrt(x)) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_1 + (0.5 * math.sqrt((1.0 / z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 1e-18) tmp = Float64(Float64(t_2 + t_1) + Float64(2.0 - Float64(sqrt(y) + sqrt(x)))); elseif (y <= 1.66e+24) tmp = Float64(t_2 + Float64(Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))) + Float64(x * 0.5))) - sqrt(x))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 1e-18)
tmp = (t_2 + t_1) + (2.0 - (sqrt(y) + sqrt(x)));
elseif (y <= 1.66e+24)
tmp = t_2 + ((1.0 + ((1.0 / (sqrt(y) + sqrt((y + 1.0)))) + (x * 0.5))) - sqrt(x));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 + (0.5 * sqrt((1.0 / z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1e-18], N[(N[(t$95$2 + t$95$1), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.66e+24], N[(t$95$2 + N[(N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 10^{-18}:\\
\;\;\;\;\left(t\_2 + t\_1\right) + \left(2 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{+24}:\\
\;\;\;\;t\_2 + \left(\left(1 + \left(\frac{1}{\sqrt{y} + \sqrt{y + 1}} + x \cdot 0.5\right)\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if y < 1.0000000000000001e-18Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 56.1%
Taylor expanded in y around 0 56.1%
if 1.0000000000000001e-18 < y < 1.65999999999999991e24Initial program 79.1%
associate-+l+79.1%
sub-neg79.1%
sub-neg79.1%
+-commutative79.1%
+-commutative79.1%
+-commutative79.1%
Simplified79.1%
flip--78.7%
div-inv78.7%
add-sqr-sqrt79.8%
add-sqr-sqrt84.2%
Applied egg-rr84.2%
associate-*r/84.2%
*-rgt-identity84.2%
associate--l+97.1%
+-inverses97.1%
metadata-eval97.1%
Simplified97.1%
Taylor expanded in x around 0 63.4%
Taylor expanded in t around inf 42.9%
if 1.65999999999999991e24 < y Initial program 85.6%
associate-+l+85.6%
sub-neg85.6%
sub-neg85.6%
+-commutative85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
flip--85.6%
flip--85.6%
frac-add85.6%
Applied egg-rr85.9%
Simplified87.2%
Taylor expanded in y around inf 90.7%
Taylor expanded in z around inf 44.2%
Final simplification49.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 2.45e-8)
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(- (+ 1.0 (+ (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0)))) (* x 0.5))) (sqrt x)))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (* 0.5 (sqrt (/ 1.0 z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.45e-8) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 + ((1.0 / (sqrt(y) + sqrt((y + 1.0)))) + (x * 0.5))) - sqrt(x));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 2.45d-8) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 + ((1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))) + (x * 0.5d0))) - sqrt(x))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (0.5d0 * sqrt((1.0d0 / z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.45e-8) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 + ((1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)))) + (x * 0.5))) - Math.sqrt(x));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (0.5 * Math.sqrt((1.0 / z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 2.45e-8: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 + ((1.0 / (math.sqrt(y) + math.sqrt((y + 1.0)))) + (x * 0.5))) - math.sqrt(x)) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (0.5 * math.sqrt((1.0 / z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 2.45e-8) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))) + Float64(x * 0.5))) - sqrt(x))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(0.5 * sqrt(Float64(1.0 / z))))); 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 <= 2.45e-8)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 + ((1.0 / (sqrt(y) + sqrt((y + 1.0)))) + (x * 0.5))) - sqrt(x));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 2.45e-8], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.45 \cdot 10^{-8}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(1 + \left(\frac{1}{\sqrt{y} + \sqrt{y + 1}} + x \cdot 0.5\right)\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if x < 2.4500000000000001e-8Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
flip--96.7%
div-inv96.7%
add-sqr-sqrt78.9%
add-sqr-sqrt97.0%
Applied egg-rr97.0%
associate-*r/97.0%
*-rgt-identity97.0%
associate--l+97.9%
+-inverses97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in x around 0 97.9%
Taylor expanded in t around inf 60.0%
if 2.4500000000000001e-8 < x Initial program 84.0%
associate-+l+84.0%
sub-neg84.0%
sub-neg84.0%
+-commutative84.0%
+-commutative84.0%
+-commutative84.0%
Simplified84.0%
flip--84.2%
flip--84.2%
frac-add84.2%
Applied egg-rr85.0%
Simplified86.9%
Taylor expanded in y around inf 53.6%
Taylor expanded in z around inf 23.0%
Final simplification42.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 (<= y 1.32e+17)
(+
(+ (- (sqrt (+ y 1.0)) (sqrt y)) (- 1.0 (sqrt x)))
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (* 0.5 (sqrt (/ 1.0 z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.32e+17) {
tmp = ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.32d+17) then
tmp = ((sqrt((y + 1.0d0)) - sqrt(y)) + (1.0d0 - sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (0.5d0 * sqrt((1.0d0 / z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.32e+17) {
tmp = ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (0.5 * Math.sqrt((1.0 / z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.32e+17: tmp = ((math.sqrt((y + 1.0)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (0.5 * math.sqrt((1.0 / z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.32e+17) tmp = Float64(Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(0.5 * sqrt(Float64(1.0 / z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.32e+17)
tmp = ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.32e+17], N[(N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.32 \cdot 10^{+17}:\\
\;\;\;\;\left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if y < 1.32e17Initial program 97.0%
associate-+l+97.0%
sub-neg97.0%
sub-neg97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 55.8%
flip--56.2%
div-inv56.2%
add-sqr-sqrt46.4%
add-sqr-sqrt56.4%
Applied egg-rr56.4%
associate-*r/56.4%
*-rgt-identity56.4%
associate--l+56.5%
+-inverses56.5%
metadata-eval56.5%
Simplified56.5%
Taylor expanded in t around inf 33.3%
+-commutative33.3%
Simplified33.3%
if 1.32e17 < y Initial program 84.6%
associate-+l+84.6%
sub-neg84.6%
sub-neg84.6%
+-commutative84.6%
+-commutative84.6%
+-commutative84.6%
Simplified84.6%
flip--84.6%
flip--84.6%
frac-add84.6%
Applied egg-rr84.9%
Simplified87.6%
Taylor expanded in y around inf 89.6%
Taylor expanded in z around inf 44.0%
Final simplification38.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= x 0.49)
(+
(+ (- (sqrt (+ y 1.0)) (sqrt y)) (- 1.0 (sqrt x)))
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(* -0.5 (- (fabs (pow x -0.5))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.49) {
tmp = ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
} else {
tmp = -0.5 * -fabs(pow(x, -0.5));
}
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.49d0) then
tmp = ((sqrt((y + 1.0d0)) - sqrt(y)) + (1.0d0 - sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))
else
tmp = (-0.5d0) * -abs((x ** (-0.5d0)))
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.49) {
tmp = ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)));
} else {
tmp = -0.5 * -Math.abs(Math.pow(x, -0.5));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.49: tmp = ((math.sqrt((y + 1.0)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) else: tmp = -0.5 * -math.fabs(math.pow(x, -0.5)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.49) tmp = Float64(Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))); else tmp = Float64(-0.5 * Float64(-abs((x ^ -0.5)))); 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.49)
tmp = ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
else
tmp = -0.5 * -abs((x ^ -0.5));
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.49], N[(N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * (-N[Abs[N[Power[x, -0.5], $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.49:\\
\;\;\;\;\left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(-\left|{x}^{-0.5}\right|\right)\\
\end{array}
\end{array}
if x < 0.48999999999999999Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in x around 0 95.1%
flip--95.4%
div-inv95.4%
add-sqr-sqrt73.6%
add-sqr-sqrt95.6%
Applied egg-rr95.6%
associate-*r/95.6%
*-rgt-identity95.6%
associate--l+96.1%
+-inverses96.1%
metadata-eval96.1%
Simplified96.1%
Taylor expanded in t around inf 58.8%
+-commutative58.8%
Simplified58.8%
if 0.48999999999999999 < x Initial program 83.7%
associate-+l+83.7%
sub-neg83.7%
sub-neg83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
Taylor expanded in t around inf 4.5%
associate--l+6.0%
Simplified6.0%
Taylor expanded in x around inf 3.7%
neg-mul-13.7%
Simplified3.7%
Taylor expanded in x around inf 11.3%
Taylor expanded in x around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt11.3%
neg-mul-111.3%
unpow-111.3%
metadata-eval11.3%
pow-sqr11.3%
rem-sqrt-square11.3%
Simplified11.3%
Final simplification36.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 1.1e+22) (- (+ 2.0 (hypot 1.0 (sqrt z))) (+ (sqrt y) (+ (sqrt x) (sqrt z)))) (+ (sqrt (+ 1.0 x)) (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.1e+22) {
tmp = (2.0 + hypot(1.0, sqrt(z))) - (sqrt(y) + (sqrt(x) + sqrt(z)));
} else {
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.1e+22) {
tmp = (2.0 + Math.hypot(1.0, Math.sqrt(z))) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z)));
} else {
tmp = Math.sqrt((1.0 + x)) + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.1e+22: tmp = (2.0 + math.hypot(1.0, math.sqrt(z))) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z))) else: tmp = math.sqrt((1.0 + x)) + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.1e+22) tmp = Float64(Float64(2.0 + hypot(1.0, sqrt(z))) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z)))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.1e+22)
tmp = (2.0 + hypot(1.0, sqrt(z))) - (sqrt(y) + (sqrt(x) + sqrt(z)));
else
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.1e+22], N[(N[(2.0 + N[Sqrt[1.0 ^ 2 + N[Sqrt[z], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.1 \cdot 10^{+22}:\\
\;\;\;\;\left(2 + \mathsf{hypot}\left(1, \sqrt{z}\right)\right) - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 1.1e22Initial program 96.3%
associate-+l+96.3%
sub-neg96.3%
sub-neg96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in t around inf 22.0%
associate--l+25.6%
Simplified25.6%
Taylor expanded in y around 0 19.1%
+-commutative19.1%
associate-+r+19.1%
+-commutative19.1%
associate-+l+19.1%
Simplified19.1%
Taylor expanded in x around 0 17.1%
+-commutative17.1%
metadata-eval17.1%
rem-square-sqrt17.1%
hypot-undefine17.1%
associate-+r+17.1%
+-commutative17.1%
associate-+r+17.1%
Simplified17.1%
if 1.1e22 < z Initial program 82.3%
associate-+l+82.3%
sub-neg82.3%
sub-neg82.3%
+-commutative82.3%
+-commutative82.3%
+-commutative82.3%
Simplified82.3%
Taylor expanded in t around inf 3.3%
associate--l+25.0%
Simplified25.0%
Taylor expanded in z around inf 20.3%
associate--l+35.7%
Simplified35.7%
Final simplification24.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 7.2e+20) (- (+ 2.0 (sqrt (+ 1.0 z))) (+ (sqrt y) (+ (sqrt x) (sqrt z)))) (+ (sqrt (+ 1.0 x)) (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 7.2e+20) {
tmp = (2.0 + sqrt((1.0 + z))) - (sqrt(y) + (sqrt(x) + sqrt(z)));
} else {
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 7.2d+20) then
tmp = (2.0d0 + sqrt((1.0d0 + z))) - (sqrt(y) + (sqrt(x) + sqrt(z)))
else
tmp = sqrt((1.0d0 + x)) + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 7.2e+20) {
tmp = (2.0 + Math.sqrt((1.0 + z))) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z)));
} else {
tmp = Math.sqrt((1.0 + x)) + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 7.2e+20: tmp = (2.0 + math.sqrt((1.0 + z))) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z))) else: tmp = math.sqrt((1.0 + x)) + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 7.2e+20) tmp = Float64(Float64(2.0 + sqrt(Float64(1.0 + z))) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z)))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 7.2e+20)
tmp = (2.0 + sqrt((1.0 + z))) - (sqrt(y) + (sqrt(x) + sqrt(z)));
else
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 7.2e+20], N[(N[(2.0 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.2 \cdot 10^{+20}:\\
\;\;\;\;\left(2 + \sqrt{1 + z}\right) - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 7.2e20Initial program 96.3%
associate-+l+96.3%
sub-neg96.3%
sub-neg96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in t around inf 22.0%
associate--l+25.6%
Simplified25.6%
Taylor expanded in y around 0 19.1%
+-commutative19.1%
associate-+r+19.1%
+-commutative19.1%
associate-+l+19.1%
Simplified19.1%
Taylor expanded in x around 0 17.1%
+-commutative17.1%
associate-+r+17.1%
+-commutative17.1%
associate-+r+17.1%
Simplified17.1%
if 7.2e20 < z Initial program 82.3%
associate-+l+82.3%
sub-neg82.3%
sub-neg82.3%
+-commutative82.3%
+-commutative82.3%
+-commutative82.3%
Simplified82.3%
Taylor expanded in t around inf 3.3%
associate--l+25.0%
Simplified25.0%
Taylor expanded in z around inf 20.3%
associate--l+35.7%
Simplified35.7%
Final simplification24.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 1.06)
(+
2.0
(-
(+ (+ 1.0 (* z (+ 0.5 (* z (- (* z 0.0625) 0.125))))) (* x 0.5))
(+ (sqrt y) (+ (sqrt x) (sqrt z)))))
(+ (sqrt (+ 1.0 x)) (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.06) {
tmp = 2.0 + (((1.0 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + (x * 0.5)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
} else {
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.06d0) then
tmp = 2.0d0 + (((1.0d0 + (z * (0.5d0 + (z * ((z * 0.0625d0) - 0.125d0))))) + (x * 0.5d0)) - (sqrt(y) + (sqrt(x) + sqrt(z))))
else
tmp = sqrt((1.0d0 + x)) + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.06) {
tmp = 2.0 + (((1.0 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + (x * 0.5)) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z))));
} else {
tmp = Math.sqrt((1.0 + x)) + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.06: tmp = 2.0 + (((1.0 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + (x * 0.5)) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z)))) else: tmp = math.sqrt((1.0 + x)) + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.06) tmp = Float64(2.0 + Float64(Float64(Float64(1.0 + Float64(z * Float64(0.5 + Float64(z * Float64(Float64(z * 0.0625) - 0.125))))) + Float64(x * 0.5)) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z))))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.06)
tmp = 2.0 + (((1.0 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + (x * 0.5)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
else
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.06], N[(2.0 + N[(N[(N[(1.0 + N[(z * N[(0.5 + N[(z * N[(N[(z * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.06:\\
\;\;\;\;2 + \left(\left(\left(1 + z \cdot \left(0.5 + z \cdot \left(z \cdot 0.0625 - 0.125\right)\right)\right) + x \cdot 0.5\right) - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 1.0600000000000001Initial 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.7%
associate--l+26.0%
Simplified26.0%
Taylor expanded in y around 0 19.7%
+-commutative19.7%
associate-+r+19.7%
+-commutative19.7%
associate-+l+19.7%
Simplified19.7%
Taylor expanded in x around 0 19.3%
associate--l+19.3%
*-commutative19.3%
associate-+r+19.3%
+-commutative19.3%
associate-+r+19.3%
Simplified19.3%
Taylor expanded in z around 0 19.3%
if 1.0600000000000001 < z Initial program 81.8%
associate-+l+81.8%
sub-neg81.8%
sub-neg81.8%
+-commutative81.8%
+-commutative81.8%
+-commutative81.8%
Simplified81.8%
Taylor expanded in t around inf 3.9%
associate--l+24.5%
Simplified24.5%
Taylor expanded in z around inf 19.6%
associate--l+34.4%
Simplified34.4%
Final simplification25.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 0.95)
(+
2.0
(-
(+ (+ 1.0 (* z (+ 0.5 (* z (- (* z 0.0625) 0.125))))) (* x 0.5))
(+ (sqrt y) (+ (sqrt x) (sqrt z)))))
(+ 2.0 (* 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 (z <= 0.95) {
tmp = 2.0 + (((1.0 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + (x * 0.5)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
} else {
tmp = 2.0 + (x * (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 (z <= 0.95d0) then
tmp = 2.0d0 + (((1.0d0 + (z * (0.5d0 + (z * ((z * 0.0625d0) - 0.125d0))))) + (x * 0.5d0)) - (sqrt(y) + (sqrt(x) + sqrt(z))))
else
tmp = 2.0d0 + (x * (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 (z <= 0.95) {
tmp = 2.0 + (((1.0 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + (x * 0.5)) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z))));
} else {
tmp = 2.0 + (x * (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 z <= 0.95: tmp = 2.0 + (((1.0 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + (x * 0.5)) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z)))) else: tmp = 2.0 + (x * (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 (z <= 0.95) tmp = Float64(2.0 + Float64(Float64(Float64(1.0 + Float64(z * Float64(0.5 + Float64(z * Float64(Float64(z * 0.0625) - 0.125))))) + Float64(x * 0.5)) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z))))); else tmp = Float64(2.0 + Float64(x * 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 (z <= 0.95)
tmp = 2.0 + (((1.0 + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + (x * 0.5)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
else
tmp = 2.0 + (x * (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[z, 0.95], N[(2.0 + N[(N[(N[(1.0 + N[(z * N[(0.5 + N[(z * N[(N[(z * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(x * N[(0.5 - N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.95:\\
\;\;\;\;2 + \left(\left(\left(1 + z \cdot \left(0.5 + z \cdot \left(z \cdot 0.0625 - 0.125\right)\right)\right) + x \cdot 0.5\right) - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 + x \cdot \left(0.5 - \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if z < 0.94999999999999996Initial 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.7%
associate--l+26.0%
Simplified26.0%
Taylor expanded in y around 0 19.7%
+-commutative19.7%
associate-+r+19.7%
+-commutative19.7%
associate-+l+19.7%
Simplified19.7%
Taylor expanded in x around 0 19.3%
associate--l+19.3%
*-commutative19.3%
associate-+r+19.3%
+-commutative19.3%
associate-+r+19.3%
Simplified19.3%
Taylor expanded in z around 0 19.3%
if 0.94999999999999996 < z Initial program 81.8%
associate-+l+81.8%
sub-neg81.8%
sub-neg81.8%
+-commutative81.8%
+-commutative81.8%
+-commutative81.8%
Simplified81.8%
Taylor expanded in t around inf 3.9%
associate--l+24.5%
Simplified24.5%
Taylor expanded in y around 0 3.2%
+-commutative3.2%
associate-+r+3.2%
+-commutative3.2%
associate-+l+3.2%
Simplified3.2%
Taylor expanded in x around 0 3.5%
associate--l+22.8%
*-commutative22.8%
associate-+r+22.8%
+-commutative22.8%
associate-+r+22.8%
Simplified22.8%
Taylor expanded in x around inf 32.9%
Final simplification25.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 0.5)
(+
2.0
(-
(+ (* x 0.5) (+ 1.0 (* z (+ 0.5 (* z -0.125)))))
(+ (sqrt y) (+ (sqrt x) (sqrt z)))))
(+ 2.0 (* 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 (z <= 0.5) {
tmp = 2.0 + (((x * 0.5) + (1.0 + (z * (0.5 + (z * -0.125))))) - (sqrt(y) + (sqrt(x) + sqrt(z))));
} else {
tmp = 2.0 + (x * (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 (z <= 0.5d0) then
tmp = 2.0d0 + (((x * 0.5d0) + (1.0d0 + (z * (0.5d0 + (z * (-0.125d0)))))) - (sqrt(y) + (sqrt(x) + sqrt(z))))
else
tmp = 2.0d0 + (x * (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 (z <= 0.5) {
tmp = 2.0 + (((x * 0.5) + (1.0 + (z * (0.5 + (z * -0.125))))) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z))));
} else {
tmp = 2.0 + (x * (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 z <= 0.5: tmp = 2.0 + (((x * 0.5) + (1.0 + (z * (0.5 + (z * -0.125))))) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z)))) else: tmp = 2.0 + (x * (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 (z <= 0.5) tmp = Float64(2.0 + Float64(Float64(Float64(x * 0.5) + Float64(1.0 + Float64(z * Float64(0.5 + Float64(z * -0.125))))) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z))))); else tmp = Float64(2.0 + Float64(x * 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 (z <= 0.5)
tmp = 2.0 + (((x * 0.5) + (1.0 + (z * (0.5 + (z * -0.125))))) - (sqrt(y) + (sqrt(x) + sqrt(z))));
else
tmp = 2.0 + (x * (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[z, 0.5], N[(2.0 + N[(N[(N[(x * 0.5), $MachinePrecision] + N[(1.0 + N[(z * N[(0.5 + N[(z * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(x * N[(0.5 - N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.5:\\
\;\;\;\;2 + \left(\left(x \cdot 0.5 + \left(1 + z \cdot \left(0.5 + z \cdot -0.125\right)\right)\right) - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 + x \cdot \left(0.5 - \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if z < 0.5Initial 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.7%
associate--l+26.0%
Simplified26.0%
Taylor expanded in y around 0 19.7%
+-commutative19.7%
associate-+r+19.7%
+-commutative19.7%
associate-+l+19.7%
Simplified19.7%
Taylor expanded in x around 0 19.3%
associate--l+19.3%
*-commutative19.3%
associate-+r+19.3%
+-commutative19.3%
associate-+r+19.3%
Simplified19.3%
Taylor expanded in z around 0 19.3%
*-commutative19.3%
Simplified19.3%
if 0.5 < z Initial program 81.8%
associate-+l+81.8%
sub-neg81.8%
sub-neg81.8%
+-commutative81.8%
+-commutative81.8%
+-commutative81.8%
Simplified81.8%
Taylor expanded in t around inf 3.9%
associate--l+24.5%
Simplified24.5%
Taylor expanded in y around 0 3.2%
+-commutative3.2%
associate-+r+3.2%
+-commutative3.2%
associate-+l+3.2%
Simplified3.2%
Taylor expanded in x around 0 3.5%
associate--l+22.8%
*-commutative22.8%
associate-+r+22.8%
+-commutative22.8%
associate-+r+22.8%
Simplified22.8%
Taylor expanded in x around inf 32.9%
Final simplification25.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.47) (+ 2.0 (+ 1.0 (- (* 0.5 (+ x z)) (+ (sqrt y) (+ (sqrt x) (sqrt z)))))) (+ 2.0 (* 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 (z <= 0.47) {
tmp = 2.0 + (1.0 + ((0.5 * (x + z)) - (sqrt(y) + (sqrt(x) + sqrt(z)))));
} else {
tmp = 2.0 + (x * (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 (z <= 0.47d0) then
tmp = 2.0d0 + (1.0d0 + ((0.5d0 * (x + z)) - (sqrt(y) + (sqrt(x) + sqrt(z)))))
else
tmp = 2.0d0 + (x * (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 (z <= 0.47) {
tmp = 2.0 + (1.0 + ((0.5 * (x + z)) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z)))));
} else {
tmp = 2.0 + (x * (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 z <= 0.47: tmp = 2.0 + (1.0 + ((0.5 * (x + z)) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z))))) else: tmp = 2.0 + (x * (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 (z <= 0.47) tmp = Float64(2.0 + Float64(1.0 + Float64(Float64(0.5 * Float64(x + z)) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z)))))); else tmp = Float64(2.0 + Float64(x * 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 (z <= 0.47)
tmp = 2.0 + (1.0 + ((0.5 * (x + z)) - (sqrt(y) + (sqrt(x) + sqrt(z)))));
else
tmp = 2.0 + (x * (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[z, 0.47], N[(2.0 + N[(1.0 + N[(N[(0.5 * N[(x + z), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(x * N[(0.5 - N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.47:\\
\;\;\;\;2 + \left(1 + \left(0.5 \cdot \left(x + z\right) - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 + x \cdot \left(0.5 - \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if z < 0.46999999999999997Initial 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.8%
associate--l+26.1%
Simplified26.1%
Taylor expanded in y around 0 19.9%
+-commutative19.9%
associate-+r+19.9%
+-commutative19.9%
associate-+l+19.9%
Simplified19.9%
Taylor expanded in x around 0 19.4%
associate--l+19.4%
*-commutative19.4%
associate-+r+19.4%
+-commutative19.4%
associate-+r+19.4%
Simplified19.4%
Taylor expanded in z around 0 19.4%
associate--l+19.4%
distribute-lft-out19.4%
associate-+r+19.4%
+-commutative19.4%
associate-+l+19.4%
Simplified19.4%
if 0.46999999999999997 < z Initial program 82.0%
associate-+l+82.0%
sub-neg82.0%
sub-neg82.0%
+-commutative82.0%
+-commutative82.0%
+-commutative82.0%
Simplified82.0%
Taylor expanded in t around inf 3.9%
associate--l+24.4%
Simplified24.4%
Taylor expanded in y around 0 3.2%
+-commutative3.2%
associate-+r+3.2%
+-commutative3.2%
associate-+l+3.2%
Simplified3.2%
Taylor expanded in x around 0 3.5%
associate--l+22.6%
*-commutative22.6%
associate-+r+22.6%
+-commutative22.6%
associate-+r+22.6%
Simplified22.6%
Taylor expanded in x around inf 32.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.21) (+ 2.0 (- (- (+ 1.0 (* x 0.5)) (sqrt x)) (+ (sqrt y) (sqrt z)))) (+ 2.0 (* 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 (z <= 0.21) {
tmp = 2.0 + (((1.0 + (x * 0.5)) - sqrt(x)) - (sqrt(y) + sqrt(z)));
} else {
tmp = 2.0 + (x * (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 (z <= 0.21d0) then
tmp = 2.0d0 + (((1.0d0 + (x * 0.5d0)) - sqrt(x)) - (sqrt(y) + sqrt(z)))
else
tmp = 2.0d0 + (x * (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 (z <= 0.21) {
tmp = 2.0 + (((1.0 + (x * 0.5)) - Math.sqrt(x)) - (Math.sqrt(y) + Math.sqrt(z)));
} else {
tmp = 2.0 + (x * (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 z <= 0.21: tmp = 2.0 + (((1.0 + (x * 0.5)) - math.sqrt(x)) - (math.sqrt(y) + math.sqrt(z))) else: tmp = 2.0 + (x * (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 (z <= 0.21) tmp = Float64(2.0 + Float64(Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) - Float64(sqrt(y) + sqrt(z)))); else tmp = Float64(2.0 + Float64(x * 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 (z <= 0.21)
tmp = 2.0 + (((1.0 + (x * 0.5)) - sqrt(x)) - (sqrt(y) + sqrt(z)));
else
tmp = 2.0 + (x * (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[z, 0.21], N[(2.0 + N[(N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(x * N[(0.5 - N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.21:\\
\;\;\;\;2 + \left(\left(\left(1 + x \cdot 0.5\right) - \sqrt{x}\right) - \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 + x \cdot \left(0.5 - \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if z < 0.209999999999999992Initial 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.8%
associate--l+26.1%
Simplified26.1%
Taylor expanded in y around 0 19.9%
+-commutative19.9%
associate-+r+19.9%
+-commutative19.9%
associate-+l+19.9%
Simplified19.9%
Taylor expanded in x around 0 19.4%
associate--l+19.4%
*-commutative19.4%
associate-+r+19.4%
+-commutative19.4%
associate-+r+19.4%
Simplified19.4%
Taylor expanded in z around 0 19.4%
associate--r+19.4%
Simplified19.4%
if 0.209999999999999992 < z Initial program 82.0%
associate-+l+82.0%
sub-neg82.0%
sub-neg82.0%
+-commutative82.0%
+-commutative82.0%
+-commutative82.0%
Simplified82.0%
Taylor expanded in t around inf 3.9%
associate--l+24.4%
Simplified24.4%
Taylor expanded in y around 0 3.2%
+-commutative3.2%
associate-+r+3.2%
+-commutative3.2%
associate-+l+3.2%
Simplified3.2%
Taylor expanded in x around 0 3.5%
associate--l+22.6%
*-commutative22.6%
associate-+r+22.6%
+-commutative22.6%
associate-+r+22.6%
Simplified22.6%
Taylor expanded in x around inf 32.7%
Final simplification25.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.1) (+ 2.0 (- (* x 0.5) (+ (sqrt y) (sqrt x)))) (/ (+ x (- 1.0 x)) (+ (sqrt x) (sqrt (+ 1.0 x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.1) {
tmp = 2.0 + ((x * 0.5) - (sqrt(y) + sqrt(x)));
} else {
tmp = (x + (1.0 - x)) / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.1d0) then
tmp = 2.0d0 + ((x * 0.5d0) - (sqrt(y) + sqrt(x)))
else
tmp = (x + (1.0d0 - x)) / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.1) {
tmp = 2.0 + ((x * 0.5) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (x + (1.0 - x)) / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.1: tmp = 2.0 + ((x * 0.5) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (x + (1.0 - x)) / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.1) tmp = Float64(2.0 + Float64(Float64(x * 0.5) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(x + Float64(1.0 - x)) / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.1)
tmp = 2.0 + ((x * 0.5) - (sqrt(y) + sqrt(x)));
else
tmp = (x + (1.0 - x)) / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.1], N[(2.0 + N[(N[(x * 0.5), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.1:\\
\;\;\;\;2 + \left(x \cdot 0.5 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(1 - x\right)}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 1.1000000000000001Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in t around inf 24.8%
associate--l+28.5%
Simplified28.5%
Taylor expanded in y around 0 24.2%
+-commutative24.2%
associate-+r+24.2%
+-commutative24.2%
associate-+l+24.2%
Simplified24.2%
Taylor expanded in x around 0 23.4%
associate--l+35.9%
*-commutative35.9%
associate-+r+35.9%
+-commutative35.9%
associate-+r+35.9%
Simplified35.9%
Taylor expanded in z around inf 21.9%
+-commutative21.9%
Simplified21.9%
if 1.1000000000000001 < y Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
Taylor expanded in t around inf 5.2%
associate--l+22.5%
Simplified22.5%
Taylor expanded in x around inf 21.1%
neg-mul-121.1%
Simplified21.1%
+-commutative21.1%
sub-neg21.1%
flip--21.1%
add-sqr-sqrt21.3%
add-sqr-sqrt21.3%
Applied egg-rr21.3%
associate--l+21.3%
+-commutative21.3%
+-commutative21.3%
Simplified21.3%
Final simplification21.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 (<= y 1.15) (+ 2.0 (- (* x 0.5) (+ (sqrt y) (sqrt x)))) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.15) {
tmp = 2.0 + ((x * 0.5) - (sqrt(y) + sqrt(x)));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.15d0) then
tmp = 2.0d0 + ((x * 0.5d0) - (sqrt(y) + sqrt(x)))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.15) {
tmp = 2.0 + ((x * 0.5) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.15: tmp = 2.0 + ((x * 0.5) - (math.sqrt(y) + math.sqrt(x))) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.15) tmp = Float64(2.0 + Float64(Float64(x * 0.5) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.15)
tmp = 2.0 + ((x * 0.5) - (sqrt(y) + sqrt(x)));
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.15], N[(2.0 + N[(N[(x * 0.5), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.15:\\
\;\;\;\;2 + \left(x \cdot 0.5 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.1499999999999999Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in t around inf 24.8%
associate--l+28.5%
Simplified28.5%
Taylor expanded in y around 0 24.2%
+-commutative24.2%
associate-+r+24.2%
+-commutative24.2%
associate-+l+24.2%
Simplified24.2%
Taylor expanded in x around 0 23.4%
associate--l+35.9%
*-commutative35.9%
associate-+r+35.9%
+-commutative35.9%
associate-+r+35.9%
Simplified35.9%
Taylor expanded in z around inf 21.9%
+-commutative21.9%
Simplified21.9%
if 1.1499999999999999 < y Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
Taylor expanded in t around inf 5.2%
associate--l+22.5%
Simplified22.5%
Taylor expanded in x around inf 21.1%
neg-mul-121.1%
Simplified21.1%
+-commutative21.1%
sub-neg21.1%
Applied egg-rr21.1%
Final simplification21.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 10.5) (+ 2.0 (* x (- 0.5 (sqrt (/ 1.0 x))))) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 10.5) {
tmp = 2.0 + (x * (0.5 - sqrt((1.0 / x))));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 10.5d0) then
tmp = 2.0d0 + (x * (0.5d0 - sqrt((1.0d0 / x))))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 10.5) {
tmp = 2.0 + (x * (0.5 - Math.sqrt((1.0 / x))));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 10.5: tmp = 2.0 + (x * (0.5 - math.sqrt((1.0 / x)))) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 10.5) tmp = Float64(2.0 + Float64(x * Float64(0.5 - sqrt(Float64(1.0 / x))))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 10.5)
tmp = 2.0 + (x * (0.5 - sqrt((1.0 / x))));
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 10.5], N[(2.0 + N[(x * N[(0.5 - N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10.5:\\
\;\;\;\;2 + x \cdot \left(0.5 - \sqrt{\frac{1}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 10.5Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in t around inf 24.8%
associate--l+28.5%
Simplified28.5%
Taylor expanded in y around 0 24.2%
+-commutative24.2%
associate-+r+24.2%
+-commutative24.2%
associate-+l+24.2%
Simplified24.2%
Taylor expanded in x around 0 23.4%
associate--l+35.9%
*-commutative35.9%
associate-+r+35.9%
+-commutative35.9%
associate-+r+35.9%
Simplified35.9%
Taylor expanded in x around inf 21.8%
if 10.5 < y Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
Taylor expanded in t around inf 5.2%
associate--l+22.5%
Simplified22.5%
Taylor expanded in x around inf 21.1%
neg-mul-121.1%
Simplified21.1%
+-commutative21.1%
sub-neg21.1%
Applied egg-rr21.1%
Final simplification21.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 2.3) (+ 2.0 (* x (- 0.5 (sqrt (/ 1.0 x))))) (- (+ 1.0 (* x (+ 0.5 (* x (- (* x 0.0625) 0.125))))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.3) {
tmp = 2.0 + (x * (0.5 - sqrt((1.0 / x))));
} else {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.3d0) then
tmp = 2.0d0 + (x * (0.5d0 - sqrt((1.0d0 / x))))
else
tmp = (1.0d0 + (x * (0.5d0 + (x * ((x * 0.0625d0) - 0.125d0))))) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.3) {
tmp = 2.0 + (x * (0.5 - Math.sqrt((1.0 / x))));
} else {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.3: tmp = 2.0 + (x * (0.5 - math.sqrt((1.0 / x)))) else: tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.3) tmp = Float64(2.0 + Float64(x * Float64(0.5 - sqrt(Float64(1.0 / x))))); else tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.0625) - 0.125))))) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.3)
tmp = 2.0 + (x * (0.5 - sqrt((1.0 / x))));
else
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.3], N[(2.0 + N[(x * N[(0.5 - N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3:\\
\;\;\;\;2 + x \cdot \left(0.5 - \sqrt{\frac{1}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.0625 - 0.125\right)\right)\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.2999999999999998Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in t around inf 24.8%
associate--l+28.5%
Simplified28.5%
Taylor expanded in y around 0 24.2%
+-commutative24.2%
associate-+r+24.2%
+-commutative24.2%
associate-+l+24.2%
Simplified24.2%
Taylor expanded in x around 0 23.4%
associate--l+35.9%
*-commutative35.9%
associate-+r+35.9%
+-commutative35.9%
associate-+r+35.9%
Simplified35.9%
Taylor expanded in x around inf 21.8%
if 2.2999999999999998 < y Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
Taylor expanded in t around inf 5.2%
associate--l+22.5%
Simplified22.5%
Taylor expanded in x around inf 21.1%
neg-mul-121.1%
Simplified21.1%
Taylor expanded in x around 0 20.8%
Final simplification21.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 2.2) (+ 2.0 (* x (- 0.5 (sqrt (/ 1.0 x))))) (+ 1.0 (- (* x 0.5) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2) {
tmp = 2.0 + (x * (0.5 - sqrt((1.0 / x))));
} else {
tmp = 1.0 + ((x * 0.5) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.2d0) then
tmp = 2.0d0 + (x * (0.5d0 - sqrt((1.0d0 / x))))
else
tmp = 1.0d0 + ((x * 0.5d0) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2) {
tmp = 2.0 + (x * (0.5 - Math.sqrt((1.0 / x))));
} else {
tmp = 1.0 + ((x * 0.5) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.2: tmp = 2.0 + (x * (0.5 - math.sqrt((1.0 / x)))) else: tmp = 1.0 + ((x * 0.5) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.2) tmp = Float64(2.0 + Float64(x * Float64(0.5 - sqrt(Float64(1.0 / x))))); else tmp = Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.2)
tmp = 2.0 + (x * (0.5 - sqrt((1.0 / x))));
else
tmp = 1.0 + ((x * 0.5) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.2], N[(2.0 + N[(x * N[(0.5 - N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2:\\
\;\;\;\;2 + x \cdot \left(0.5 - \sqrt{\frac{1}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot 0.5 - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 2.2000000000000002Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in t around inf 24.8%
associate--l+28.5%
Simplified28.5%
Taylor expanded in y around 0 24.2%
+-commutative24.2%
associate-+r+24.2%
+-commutative24.2%
associate-+l+24.2%
Simplified24.2%
Taylor expanded in x around 0 23.4%
associate--l+35.9%
*-commutative35.9%
associate-+r+35.9%
+-commutative35.9%
associate-+r+35.9%
Simplified35.9%
Taylor expanded in x around inf 21.8%
if 2.2000000000000002 < y Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
Taylor expanded in t around inf 5.2%
associate--l+22.5%
Simplified22.5%
Taylor expanded in x around inf 21.1%
neg-mul-121.1%
Simplified21.1%
Taylor expanded in x around 0 21.3%
associate--l+21.3%
*-commutative21.3%
Simplified21.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 11.5) (+ 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 <= 11.5) {
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 <= 11.5d0) 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 <= 11.5) {
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 <= 11.5: 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 <= 11.5) tmp = Float64(1.0 + Float64(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 <= 11.5)
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, 11.5], N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 11.5:\\
\;\;\;\;1 + \left(x \cdot 0.5 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 11.5Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in t around inf 23.1%
associate--l+41.7%
Simplified41.7%
Taylor expanded in x around inf 27.7%
neg-mul-127.7%
Simplified27.7%
Taylor expanded in x around 0 27.3%
associate--l+27.3%
*-commutative27.3%
Simplified27.3%
if 11.5 < x Initial program 83.6%
associate-+l+83.6%
sub-neg83.6%
sub-neg83.6%
+-commutative83.6%
+-commutative83.6%
+-commutative83.6%
Simplified83.6%
Taylor expanded in t around inf 4.4%
associate--l+5.9%
Simplified5.9%
Taylor expanded in x around inf 3.6%
neg-mul-13.6%
Simplified3.6%
Taylor expanded in x around inf 11.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 0.058) (- 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.058) {
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.058d0) 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.058) {
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.058: 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.058) 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.058)
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.058], 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.058:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.0580000000000000029Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in t around inf 23.1%
associate--l+41.8%
Simplified41.8%
Taylor expanded in x around inf 27.8%
neg-mul-127.8%
Simplified27.8%
Taylor expanded in x around 0 27.3%
if 0.0580000000000000029 < x Initial program 83.7%
associate-+l+83.7%
sub-neg83.7%
sub-neg83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
Taylor expanded in t around inf 4.5%
associate--l+6.0%
Simplified6.0%
Taylor expanded in x around inf 3.7%
neg-mul-13.7%
Simplified3.7%
Taylor expanded in x around inf 11.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 90.7%
associate-+l+90.7%
sub-neg90.7%
sub-neg90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
Simplified90.7%
Taylor expanded in t around inf 14.6%
associate--l+25.3%
Simplified25.3%
Taylor expanded in x around inf 16.7%
neg-mul-116.7%
Simplified16.7%
Taylor expanded in x around 0 15.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(y);
}
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(y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(y);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[y], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{y}
\end{array}
Initial program 90.7%
associate-+l+90.7%
sub-neg90.7%
sub-neg90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
Simplified90.7%
Taylor expanded in t around inf 14.6%
associate--l+25.3%
Simplified25.3%
Taylor expanded in y around 0 12.5%
+-commutative12.5%
associate-+r+12.5%
+-commutative12.5%
associate-+l+12.5%
Simplified12.5%
Taylor expanded in y around inf 1.6%
mul-1-neg1.6%
Simplified1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024133
(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))))