
(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 16 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 (+ x 1.0))))
(if (<= (- t_1 (sqrt x)) 0.02)
(/ (+ 1.0 (- x x)) (+ (sqrt x) t_1))
(+
(+ t_1 (- (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (sqrt x)))
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(- (sqrt (+ 1.0 t)) (sqrt t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if ((t_1 - sqrt(x)) <= 0.02) {
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
} else {
tmp = (t_1 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) - sqrt(x))) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if ((t_1 - sqrt(x)) <= 0.02d0) then
tmp = (1.0d0 + (x - x)) / (sqrt(x) + t_1)
else
tmp = (t_1 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) - sqrt(x))) + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (sqrt((1.0d0 + t)) - sqrt(t)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if ((t_1 - Math.sqrt(x)) <= 0.02) {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + t_1);
} else {
tmp = (t_1 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) - Math.sqrt(x))) + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if (t_1 - math.sqrt(x)) <= 0.02: tmp = (1.0 + (x - x)) / (math.sqrt(x) + t_1) else: tmp = (t_1 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) - math.sqrt(x))) + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (Float64(t_1 - sqrt(x)) <= 0.02) tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + t_1)); else tmp = Float64(Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) - sqrt(x))) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if ((t_1 - sqrt(x)) <= 0.02)
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
else
tmp = (t_1 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) - sqrt(x))) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.02], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;t_1 - \sqrt{x} \leq 0.02:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_1}\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} - \sqrt{x}\right)\right) + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) < 0.0200000000000000004Initial program 87.8%
associate-+l+87.8%
+-commutative87.8%
associate-+r-45.9%
associate-+l-11.6%
+-commutative11.6%
associate--l+11.6%
+-commutative11.6%
Simplified7.2%
Taylor expanded in t around inf 7.3%
+-commutative7.3%
+-commutative7.3%
associate--l+8.3%
Simplified8.3%
Taylor expanded in z around inf 5.8%
+-commutative5.8%
Simplified5.8%
Taylor expanded in y around inf 5.1%
flip--5.0%
add-sqr-sqrt6.0%
+-commutative6.0%
add-sqr-sqrt5.8%
+-commutative5.8%
Applied egg-rr5.8%
+-commutative5.8%
associate--l+11.3%
+-commutative11.3%
+-commutative11.3%
Simplified11.3%
if 0.0200000000000000004 < (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) Initial program 97.4%
associate-+l+97.4%
associate-+l-97.4%
+-commutative97.4%
sub-neg97.4%
sub-neg97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
flip--97.5%
add-sqr-sqrt74.1%
add-sqr-sqrt97.7%
Applied egg-rr97.7%
associate--l+97.8%
+-inverses97.8%
metadata-eval97.8%
Simplified97.8%
flip--97.9%
add-sqr-sqrt82.0%
+-commutative82.0%
add-sqr-sqrt97.9%
+-commutative97.9%
Applied egg-rr97.9%
div-sub97.8%
+-commutative97.8%
+-commutative97.8%
Applied egg-rr97.8%
div-sub97.9%
+-commutative97.9%
associate--l+98.2%
+-inverses98.2%
metadata-eval98.2%
+-commutative98.2%
Simplified98.2%
Final simplification54.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))) (t_2 (sqrt (+ 1.0 y))))
(if (<= (+ (- t_1 (sqrt x)) (- t_2 (sqrt y))) 0.9999999999998)
(/ (+ 1.0 (- x x)) (+ (sqrt x) t_1))
(+
(+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ 1.0 (/ 1.0 (+ t_2 (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = sqrt((1.0 + y));
double tmp;
if (((t_1 - sqrt(x)) + (t_2 - sqrt(y))) <= 0.9999999999998) {
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
} else {
tmp = ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (1.0 / (t_2 + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = sqrt((1.0d0 + y))
if (((t_1 - sqrt(x)) + (t_2 - sqrt(y))) <= 0.9999999999998d0) then
tmp = (1.0d0 + (x - x)) / (sqrt(x) + t_1)
else
tmp = ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + (1.0d0 / (t_2 + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (((t_1 - Math.sqrt(x)) + (t_2 - Math.sqrt(y))) <= 0.9999999999998) {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + t_1);
} else {
tmp = ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + (1.0 / (t_2 + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if ((t_1 - math.sqrt(x)) + (t_2 - math.sqrt(y))) <= 0.9999999999998: tmp = (1.0 + (x - x)) / (math.sqrt(x) + t_1) else: tmp = ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + (1.0 / (t_2 + math.sqrt(y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (Float64(Float64(t_1 - sqrt(x)) + Float64(t_2 - sqrt(y))) <= 0.9999999999998) tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + t_1)); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + Float64(1.0 / Float64(t_2 + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (((t_1 - sqrt(x)) + (t_2 - sqrt(y))) <= 0.9999999999998)
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
else
tmp = ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (1.0 / (t_2 + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.9999999999998], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;\left(t_1 - \sqrt{x}\right) + \left(t_2 - \sqrt{y}\right) \leq 0.9999999999998:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \frac{1}{t_2 + \sqrt{y}}\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) < 0.999999999999800049Initial program 79.8%
associate-+l+79.8%
+-commutative79.8%
associate-+r-72.5%
associate-+l-22.4%
+-commutative22.4%
associate--l+22.4%
+-commutative22.4%
Simplified13.2%
Taylor expanded in t around inf 10.9%
+-commutative10.9%
+-commutative10.9%
associate--l+13.9%
Simplified13.9%
Taylor expanded in z around inf 8.5%
+-commutative8.5%
Simplified8.5%
Taylor expanded in y around inf 10.5%
flip--10.4%
add-sqr-sqrt11.0%
+-commutative11.0%
add-sqr-sqrt11.8%
+-commutative11.8%
Applied egg-rr11.8%
+-commutative11.8%
associate--l+18.9%
+-commutative18.9%
+-commutative18.9%
Simplified18.9%
if 0.999999999999800049 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) Initial program 97.6%
associate-+l+97.6%
associate-+l-71.0%
+-commutative71.0%
sub-neg71.0%
sub-neg71.0%
+-commutative71.0%
+-commutative71.0%
Simplified71.0%
flip--71.1%
add-sqr-sqrt56.7%
add-sqr-sqrt71.2%
Applied egg-rr71.2%
associate--l+71.3%
+-inverses71.3%
metadata-eval71.3%
Simplified71.3%
flip--71.3%
add-sqr-sqrt59.1%
+-commutative59.1%
add-sqr-sqrt71.4%
+-commutative71.4%
Applied egg-rr71.4%
div-sub71.3%
+-commutative71.3%
+-commutative71.3%
Applied egg-rr71.3%
div-sub71.4%
+-commutative71.4%
associate--l+71.7%
+-inverses71.7%
metadata-eval71.7%
+-commutative71.7%
Simplified71.7%
Taylor expanded in x around 0 69.9%
Final simplification55.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 z))) (t_2 (sqrt (+ x 1.0))))
(if (<= y 1.6e-50)
(+ (- (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt z) t_1)) 2.0)
(if (<= y 3.9e+34)
(+
t_2
(+
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))
(- (- t_1 (sqrt z)) (sqrt x))))
(/ (+ 1.0 (- x x)) (+ (sqrt x) t_2))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((x + 1.0));
double tmp;
if (y <= 1.6e-50) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) - (sqrt(z) - t_1)) + 2.0;
} else if (y <= 3.9e+34) {
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)));
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((x + 1.0d0))
if (y <= 1.6d-50) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) - (sqrt(z) - t_1)) + 2.0d0
else if (y <= 3.9d+34) then
tmp = t_2 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)))
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 1.6e-50) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) - (Math.sqrt(z) - t_1)) + 2.0;
} else if (y <= 3.9e+34) {
tmp = t_2 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + ((t_1 - Math.sqrt(z)) - Math.sqrt(x)));
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if y <= 1.6e-50: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) - (math.sqrt(z) - t_1)) + 2.0 elif y <= 3.9e+34: tmp = t_2 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + ((t_1 - math.sqrt(z)) - math.sqrt(x))) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 1.6e-50) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) - Float64(sqrt(z) - t_1)) + 2.0); elseif (y <= 3.9e+34) tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(t_1 - sqrt(z)) - sqrt(x)))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 1.6e-50)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) - (sqrt(z) - t_1)) + 2.0;
elseif (y <= 3.9e+34)
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)));
else
tmp = (1.0 + (x - x)) / (sqrt(x) + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.6e-50], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 3.9e+34], N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 1.6 \cdot 10^{-50}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \left(\sqrt{z} - t_1\right)\right) + 2\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+34}:\\
\;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(t_1 - \sqrt{z}\right) - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 1.6e-50Initial program 97.8%
associate-+l+97.8%
associate-+l-61.4%
+-commutative61.4%
sub-neg61.4%
sub-neg61.4%
+-commutative61.4%
+-commutative61.4%
Simplified61.4%
Taylor expanded in x around 0 58.7%
Taylor expanded in y around 0 58.7%
if 1.6e-50 < y < 3.90000000000000019e34Initial program 95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+r-54.9%
associate-+l-48.5%
+-commutative48.5%
associate--l+48.5%
+-commutative48.5%
Simplified34.2%
Taylor expanded in t around inf 26.4%
+-commutative26.4%
+-commutative26.4%
associate--l+25.9%
Simplified25.9%
flip--55.3%
add-sqr-sqrt55.1%
add-sqr-sqrt55.7%
Applied egg-rr26.7%
associate--l+56.7%
+-inverses56.7%
metadata-eval56.7%
Simplified26.7%
if 3.90000000000000019e34 < y Initial program 86.7%
associate-+l+86.7%
+-commutative86.7%
associate-+r-86.7%
associate-+l-54.9%
+-commutative54.9%
associate--l+54.9%
+-commutative54.9%
Simplified39.1%
Taylor expanded in t around inf 33.1%
+-commutative33.1%
+-commutative33.1%
associate--l+35.1%
Simplified35.1%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 18.6%
flip--18.5%
add-sqr-sqrt18.8%
+-commutative18.8%
add-sqr-sqrt19.4%
+-commutative19.4%
Applied egg-rr19.4%
+-commutative19.4%
associate--l+23.8%
+-commutative23.8%
+-commutative23.8%
Simplified23.8%
Final simplification39.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 (+ x 1.0))) (t_2 (sqrt (+ 1.0 z))))
(if (<= y 7.4e-45)
(+
(+ (/ 1.0 (+ (sqrt z) t_2)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(- (+ 1.0 t_1) (sqrt x)))
(if (<= y 3.9e+34)
(+
t_1
(+
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))
(- (- t_2 (sqrt z)) (sqrt x))))
(/ (+ 1.0 (- x x)) (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = sqrt((1.0 + z));
double tmp;
if (y <= 7.4e-45) {
tmp = ((1.0 / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 + t_1) - sqrt(x));
} else if (y <= 3.9e+34) {
tmp = t_1 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((t_2 - sqrt(z)) - sqrt(x)));
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = sqrt((1.0d0 + z))
if (y <= 7.4d-45) then
tmp = ((1.0d0 / (sqrt(z) + t_2)) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((1.0d0 + t_1) - sqrt(x))
else if (y <= 3.9d+34) then
tmp = t_1 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + ((t_2 - sqrt(z)) - sqrt(x)))
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 7.4e-45) {
tmp = ((1.0 / (Math.sqrt(z) + t_2)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((1.0 + t_1) - Math.sqrt(x));
} else if (y <= 3.9e+34) {
tmp = t_1 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + ((t_2 - Math.sqrt(z)) - Math.sqrt(x)));
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if y <= 7.4e-45: tmp = ((1.0 / (math.sqrt(z) + t_2)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((1.0 + t_1) - math.sqrt(x)) elif y <= 3.9e+34: tmp = t_1 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + ((t_2 - math.sqrt(z)) - math.sqrt(x))) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 7.4e-45) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(z) + t_2)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(1.0 + t_1) - sqrt(x))); elseif (y <= 3.9e+34) tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(t_2 - sqrt(z)) - sqrt(x)))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 7.4e-45)
tmp = ((1.0 / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 + t_1) - sqrt(x));
elseif (y <= 3.9e+34)
tmp = t_1 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((t_2 - sqrt(z)) - sqrt(x)));
else
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 7.4e-45], N[(N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + t$95$1), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e+34], N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 7.4 \cdot 10^{-45}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z} + t_2} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(1 + t_1\right) - \sqrt{x}\right)\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+34}:\\
\;\;\;\;t_1 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(t_2 - \sqrt{z}\right) - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 7.4e-45Initial program 97.8%
associate-+l+97.8%
associate-+l-61.0%
+-commutative61.0%
sub-neg61.0%
sub-neg61.0%
+-commutative61.0%
+-commutative61.0%
Simplified61.0%
flip--61.0%
add-sqr-sqrt61.0%
add-sqr-sqrt61.0%
Applied egg-rr61.0%
associate--l+61.0%
+-inverses61.0%
metadata-eval61.0%
Simplified61.0%
flip--61.0%
add-sqr-sqrt46.7%
+-commutative46.7%
add-sqr-sqrt61.0%
+-commutative61.0%
Applied egg-rr61.0%
div-sub61.0%
+-commutative61.0%
+-commutative61.0%
Applied egg-rr61.0%
div-sub61.0%
+-commutative61.0%
associate--l+61.6%
+-inverses61.6%
metadata-eval61.6%
+-commutative61.6%
Simplified61.6%
Taylor expanded in y around 0 61.5%
if 7.4e-45 < y < 3.90000000000000019e34Initial program 94.6%
associate-+l+94.6%
+-commutative94.6%
associate-+r-55.7%
associate-+l-49.7%
+-commutative49.7%
associate--l+49.7%
+-commutative49.7%
Simplified36.5%
Taylor expanded in t around inf 28.0%
+-commutative28.0%
+-commutative28.0%
associate--l+27.4%
Simplified27.4%
flip--56.1%
add-sqr-sqrt55.9%
add-sqr-sqrt56.6%
Applied egg-rr28.3%
associate--l+57.6%
+-inverses57.6%
metadata-eval57.6%
Simplified28.3%
if 3.90000000000000019e34 < y Initial program 86.7%
associate-+l+86.7%
+-commutative86.7%
associate-+r-86.7%
associate-+l-54.9%
+-commutative54.9%
associate--l+54.9%
+-commutative54.9%
Simplified39.1%
Taylor expanded in t around inf 33.1%
+-commutative33.1%
+-commutative33.1%
associate--l+35.1%
Simplified35.1%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 18.6%
flip--18.5%
add-sqr-sqrt18.8%
+-commutative18.8%
add-sqr-sqrt19.4%
+-commutative19.4%
Applied egg-rr19.4%
+-commutative19.4%
associate--l+23.8%
+-commutative23.8%
+-commutative23.8%
Simplified23.8%
Final simplification40.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 2.05e+15)
(+
(- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y))
(- (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt z) (sqrt (+ 1.0 z)))))
(/ (+ 1.0 (- x x)) (+ (sqrt x) (sqrt (+ x 1.0))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.05e+15) {
tmp = ((1.0 + sqrt((1.0 + y))) - sqrt(y)) + ((sqrt((1.0 + t)) - sqrt(t)) - (sqrt(z) - sqrt((1.0 + z))));
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.05d+15) then
tmp = ((1.0d0 + sqrt((1.0d0 + y))) - sqrt(y)) + ((sqrt((1.0d0 + t)) - sqrt(t)) - (sqrt(z) - sqrt((1.0d0 + z))))
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.05e+15) {
tmp = ((1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y)) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) - (Math.sqrt(z) - Math.sqrt((1.0 + z))));
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.05e+15: tmp = ((1.0 + math.sqrt((1.0 + y))) - math.sqrt(y)) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) - (math.sqrt(z) - math.sqrt((1.0 + z)))) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.05e+15) tmp = Float64(Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y)) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) - Float64(sqrt(z) - sqrt(Float64(1.0 + z))))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.05e+15)
tmp = ((1.0 + sqrt((1.0 + y))) - sqrt(y)) + ((sqrt((1.0 + t)) - sqrt(t)) - (sqrt(z) - sqrt((1.0 + z))));
else
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.05e+15], N[(N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.05 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \left(\sqrt{z} - \sqrt{1 + z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 2.05e15Initial program 97.3%
associate-+l+97.3%
associate-+l-59.5%
+-commutative59.5%
sub-neg59.5%
sub-neg59.5%
+-commutative59.5%
+-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 57.2%
if 2.05e15 < y Initial program 86.5%
associate-+l+86.5%
+-commutative86.5%
associate-+r-86.5%
associate-+l-55.4%
+-commutative55.4%
associate--l+55.4%
+-commutative55.4%
Simplified39.3%
Taylor expanded in t around inf 32.8%
+-commutative32.8%
+-commutative32.8%
associate--l+34.8%
Simplified34.8%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 18.5%
flip--18.5%
add-sqr-sqrt18.8%
+-commutative18.8%
add-sqr-sqrt19.3%
+-commutative19.3%
Applied egg-rr19.3%
+-commutative19.3%
associate--l+23.7%
+-commutative23.7%
+-commutative23.7%
Simplified23.7%
Final simplification42.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 1.65e-52)
(+ (- (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt z) t_1)) 2.0)
(if (<= y 2.05e+15)
(- (+ 1.0 (+ (sqrt (+ 1.0 y)) (/ 1.0 (+ (sqrt z) t_1)))) (sqrt y))
(/ (+ 1.0 (- x x)) (+ (sqrt x) (sqrt (+ x 1.0))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 1.65e-52) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) - (sqrt(z) - t_1)) + 2.0;
} else if (y <= 2.05e+15) {
tmp = (1.0 + (sqrt((1.0 + y)) + (1.0 / (sqrt(z) + t_1)))) - sqrt(y);
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 1.65d-52) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) - (sqrt(z) - t_1)) + 2.0d0
else if (y <= 2.05d+15) then
tmp = (1.0d0 + (sqrt((1.0d0 + y)) + (1.0d0 / (sqrt(z) + t_1)))) - sqrt(y)
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 1.65e-52) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) - (Math.sqrt(z) - t_1)) + 2.0;
} else if (y <= 2.05e+15) {
tmp = (1.0 + (Math.sqrt((1.0 + y)) + (1.0 / (Math.sqrt(z) + t_1)))) - Math.sqrt(y);
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 1.65e-52: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) - (math.sqrt(z) - t_1)) + 2.0 elif y <= 2.05e+15: tmp = (1.0 + (math.sqrt((1.0 + y)) + (1.0 / (math.sqrt(z) + t_1)))) - math.sqrt(y) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 1.65e-52) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) - Float64(sqrt(z) - t_1)) + 2.0); elseif (y <= 2.05e+15) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 / Float64(sqrt(z) + t_1)))) - sqrt(y)); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 1.65e-52)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) - (sqrt(z) - t_1)) + 2.0;
elseif (y <= 2.05e+15)
tmp = (1.0 + (sqrt((1.0 + y)) + (1.0 / (sqrt(z) + t_1)))) - sqrt(y);
else
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.65e-52], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 2.05e+15], N[(N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 1.65 \cdot 10^{-52}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \left(\sqrt{z} - t_1\right)\right) + 2\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \left(\sqrt{1 + y} + \frac{1}{\sqrt{z} + t_1}\right)\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 1.64999999999999998e-52Initial program 97.7%
associate-+l+97.7%
associate-+l-61.0%
+-commutative61.0%
sub-neg61.0%
sub-neg61.0%
+-commutative61.0%
+-commutative61.0%
Simplified61.0%
Taylor expanded in x around 0 58.3%
Taylor expanded in y around 0 58.3%
if 1.64999999999999998e-52 < y < 2.05e15Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+r-54.8%
associate-+l-48.2%
+-commutative48.2%
associate--l+48.2%
+-commutative48.2%
Simplified35.3%
Taylor expanded in t around inf 26.7%
+-commutative26.7%
+-commutative26.7%
associate--l+26.2%
Simplified26.2%
flip--26.2%
add-sqr-sqrt25.1%
add-sqr-sqrt26.2%
+-commutative26.2%
+-commutative26.2%
Applied egg-rr26.2%
associate--r+26.2%
sub-neg26.2%
metadata-eval26.2%
+-commutative26.2%
Simplified26.2%
Taylor expanded in x around 0 58.1%
if 2.05e15 < y Initial program 86.5%
associate-+l+86.5%
+-commutative86.5%
associate-+r-86.5%
associate-+l-55.4%
+-commutative55.4%
associate--l+55.4%
+-commutative55.4%
Simplified39.3%
Taylor expanded in t around inf 32.8%
+-commutative32.8%
+-commutative32.8%
associate--l+34.8%
Simplified34.8%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 18.5%
flip--18.5%
add-sqr-sqrt18.8%
+-commutative18.8%
add-sqr-sqrt19.3%
+-commutative19.3%
Applied egg-rr19.3%
+-commutative19.3%
associate--l+23.7%
+-commutative23.7%
+-commutative23.7%
Simplified23.7%
Final simplification43.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))))
(if (<= y 1.5e-50)
(+ (- (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt z) t_1)) 2.0)
(if (<= y 2.05e+15)
(+ (- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y)) (- t_1 (sqrt z)))
(/ (+ 1.0 (- x x)) (+ (sqrt x) (sqrt (+ x 1.0))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 1.5e-50) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) - (sqrt(z) - t_1)) + 2.0;
} else if (y <= 2.05e+15) {
tmp = ((1.0 + sqrt((1.0 + y))) - sqrt(y)) + (t_1 - sqrt(z));
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 1.5d-50) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) - (sqrt(z) - t_1)) + 2.0d0
else if (y <= 2.05d+15) then
tmp = ((1.0d0 + sqrt((1.0d0 + y))) - sqrt(y)) + (t_1 - sqrt(z))
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 1.5e-50) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) - (Math.sqrt(z) - t_1)) + 2.0;
} else if (y <= 2.05e+15) {
tmp = ((1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y)) + (t_1 - Math.sqrt(z));
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 1.5e-50: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) - (math.sqrt(z) - t_1)) + 2.0 elif y <= 2.05e+15: tmp = ((1.0 + math.sqrt((1.0 + y))) - math.sqrt(y)) + (t_1 - math.sqrt(z)) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 1.5e-50) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) - Float64(sqrt(z) - t_1)) + 2.0); elseif (y <= 2.05e+15) tmp = Float64(Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y)) + Float64(t_1 - sqrt(z))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 1.5e-50)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) - (sqrt(z) - t_1)) + 2.0;
elseif (y <= 2.05e+15)
tmp = ((1.0 + sqrt((1.0 + y))) - sqrt(y)) + (t_1 - sqrt(z));
else
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.5e-50], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 2.05e+15], N[(N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{-50}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \left(\sqrt{z} - t_1\right)\right) + 2\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\right) + \left(t_1 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 1.49999999999999995e-50Initial program 97.8%
associate-+l+97.8%
associate-+l-61.4%
+-commutative61.4%
sub-neg61.4%
sub-neg61.4%
+-commutative61.4%
+-commutative61.4%
Simplified61.4%
Taylor expanded in x around 0 58.7%
Taylor expanded in y around 0 58.7%
if 1.49999999999999995e-50 < y < 2.05e15Initial program 96.0%
associate-+l+96.0%
associate-+l-53.5%
+-commutative53.5%
sub-neg53.5%
sub-neg53.5%
+-commutative53.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in x around 0 52.5%
Taylor expanded in t around inf 59.1%
if 2.05e15 < y Initial program 86.5%
associate-+l+86.5%
+-commutative86.5%
associate-+r-86.5%
associate-+l-55.4%
+-commutative55.4%
associate--l+55.4%
+-commutative55.4%
Simplified39.3%
Taylor expanded in t around inf 32.8%
+-commutative32.8%
+-commutative32.8%
associate--l+34.8%
Simplified34.8%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 18.5%
flip--18.5%
add-sqr-sqrt18.8%
+-commutative18.8%
add-sqr-sqrt19.3%
+-commutative19.3%
Applied egg-rr19.3%
+-commutative19.3%
associate--l+23.7%
+-commutative23.7%
+-commutative23.7%
Simplified23.7%
Final simplification43.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 1e-23)
(- 2.0 (- (sqrt z) (sqrt (+ 1.0 z))))
(if (<= y 4e+26)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))
(/ (+ 1.0 (- x x)) (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 1e-23) {
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
} else if (y <= 4e+26) {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 1d-23) then
tmp = 2.0d0 - (sqrt(z) - sqrt((1.0d0 + z)))
else if (y <= 4d+26) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 1e-23) {
tmp = 2.0 - (Math.sqrt(z) - Math.sqrt((1.0 + z)));
} else if (y <= 4e+26) {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 1e-23: tmp = 2.0 - (math.sqrt(z) - math.sqrt((1.0 + z))) elif y <= 4e+26: tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 1e-23) tmp = Float64(2.0 - Float64(sqrt(z) - sqrt(Float64(1.0 + z)))); elseif (y <= 4e+26) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 1e-23)
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
elseif (y <= 4e+26)
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
else
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1e-23], N[(2.0 - N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+26], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 10^{-23}:\\
\;\;\;\;2 - \left(\sqrt{z} - \sqrt{1 + z}\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+26}:\\
\;\;\;\;t_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 9.9999999999999996e-24Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+r-59.6%
associate-+l-53.2%
+-commutative53.2%
associate--l+53.3%
+-commutative53.3%
Simplified34.9%
Taylor expanded in t around inf 33.2%
+-commutative33.2%
+-commutative33.2%
associate--l+33.4%
Simplified33.4%
Taylor expanded in x around 0 32.2%
Taylor expanded in y around 0 32.1%
associate--l+60.3%
Simplified60.3%
if 9.9999999999999996e-24 < y < 4.00000000000000019e26Initial program 90.4%
associate-+l+90.4%
+-commutative90.4%
associate-+r-61.0%
associate-+l-56.3%
+-commutative56.3%
associate--l+56.3%
+-commutative56.3%
Simplified36.2%
Taylor expanded in t around inf 33.6%
+-commutative33.6%
+-commutative33.6%
associate--l+33.2%
Simplified33.2%
Taylor expanded in z around inf 21.9%
+-commutative21.9%
Simplified21.9%
if 4.00000000000000019e26 < y Initial program 86.7%
associate-+l+86.7%
+-commutative86.7%
associate-+r-86.7%
associate-+l-54.9%
+-commutative54.9%
associate--l+54.9%
+-commutative54.9%
Simplified39.1%
Taylor expanded in t around inf 33.1%
+-commutative33.1%
+-commutative33.1%
associate--l+35.1%
Simplified35.1%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 18.6%
flip--18.5%
add-sqr-sqrt18.8%
+-commutative18.8%
add-sqr-sqrt19.4%
+-commutative19.4%
Applied egg-rr19.4%
+-commutative19.4%
associate--l+23.8%
+-commutative23.8%
+-commutative23.8%
Simplified23.8%
Final simplification41.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 2.6e-24)
(- 2.0 (- (sqrt z) (sqrt (+ 1.0 z))))
(if (<= y 2.1e+26)
(- (+ t_1 (sqrt (+ 1.0 y))) (+ (sqrt x) (sqrt y)))
(/ (+ 1.0 (- x x)) (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 2.6e-24) {
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
} else if (y <= 2.1e+26) {
tmp = (t_1 + sqrt((1.0 + y))) - (sqrt(x) + sqrt(y));
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 2.6d-24) then
tmp = 2.0d0 - (sqrt(z) - sqrt((1.0d0 + z)))
else if (y <= 2.1d+26) then
tmp = (t_1 + sqrt((1.0d0 + y))) - (sqrt(x) + sqrt(y))
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 2.6e-24) {
tmp = 2.0 - (Math.sqrt(z) - Math.sqrt((1.0 + z)));
} else if (y <= 2.1e+26) {
tmp = (t_1 + Math.sqrt((1.0 + y))) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 2.6e-24: tmp = 2.0 - (math.sqrt(z) - math.sqrt((1.0 + z))) elif y <= 2.1e+26: tmp = (t_1 + math.sqrt((1.0 + y))) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 2.6e-24) tmp = Float64(2.0 - Float64(sqrt(z) - sqrt(Float64(1.0 + z)))); elseif (y <= 2.1e+26) tmp = Float64(Float64(t_1 + sqrt(Float64(1.0 + y))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 2.6e-24)
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
elseif (y <= 2.1e+26)
tmp = (t_1 + sqrt((1.0 + y))) - (sqrt(x) + sqrt(y));
else
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.6e-24], N[(2.0 - N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+26], N[(N[(t$95$1 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 2.6 \cdot 10^{-24}:\\
\;\;\;\;2 - \left(\sqrt{z} - \sqrt{1 + z}\right)\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+26}:\\
\;\;\;\;\left(t_1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 2.6e-24Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+r-59.6%
associate-+l-53.2%
+-commutative53.2%
associate--l+53.3%
+-commutative53.3%
Simplified34.9%
Taylor expanded in t around inf 33.2%
+-commutative33.2%
+-commutative33.2%
associate--l+33.4%
Simplified33.4%
Taylor expanded in x around 0 32.2%
Taylor expanded in y around 0 32.1%
associate--l+60.3%
Simplified60.3%
if 2.6e-24 < y < 2.1000000000000001e26Initial program 90.4%
associate-+l+90.4%
+-commutative90.4%
associate-+r-61.0%
associate-+l-56.3%
+-commutative56.3%
associate--l+56.3%
+-commutative56.3%
Simplified36.2%
Taylor expanded in t around inf 33.6%
+-commutative33.6%
+-commutative33.6%
associate--l+33.2%
Simplified33.2%
Taylor expanded in z around inf 21.9%
+-commutative21.9%
Simplified21.9%
if 2.1000000000000001e26 < y Initial program 86.7%
associate-+l+86.7%
+-commutative86.7%
associate-+r-86.7%
associate-+l-54.9%
+-commutative54.9%
associate--l+54.9%
+-commutative54.9%
Simplified39.1%
Taylor expanded in t around inf 33.1%
+-commutative33.1%
+-commutative33.1%
associate--l+35.1%
Simplified35.1%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 18.6%
flip--18.5%
add-sqr-sqrt18.8%
+-commutative18.8%
add-sqr-sqrt19.4%
+-commutative19.4%
Applied egg-rr19.4%
+-commutative19.4%
associate--l+23.8%
+-commutative23.8%
+-commutative23.8%
Simplified23.8%
Final simplification41.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 4.8e-24)
(+ (- (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt z) (sqrt (+ 1.0 z)))) 2.0)
(if (<= y 4e+26)
(- (+ t_1 (sqrt (+ 1.0 y))) (+ (sqrt x) (sqrt y)))
(/ (+ 1.0 (- x x)) (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 4.8e-24) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) - (sqrt(z) - sqrt((1.0 + z)))) + 2.0;
} else if (y <= 4e+26) {
tmp = (t_1 + sqrt((1.0 + y))) - (sqrt(x) + sqrt(y));
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 4.8d-24) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) - (sqrt(z) - sqrt((1.0d0 + z)))) + 2.0d0
else if (y <= 4d+26) then
tmp = (t_1 + sqrt((1.0d0 + y))) - (sqrt(x) + sqrt(y))
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 4.8e-24) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) - (Math.sqrt(z) - Math.sqrt((1.0 + z)))) + 2.0;
} else if (y <= 4e+26) {
tmp = (t_1 + Math.sqrt((1.0 + y))) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 4.8e-24: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) - (math.sqrt(z) - math.sqrt((1.0 + z)))) + 2.0 elif y <= 4e+26: tmp = (t_1 + math.sqrt((1.0 + y))) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 4.8e-24) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) - Float64(sqrt(z) - sqrt(Float64(1.0 + z)))) + 2.0); elseif (y <= 4e+26) tmp = Float64(Float64(t_1 + sqrt(Float64(1.0 + y))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 4.8e-24)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) - (sqrt(z) - sqrt((1.0 + z)))) + 2.0;
elseif (y <= 4e+26)
tmp = (t_1 + sqrt((1.0 + y))) - (sqrt(x) + sqrt(y));
else
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.8e-24], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 4e+26], N[(N[(t$95$1 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 4.8 \cdot 10^{-24}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \left(\sqrt{z} - \sqrt{1 + z}\right)\right) + 2\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+26}:\\
\;\;\;\;\left(t_1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 4.7999999999999996e-24Initial program 98.0%
associate-+l+98.0%
associate-+l-59.6%
+-commutative59.6%
sub-neg59.6%
sub-neg59.6%
+-commutative59.6%
+-commutative59.6%
Simplified59.6%
Taylor expanded in x around 0 57.3%
Taylor expanded in y around 0 57.2%
if 4.7999999999999996e-24 < y < 4.00000000000000019e26Initial program 90.4%
associate-+l+90.4%
+-commutative90.4%
associate-+r-61.0%
associate-+l-56.3%
+-commutative56.3%
associate--l+56.3%
+-commutative56.3%
Simplified36.2%
Taylor expanded in t around inf 33.6%
+-commutative33.6%
+-commutative33.6%
associate--l+33.2%
Simplified33.2%
Taylor expanded in z around inf 21.9%
+-commutative21.9%
Simplified21.9%
if 4.00000000000000019e26 < y Initial program 86.7%
associate-+l+86.7%
+-commutative86.7%
associate-+r-86.7%
associate-+l-54.9%
+-commutative54.9%
associate--l+54.9%
+-commutative54.9%
Simplified39.1%
Taylor expanded in t around inf 33.1%
+-commutative33.1%
+-commutative33.1%
associate--l+35.1%
Simplified35.1%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 18.6%
flip--18.5%
add-sqr-sqrt18.8%
+-commutative18.8%
add-sqr-sqrt19.4%
+-commutative19.4%
Applied egg-rr19.4%
+-commutative19.4%
associate--l+23.8%
+-commutative23.8%
+-commutative23.8%
Simplified23.8%
Final simplification40.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.05e-18)
(- 2.0 (- (sqrt z) (sqrt (+ 1.0 z))))
(if (<= y 2.05e+15)
(- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y))
(/ (+ 1.0 (- x x)) (+ (sqrt x) (sqrt (+ x 1.0)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.05e-18) {
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
} else if (y <= 2.05e+15) {
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.05d-18) then
tmp = 2.0d0 - (sqrt(z) - sqrt((1.0d0 + z)))
else if (y <= 2.05d+15) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - sqrt(y)
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.05e-18) {
tmp = 2.0 - (Math.sqrt(z) - Math.sqrt((1.0 + z)));
} else if (y <= 2.05e+15) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y);
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.05e-18: tmp = 2.0 - (math.sqrt(z) - math.sqrt((1.0 + z))) elif y <= 2.05e+15: tmp = (1.0 + math.sqrt((1.0 + y))) - math.sqrt(y) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.05e-18) tmp = Float64(2.0 - Float64(sqrt(z) - sqrt(Float64(1.0 + z)))); elseif (y <= 2.05e+15) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y)); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.05e-18)
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
elseif (y <= 2.05e+15)
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
else
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.05e-18], N[(2.0 - N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e+15], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.05 \cdot 10^{-18}:\\
\;\;\;\;2 - \left(\sqrt{z} - \sqrt{1 + z}\right)\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 1.05e-18Initial program 98.1%
associate-+l+98.1%
+-commutative98.1%
associate-+r-59.6%
associate-+l-53.2%
+-commutative53.2%
associate--l+53.2%
+-commutative53.2%
Simplified34.5%
Taylor expanded in t around inf 32.9%
+-commutative32.9%
+-commutative32.9%
associate--l+33.1%
Simplified33.1%
Taylor expanded in x around 0 31.9%
Taylor expanded in y around 0 31.7%
associate--l+59.7%
Simplified59.7%
if 1.05e-18 < y < 2.05e15Initial program 90.7%
associate-+l+90.7%
+-commutative90.7%
associate-+r-58.6%
associate-+l-53.8%
+-commutative53.8%
associate--l+53.8%
+-commutative53.8%
Simplified38.1%
Taylor expanded in t around inf 39.0%
+-commutative39.0%
+-commutative39.0%
associate--l+38.5%
Simplified38.5%
Taylor expanded in z around inf 24.2%
+-commutative24.2%
Simplified24.2%
Taylor expanded in x around 0 36.5%
if 2.05e15 < y Initial program 86.5%
associate-+l+86.5%
+-commutative86.5%
associate-+r-86.5%
associate-+l-55.4%
+-commutative55.4%
associate--l+55.4%
+-commutative55.4%
Simplified39.3%
Taylor expanded in t around inf 32.8%
+-commutative32.8%
+-commutative32.8%
associate--l+34.8%
Simplified34.8%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 18.5%
flip--18.5%
add-sqr-sqrt18.8%
+-commutative18.8%
add-sqr-sqrt19.3%
+-commutative19.3%
Applied egg-rr19.3%
+-commutative19.3%
associate--l+23.7%
+-commutative23.7%
+-commutative23.7%
Simplified23.7%
Final simplification42.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 1.55e-19)
(- 2.0 (- (sqrt z) (sqrt (+ 1.0 z))))
(if (<= y 1.4e+15)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(- (sqrt (+ x 1.0)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.55e-19) {
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
} else if (y <= 1.4e+15) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = sqrt((x + 1.0)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.55d-19) then
tmp = 2.0d0 - (sqrt(z) - sqrt((1.0d0 + z)))
else if (y <= 1.4d+15) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = sqrt((x + 1.0d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.55e-19) {
tmp = 2.0 - (Math.sqrt(z) - Math.sqrt((1.0 + z)));
} else if (y <= 1.4e+15) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = Math.sqrt((x + 1.0)) - 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.55e-19: tmp = 2.0 - (math.sqrt(z) - math.sqrt((1.0 + z))) elif y <= 1.4e+15: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.55e-19) tmp = Float64(2.0 - Float64(sqrt(z) - sqrt(Float64(1.0 + z)))); elseif (y <= 1.4e+15) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.55e-19)
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
elseif (y <= 1.4e+15)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = sqrt((x + 1.0)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.55e-19], N[(2.0 - N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+15], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $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.55 \cdot 10^{-19}:\\
\;\;\;\;2 - \left(\sqrt{z} - \sqrt{1 + z}\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.5499999999999999e-19Initial program 98.1%
associate-+l+98.1%
+-commutative98.1%
associate-+r-59.6%
associate-+l-53.2%
+-commutative53.2%
associate--l+53.2%
+-commutative53.2%
Simplified34.5%
Taylor expanded in t around inf 32.9%
+-commutative32.9%
+-commutative32.9%
associate--l+33.1%
Simplified33.1%
Taylor expanded in x around 0 31.9%
Taylor expanded in y around 0 31.7%
associate--l+59.7%
Simplified59.7%
if 1.5499999999999999e-19 < y < 1.4e15Initial program 90.7%
associate-+l+90.7%
+-commutative90.7%
associate-+r-58.6%
associate-+l-53.8%
+-commutative53.8%
associate--l+53.8%
+-commutative53.8%
Simplified38.1%
Taylor expanded in t around inf 39.0%
+-commutative39.0%
+-commutative39.0%
associate--l+38.5%
Simplified38.5%
Taylor expanded in z around inf 24.2%
+-commutative24.2%
Simplified24.2%
Taylor expanded in x around 0 36.5%
associate--l+36.4%
Simplified36.4%
if 1.4e15 < y Initial program 86.5%
associate-+l+86.5%
+-commutative86.5%
associate-+r-86.5%
associate-+l-55.4%
+-commutative55.4%
associate--l+55.4%
+-commutative55.4%
Simplified39.3%
Taylor expanded in t around inf 32.8%
+-commutative32.8%
+-commutative32.8%
associate--l+34.8%
Simplified34.8%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 18.5%
Final simplification40.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.72e-18)
(- 2.0 (- (sqrt z) (sqrt (+ 1.0 z))))
(if (<= y 2e+15)
(- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y))
(- (sqrt (+ x 1.0)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.72e-18) {
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
} else if (y <= 2e+15) {
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
} else {
tmp = sqrt((x + 1.0)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.72d-18) then
tmp = 2.0d0 - (sqrt(z) - sqrt((1.0d0 + z)))
else if (y <= 2d+15) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - sqrt(y)
else
tmp = sqrt((x + 1.0d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.72e-18) {
tmp = 2.0 - (Math.sqrt(z) - Math.sqrt((1.0 + z)));
} else if (y <= 2e+15) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y);
} else {
tmp = Math.sqrt((x + 1.0)) - 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.72e-18: tmp = 2.0 - (math.sqrt(z) - math.sqrt((1.0 + z))) elif y <= 2e+15: tmp = (1.0 + math.sqrt((1.0 + y))) - math.sqrt(y) else: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.72e-18) tmp = Float64(2.0 - Float64(sqrt(z) - sqrt(Float64(1.0 + z)))); elseif (y <= 2e+15) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y)); else tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.72e-18)
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
elseif (y <= 2e+15)
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
else
tmp = sqrt((x + 1.0)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.72e-18], N[(2.0 - N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+15], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $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.72 \cdot 10^{-18}:\\
\;\;\;\;2 - \left(\sqrt{z} - \sqrt{1 + z}\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.72e-18Initial program 98.1%
associate-+l+98.1%
+-commutative98.1%
associate-+r-59.6%
associate-+l-53.2%
+-commutative53.2%
associate--l+53.2%
+-commutative53.2%
Simplified34.5%
Taylor expanded in t around inf 32.9%
+-commutative32.9%
+-commutative32.9%
associate--l+33.1%
Simplified33.1%
Taylor expanded in x around 0 31.9%
Taylor expanded in y around 0 31.7%
associate--l+59.7%
Simplified59.7%
if 1.72e-18 < y < 2e15Initial program 90.7%
associate-+l+90.7%
+-commutative90.7%
associate-+r-58.6%
associate-+l-53.8%
+-commutative53.8%
associate--l+53.8%
+-commutative53.8%
Simplified38.1%
Taylor expanded in t around inf 39.0%
+-commutative39.0%
+-commutative39.0%
associate--l+38.5%
Simplified38.5%
Taylor expanded in z around inf 24.2%
+-commutative24.2%
Simplified24.2%
Taylor expanded in x around 0 36.5%
if 2e15 < y Initial program 86.5%
associate-+l+86.5%
+-commutative86.5%
associate-+r-86.5%
associate-+l-55.4%
+-commutative55.4%
associate--l+55.4%
+-commutative55.4%
Simplified39.3%
Taylor expanded in t around inf 32.8%
+-commutative32.8%
+-commutative32.8%
associate--l+34.8%
Simplified34.8%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 18.5%
Final simplification40.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (- (sqrt (+ x 1.0)) (sqrt x)))) (if (<= y 1.95) (+ 1.0 t_1) t_1)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0)) - sqrt(x);
double tmp;
if (y <= 1.95) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0)) - sqrt(x)
if (y <= 1.95d0) then
tmp = 1.0d0 + t_1
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
double tmp;
if (y <= 1.95) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) - math.sqrt(x) tmp = 0 if y <= 1.95: tmp = 1.0 + t_1 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) tmp = 0.0 if (y <= 1.95) tmp = Float64(1.0 + t_1); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0)) - sqrt(x);
tmp = 0.0;
if (y <= 1.95)
tmp = 1.0 + t_1;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.95], N[(1.0 + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1} - \sqrt{x}\\
\mathbf{if}\;y \leq 1.95:\\
\;\;\;\;1 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < 1.94999999999999996Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+r-58.9%
associate-+l-52.6%
+-commutative52.6%
associate--l+52.6%
+-commutative52.6%
Simplified34.3%
Taylor expanded in t around inf 32.3%
+-commutative32.3%
+-commutative32.3%
associate--l+32.5%
Simplified32.5%
Taylor expanded in z around inf 23.9%
+-commutative23.9%
Simplified23.9%
Taylor expanded in y around 0 23.9%
associate--l+38.6%
Simplified38.6%
if 1.94999999999999996 < y Initial program 86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+r-85.6%
associate-+l-56.0%
+-commutative56.0%
associate--l+56.0%
+-commutative56.0%
Simplified39.6%
Taylor expanded in t around inf 34.1%
+-commutative34.1%
+-commutative34.1%
associate--l+36.0%
Simplified36.0%
Taylor expanded in z around inf 18.4%
+-commutative18.4%
Simplified18.4%
Taylor expanded in y around inf 18.6%
Final simplification29.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 (<= x 4e-26) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))) (- (sqrt (+ x 1.0)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 4e-26) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = sqrt((x + 1.0)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 4d-26) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = sqrt((x + 1.0d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 4e-26) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 4e-26: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 4e-26) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 4e-26)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = sqrt((x + 1.0)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 4e-26], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $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}\;x \leq 4 \cdot 10^{-26}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if x < 4.0000000000000002e-26Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-97.6%
associate-+l-97.6%
+-commutative97.6%
associate--l+97.6%
+-commutative97.6%
Simplified67.9%
Taylor expanded in t around inf 61.4%
+-commutative61.4%
+-commutative61.4%
associate--l+61.4%
Simplified61.4%
Taylor expanded in z around inf 38.3%
+-commutative38.3%
Simplified38.3%
Taylor expanded in x around 0 27.8%
associate--l+38.3%
Simplified38.3%
if 4.0000000000000002e-26 < x Initial program 88.5%
associate-+l+88.5%
+-commutative88.5%
associate-+r-50.1%
associate-+l-18.8%
+-commutative18.8%
associate--l+18.8%
+-commutative18.8%
Simplified11.4%
Taylor expanded in t around inf 10.1%
+-commutative10.1%
+-commutative10.1%
associate--l+11.8%
Simplified11.8%
Taylor expanded in z around inf 7.5%
+-commutative7.5%
Simplified7.5%
Taylor expanded in y around inf 7.6%
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 (- (sqrt (+ x 1.0)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((x + 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 = sqrt((x + 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 Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((x + 1.0)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((x + 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[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{x + 1} - \sqrt{x}
\end{array}
Initial program 92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+r-71.4%
associate-+l-54.2%
+-commutative54.2%
associate--l+54.2%
+-commutative54.2%
Simplified36.8%
Taylor expanded in t around inf 33.2%
+-commutative33.2%
+-commutative33.2%
associate--l+34.1%
Simplified34.1%
Taylor expanded in z around inf 21.3%
+-commutative21.3%
Simplified21.3%
Taylor expanded in y around inf 14.3%
Final simplification14.3%
(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 2023238
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:herbie-target
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))