
(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 26 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 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))) (t_2 (sqrt (+ x 1.0))))
(if (<= (- t_2 (sqrt x)) 0.999998)
(+ (+ (/ 1.0 (+ (sqrt x) t_2)) (* 0.5 (sqrt (/ 1.0 y)))) t_1)
(+
(+ (- 1.0 (sqrt x)) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(+ t_1 (- (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 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
double t_2 = sqrt((x + 1.0));
double tmp;
if ((t_2 - sqrt(x)) <= 0.999998) {
tmp = ((1.0 / (sqrt(x) + t_2)) + (0.5 * sqrt((1.0 / y)))) + t_1;
} else {
tmp = ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (t_1 + (sqrt((1.0 + t)) - sqrt(t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))
t_2 = sqrt((x + 1.0d0))
if ((t_2 - sqrt(x)) <= 0.999998d0) then
tmp = ((1.0d0 / (sqrt(x) + t_2)) + (0.5d0 * sqrt((1.0d0 / y)))) + t_1
else
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + (t_1 + (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 = 1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if ((t_2 - Math.sqrt(x)) <= 0.999998) {
tmp = ((1.0 / (Math.sqrt(x) + t_2)) + (0.5 * Math.sqrt((1.0 / y)))) + t_1;
} else {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + (t_1 + (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 = 1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))) t_2 = math.sqrt((x + 1.0)) tmp = 0 if (t_2 - math.sqrt(x)) <= 0.999998: tmp = ((1.0 / (math.sqrt(x) + t_2)) + (0.5 * math.sqrt((1.0 / y)))) + t_1 else: tmp = ((1.0 - math.sqrt(x)) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + (t_1 + (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 = Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (Float64(t_2 - sqrt(x)) <= 0.999998) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + t_1); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + Float64(t_1 + 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 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if ((t_2 - sqrt(x)) <= 0.999998)
tmp = ((1.0 / (sqrt(x) + t_2)) + (0.5 * sqrt((1.0 / y)))) + t_1;
else
tmp = ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (t_1 + (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[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.999998], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + 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 := \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;t\_2 - \sqrt{x} \leq 0.999998:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t\_2} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + \left(t\_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.999998000000000054Initial program 86.0%
associate-+l+86.0%
+-commutative86.0%
+-commutative86.0%
+-commutative86.0%
Simplified86.0%
flip--86.3%
add-sqr-sqrt56.6%
+-commutative56.6%
add-sqr-sqrt86.8%
+-commutative86.8%
Applied egg-rr86.8%
associate--l+90.6%
+-inverses90.6%
metadata-eval90.6%
Simplified90.6%
Taylor expanded in t around inf 48.8%
flip--49.0%
add-sqr-sqrt41.5%
add-sqr-sqrt49.0%
Applied egg-rr49.0%
associate--l+52.0%
+-inverses52.0%
metadata-eval52.0%
+-commutative52.0%
Simplified52.0%
Taylor expanded in y around inf 29.6%
if 0.999998000000000054 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 97.4%
flip--97.4%
add-sqr-sqrt81.2%
add-sqr-sqrt97.4%
Applied egg-rr97.4%
associate--l+98.3%
+-inverses98.3%
metadata-eval98.3%
+-commutative98.3%
Simplified98.3%
flip--54.5%
add-sqr-sqrt41.7%
add-sqr-sqrt54.7%
Applied egg-rr98.5%
associate--l+54.7%
+-inverses54.7%
metadata-eval54.7%
+-commutative54.7%
Simplified98.8%
Final simplification61.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= z 1.04e-10)
(+
(+ (- 1.0 (sqrt x)) (+ 1.0 (- (* y (+ 0.5 (* y -0.125))) (sqrt y))))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- t_1 (sqrt z))))
(+
(/ 1.0 (+ (sqrt z) t_1))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0))))
(/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))))))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 (z <= 1.04e-10) {
tmp = ((1.0 - sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (t_1 - sqrt(z)));
} else {
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (1.0 / (sqrt(y) + sqrt((1.0 + y)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (z <= 1.04d-10) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 + ((y * (0.5d0 + (y * (-0.125d0)))) - sqrt(y)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (t_1 - sqrt(z)))
else
tmp = (1.0d0 / (sqrt(z) + t_1)) + ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 1.04e-10) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - Math.sqrt(y)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (t_1 - Math.sqrt(z)));
} else {
tmp = (1.0 / (Math.sqrt(z) + t_1)) + ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))));
}
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 z <= 1.04e-10: tmp = ((1.0 - math.sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - math.sqrt(y)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (t_1 - math.sqrt(z))) else: tmp = (1.0 / (math.sqrt(z) + t_1)) + ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) 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 (z <= 1.04e-10) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 + Float64(Float64(y * Float64(0.5 + Float64(y * -0.125))) - sqrt(y)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(t_1 - sqrt(z)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 1.04e-10)
tmp = ((1.0 - sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (t_1 - sqrt(z)));
else
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (1.0 / (sqrt(y) + sqrt((1.0 + y)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.04e-10], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(y * N[(0.5 + N[(y * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 1.04 \cdot 10^{-10}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(1 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(t\_1 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{z} + t\_1} + \left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right)\\
\end{array}
\end{array}
if z < 1.04e-10Initial program 97.5%
associate-+l+97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 46.2%
Taylor expanded in y around 0 27.0%
associate--l+27.0%
Simplified27.0%
if 1.04e-10 < z Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
+-commutative84.8%
+-commutative84.8%
Simplified84.8%
flip--85.0%
add-sqr-sqrt71.3%
+-commutative71.3%
add-sqr-sqrt85.0%
+-commutative85.0%
Applied egg-rr85.0%
associate--l+88.7%
+-inverses88.7%
metadata-eval88.7%
Simplified88.7%
Taylor expanded in t around inf 48.7%
flip--48.9%
add-sqr-sqrt28.5%
add-sqr-sqrt49.1%
Applied egg-rr49.1%
associate--l+52.4%
+-inverses52.4%
metadata-eval52.4%
+-commutative52.4%
Simplified52.4%
flip--46.0%
add-sqr-sqrt39.3%
add-sqr-sqrt46.0%
Applied egg-rr52.4%
associate--l+46.4%
+-inverses46.4%
metadata-eval46.4%
+-commutative46.4%
Simplified53.6%
Final simplification40.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= t 4e+15)
(+
(+ (- 1.0 (sqrt x)) (- t_1 (sqrt y)))
(- (+ (sqrt (+ 1.0 t)) (- 1.0 (sqrt t))) (sqrt z)))
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (/ 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((1.0 + y));
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - sqrt(x)) + (t_1 - sqrt(y))) + ((sqrt((1.0 + t)) + (1.0 - sqrt(t))) - sqrt(z));
} else {
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (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) :: tmp
t_1 = sqrt((1.0d0 + y))
if (t <= 4d+15) then
tmp = ((1.0d0 - sqrt(x)) + (t_1 - sqrt(y))) + ((sqrt((1.0d0 + t)) + (1.0d0 - sqrt(t))) - sqrt(z))
else
tmp = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (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((1.0 + y));
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - Math.sqrt(x)) + (t_1 - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) + (1.0 - Math.sqrt(t))) - Math.sqrt(z));
} else {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (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((1.0 + y)) tmp = 0 if t <= 4e+15: tmp = ((1.0 - math.sqrt(x)) + (t_1 - math.sqrt(y))) + ((math.sqrt((1.0 + t)) + (1.0 - math.sqrt(t))) - math.sqrt(z)) else: tmp = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (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(1.0 + y)) tmp = 0.0 if (t <= 4e+15) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(t_1 - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(1.0 - sqrt(t))) - sqrt(z))); else tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + 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((1.0 + y));
tmp = 0.0;
if (t <= 4e+15)
tmp = ((1.0 - sqrt(x)) + (t_1 - sqrt(y))) + ((sqrt((1.0 + t)) + (1.0 - sqrt(t))) - sqrt(z));
else
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (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[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 4e+15], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $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{1 + y}\\
\mathbf{if}\;t \leq 4 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} + \left(1 - \sqrt{t}\right)\right) - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + \frac{1}{\sqrt{y} + t\_1}\right)\\
\end{array}
\end{array}
if t < 4e15Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 47.7%
Taylor expanded in z around 0 25.0%
associate--r+25.0%
+-commutative25.0%
associate--l+25.0%
Simplified25.0%
if 4e15 < t Initial program 85.0%
associate-+l+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
flip--85.1%
add-sqr-sqrt71.6%
+-commutative71.6%
add-sqr-sqrt85.5%
+-commutative85.5%
Applied egg-rr85.5%
associate--l+89.7%
+-inverses89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in t around inf 89.7%
flip--89.9%
add-sqr-sqrt71.8%
add-sqr-sqrt90.1%
Applied egg-rr90.1%
associate--l+93.6%
+-inverses93.6%
metadata-eval93.6%
+-commutative93.6%
Simplified93.6%
flip--44.2%
add-sqr-sqrt38.4%
add-sqr-sqrt44.2%
Applied egg-rr93.6%
associate--l+44.3%
+-inverses44.3%
metadata-eval44.3%
+-commutative44.3%
Simplified94.9%
Final simplification56.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 y)) (sqrt y))))
(if (<= t 4e+15)
(+
(+ (- 1.0 (sqrt x)) t_1)
(- (+ (sqrt (+ 1.0 t)) (- 1.0 (sqrt t))) (sqrt z)))
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - sqrt(x)) + t_1) + ((sqrt((1.0 + t)) + (1.0 - sqrt(t))) - sqrt(z));
} else {
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
if (t <= 4d+15) then
tmp = ((1.0d0 - sqrt(x)) + t_1) + ((sqrt((1.0d0 + t)) + (1.0d0 - sqrt(t))) - sqrt(z))
else
tmp = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - Math.sqrt(x)) + t_1) + ((Math.sqrt((1.0 + t)) + (1.0 - Math.sqrt(t))) - Math.sqrt(z));
} else {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if t <= 4e+15: tmp = ((1.0 - math.sqrt(x)) + t_1) + ((math.sqrt((1.0 + t)) + (1.0 - math.sqrt(t))) - math.sqrt(z)) else: tmp = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (t <= 4e+15) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + t_1) + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(1.0 - sqrt(t))) - sqrt(z))); else tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (t <= 4e+15)
tmp = ((1.0 - sqrt(x)) + t_1) + ((sqrt((1.0 + t)) + (1.0 - sqrt(t))) - sqrt(z));
else
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 4e+15], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;t \leq 4 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + t\_1\right) + \left(\left(\sqrt{1 + t} + \left(1 - \sqrt{t}\right)\right) - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + t\_1\right)\\
\end{array}
\end{array}
if t < 4e15Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 47.7%
Taylor expanded in z around 0 25.0%
associate--r+25.0%
+-commutative25.0%
associate--l+25.0%
Simplified25.0%
if 4e15 < t Initial program 85.0%
associate-+l+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
flip--85.1%
add-sqr-sqrt71.6%
+-commutative71.6%
add-sqr-sqrt85.5%
+-commutative85.5%
Applied egg-rr85.5%
associate--l+89.7%
+-inverses89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in t around inf 89.7%
flip--89.9%
add-sqr-sqrt71.8%
add-sqr-sqrt90.1%
Applied egg-rr90.1%
associate--l+93.6%
+-inverses93.6%
metadata-eval93.6%
+-commutative93.6%
Simplified93.6%
Final simplification56.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= t 4e+15)
(+
(+ (- 1.0 (sqrt x)) t_1)
(- (+ (sqrt (+ 1.0 t)) (- 1.0 (sqrt t))) (sqrt z)))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - sqrt(x)) + t_1) + ((sqrt((1.0 + t)) + (1.0 - sqrt(t))) - sqrt(z));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
if (t <= 4d+15) then
tmp = ((1.0d0 - sqrt(x)) + t_1) + ((sqrt((1.0d0 + t)) + (1.0d0 - sqrt(t))) - sqrt(z))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - Math.sqrt(x)) + t_1) + ((Math.sqrt((1.0 + t)) + (1.0 - Math.sqrt(t))) - Math.sqrt(z));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if t <= 4e+15: tmp = ((1.0 - math.sqrt(x)) + t_1) + ((math.sqrt((1.0 + t)) + (1.0 - math.sqrt(t))) - math.sqrt(z)) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (t <= 4e+15) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + t_1) + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(1.0 - sqrt(t))) - sqrt(z))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (t <= 4e+15)
tmp = ((1.0 - sqrt(x)) + t_1) + ((sqrt((1.0 + t)) + (1.0 - sqrt(t))) - sqrt(z));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 4e+15], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;t \leq 4 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + t\_1\right) + \left(\left(\sqrt{1 + t} + \left(1 - \sqrt{t}\right)\right) - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + t\_1\right)\\
\end{array}
\end{array}
if t < 4e15Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 47.7%
Taylor expanded in z around 0 25.0%
associate--r+25.0%
+-commutative25.0%
associate--l+25.0%
Simplified25.0%
if 4e15 < t Initial program 85.0%
associate-+l+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
flip--85.1%
add-sqr-sqrt71.6%
+-commutative71.6%
add-sqr-sqrt85.5%
+-commutative85.5%
Applied egg-rr85.5%
associate--l+89.7%
+-inverses89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in t around inf 89.7%
Final simplification54.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 1100000000.0)
(+
(+ (- 1.0 (sqrt x)) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(- t_1 (sqrt z)))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (* 0.5 (sqrt (/ 1.0 y))))
(/ 1.0 (+ (sqrt z) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 1100000000.0) {
tmp = ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (t_1 - sqrt(z));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + (1.0 / (sqrt(z) + t_1));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 1100000000.0d0) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + (t_1 - sqrt(z))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (1.0d0 / (sqrt(z) + t_1))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 1100000000.0) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + (t_1 - Math.sqrt(z));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (0.5 * Math.sqrt((1.0 / y)))) + (1.0 / (Math.sqrt(z) + t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 1100000000.0: tmp = ((1.0 - math.sqrt(x)) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + (t_1 - math.sqrt(z)) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (0.5 * math.sqrt((1.0 / y)))) + (1.0 / (math.sqrt(z) + t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 1100000000.0) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + Float64(t_1 - sqrt(z))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(1.0 / Float64(sqrt(z) + t_1))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 1100000000.0)
tmp = ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (t_1 - sqrt(z));
else
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + (1.0 / (sqrt(z) + t_1));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1100000000.0], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 1100000000:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + \left(t\_1 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \frac{1}{\sqrt{z} + t\_1}\\
\end{array}
\end{array}
if y < 1.1e9Initial program 97.8%
associate-+l+97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 51.7%
flip--51.7%
add-sqr-sqrt51.7%
add-sqr-sqrt51.7%
Applied egg-rr51.7%
associate--l+51.7%
+-inverses51.7%
metadata-eval51.7%
+-commutative51.7%
Simplified51.7%
Taylor expanded in t around inf 29.6%
if 1.1e9 < y Initial program 84.9%
associate-+l+84.9%
+-commutative84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
flip--85.2%
add-sqr-sqrt69.6%
+-commutative69.6%
add-sqr-sqrt85.7%
+-commutative85.7%
Applied egg-rr85.7%
associate--l+89.5%
+-inverses89.5%
metadata-eval89.5%
Simplified89.5%
Taylor expanded in t around inf 45.8%
flip--45.8%
add-sqr-sqrt36.7%
add-sqr-sqrt45.9%
Applied egg-rr45.9%
associate--l+48.9%
+-inverses48.9%
metadata-eval48.9%
+-commutative48.9%
Simplified48.9%
Taylor expanded in y around inf 50.2%
Final simplification39.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= x 1e-11)
(+ (+ (- 1.0 (sqrt x)) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y))))) t_1)
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (* 0.5 (sqrt (/ 1.0 y))))
t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (x <= 1e-11) {
tmp = ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + t_1;
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (x <= 1d-11) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + t_1
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (0.5d0 * sqrt((1.0d0 / y)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (x <= 1e-11) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + t_1;
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (0.5 * Math.sqrt((1.0 / y)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if x <= 1e-11: tmp = ((1.0 - math.sqrt(x)) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + t_1 else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (0.5 * math.sqrt((1.0 / y)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (x <= 1e-11) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + t_1); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (x <= 1e-11)
tmp = ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + t_1;
else
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1e-11], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;x \leq 10^{-11}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + t\_1\\
\end{array}
\end{array}
if x < 9.99999999999999939e-12Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 97.4%
flip--97.4%
add-sqr-sqrt81.2%
add-sqr-sqrt97.4%
Applied egg-rr97.4%
associate--l+98.3%
+-inverses98.3%
metadata-eval98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in t around inf 54.7%
if 9.99999999999999939e-12 < x Initial program 86.0%
associate-+l+86.0%
+-commutative86.0%
+-commutative86.0%
+-commutative86.0%
Simplified86.0%
flip--86.3%
add-sqr-sqrt56.6%
+-commutative56.6%
add-sqr-sqrt86.8%
+-commutative86.8%
Applied egg-rr86.8%
associate--l+90.6%
+-inverses90.6%
metadata-eval90.6%
Simplified90.6%
Taylor expanded in t around inf 48.8%
Taylor expanded in y around inf 26.1%
Final simplification39.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= x 9.2e-12)
(+
(+ (- 1.0 (sqrt x)) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(- (sqrt (+ 1.0 z)) (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 tmp;
if (x <= 9.2e-12) {
tmp = ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (sqrt((1.0 + z)) - 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) :: tmp
if (x <= 9.2d-12) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + (sqrt((1.0d0 + z)) - 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 tmp;
if (x <= 9.2e-12) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + (Math.sqrt((1.0 + z)) - 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): tmp = 0 if x <= 9.2e-12: tmp = ((1.0 - math.sqrt(x)) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + (math.sqrt((1.0 + z)) - 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) tmp = 0.0 if (x <= 9.2e-12) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + Float64(sqrt(Float64(1.0 + z)) - 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)
tmp = 0.0;
if (x <= 9.2e-12)
tmp = ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (sqrt((1.0 + z)) - 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_] := If[LessEqual[x, 9.2e-12], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - 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}
\mathbf{if}\;x \leq 9.2 \cdot 10^{-12}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if x < 9.19999999999999957e-12Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 97.4%
flip--97.4%
add-sqr-sqrt81.2%
add-sqr-sqrt97.4%
Applied egg-rr97.4%
associate--l+98.3%
+-inverses98.3%
metadata-eval98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in t around inf 54.7%
if 9.19999999999999957e-12 < x Initial program 86.0%
+-commutative86.0%
associate-+r+86.0%
associate-+r-84.5%
associate-+l-62.2%
associate-+r-47.0%
Simplified46.8%
Taylor expanded in t around inf 7.1%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.7%
mul-1-neg4.7%
Simplified4.7%
flip-+4.8%
add-sqr-sqrt5.3%
pow25.3%
Applied egg-rr5.3%
associate--l+8.8%
unpow28.7%
sqr-neg8.7%
rem-square-sqrt11.0%
sub-neg11.0%
remove-double-neg11.0%
+-commutative11.0%
Simplified11.0%
Final simplification31.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 1e-11)
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (- 1.0 (sqrt x)) (- (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 (x <= 1e-11) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 - sqrt(x)) + (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 (x <= 1d-11) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 - sqrt(x)) + (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 (x <= 1e-11) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 - Math.sqrt(x)) + (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 x <= 1e-11: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 - math.sqrt(x)) + (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 (x <= 1e-11) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 - sqrt(x)) + Float64(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 (x <= 1e-11)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 - sqrt(x)) + (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[x, 1e-11], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $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}\;x \leq 10^{-11}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if x < 9.99999999999999939e-12Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 97.4%
Taylor expanded in t around inf 54.5%
if 9.99999999999999939e-12 < x Initial program 86.0%
+-commutative86.0%
associate-+r+86.0%
associate-+r-84.5%
associate-+l-62.2%
associate-+r-47.0%
Simplified46.8%
Taylor expanded in t around inf 7.1%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.7%
mul-1-neg4.7%
Simplified4.7%
flip-+4.8%
add-sqr-sqrt5.3%
pow25.3%
Applied egg-rr5.3%
associate--l+8.8%
unpow28.7%
sqr-neg8.7%
rem-square-sqrt11.0%
sub-neg11.0%
remove-double-neg11.0%
+-commutative11.0%
Simplified11.0%
Final simplification31.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 8e-23)
(+
2.0
(- (+ (sqrt (+ 1.0 z)) (* 0.5 y)) (+ (sqrt y) (+ (sqrt x) (sqrt z)))))
(if (<= y 8e+14)
(+
1.0
(+ (sqrt (+ 1.0 y)) (- (* 0.5 (sqrt (/ 1.0 z))) (+ (sqrt x) (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 <= 8e-23) {
tmp = 2.0 + ((sqrt((1.0 + z)) + (0.5 * y)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
} else if (y <= 8e+14) {
tmp = 1.0 + (sqrt((1.0 + y)) + ((0.5 * sqrt((1.0 / z))) - (sqrt(x) + 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 <= 8d-23) then
tmp = 2.0d0 + ((sqrt((1.0d0 + z)) + (0.5d0 * y)) - (sqrt(y) + (sqrt(x) + sqrt(z))))
else if (y <= 8d+14) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) + ((0.5d0 * sqrt((1.0d0 / z))) - (sqrt(x) + 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 <= 8e-23) {
tmp = 2.0 + ((Math.sqrt((1.0 + z)) + (0.5 * y)) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z))));
} else if (y <= 8e+14) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) + ((0.5 * Math.sqrt((1.0 / z))) - (Math.sqrt(x) + 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 <= 8e-23: tmp = 2.0 + ((math.sqrt((1.0 + z)) + (0.5 * y)) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z)))) elif y <= 8e+14: tmp = 1.0 + (math.sqrt((1.0 + y)) + ((0.5 * math.sqrt((1.0 / z))) - (math.sqrt(x) + 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 <= 8e-23) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) + Float64(0.5 * y)) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z))))); elseif (y <= 8e+14) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - Float64(sqrt(x) + 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 <= 8e-23)
tmp = 2.0 + ((sqrt((1.0 + z)) + (0.5 * y)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
elseif (y <= 8e+14)
tmp = 1.0 + (sqrt((1.0 + y)) + ((0.5 * sqrt((1.0 / z))) - (sqrt(x) + 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, 8e-23], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(0.5 * y), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+14], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $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 8 \cdot 10^{-23}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + z} + 0.5 \cdot y\right) - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+14}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} + \left(0.5 \cdot \sqrt{\frac{1}{z}} - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 7.99999999999999968e-23Initial program 97.7%
+-commutative97.7%
associate-+r+97.7%
associate-+r-97.7%
associate-+l-97.7%
associate-+r-97.7%
Simplified79.4%
Taylor expanded in t around inf 24.6%
associate--l+28.4%
+-commutative28.4%
+-commutative28.4%
+-commutative28.4%
associate-+l+28.4%
+-commutative28.4%
Simplified28.4%
Taylor expanded in x around 0 19.3%
Taylor expanded in y around 0 19.3%
associate--l+33.8%
+-commutative33.8%
associate-+l+33.8%
+-commutative33.8%
Simplified33.8%
if 7.99999999999999968e-23 < y < 8e14Initial program 97.1%
+-commutative97.1%
associate-+r+97.0%
associate-+r-97.1%
associate-+l-97.1%
associate-+r-97.2%
Simplified69.3%
Taylor expanded in t around inf 11.9%
associate--l+20.2%
+-commutative20.2%
+-commutative20.2%
+-commutative20.2%
associate-+l+20.2%
+-commutative20.2%
Simplified20.2%
Taylor expanded in x around 0 11.0%
Taylor expanded in z around inf 22.4%
associate--l+22.4%
associate--l+22.4%
Simplified22.4%
if 8e14 < y Initial program 84.9%
+-commutative84.9%
associate-+r+84.9%
associate-+r-51.9%
associate-+l-26.1%
associate-+r-6.5%
Simplified6.2%
Taylor expanded in t around inf 3.7%
associate--l+18.7%
+-commutative18.7%
+-commutative18.7%
+-commutative18.7%
associate-+l+18.7%
+-commutative18.7%
Simplified18.7%
Taylor expanded in x around inf 18.2%
mul-1-neg18.2%
Simplified18.2%
flip-+18.3%
add-sqr-sqrt18.6%
pow218.6%
Applied egg-rr18.6%
associate--l+21.4%
unpow221.4%
sqr-neg21.4%
rem-square-sqrt23.4%
sub-neg23.4%
remove-double-neg23.4%
+-commutative23.4%
Simplified23.4%
Final simplification28.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 550000.0)
(- (+ (sqrt (+ 1.0 z)) 2.0) (+ (sqrt x) (+ (sqrt z) (sqrt y))))
(+
1.0
(+ (sqrt (+ 1.0 y)) (- (* 0.5 (sqrt (/ 1.0 z))) (+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 550000.0) {
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(x) + (sqrt(z) + sqrt(y)));
} else {
tmp = 1.0 + (sqrt((1.0 + y)) + ((0.5 * sqrt((1.0 / z))) - (sqrt(x) + 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) :: tmp
if (z <= 550000.0d0) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - (sqrt(x) + (sqrt(z) + sqrt(y)))
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) + ((0.5d0 * sqrt((1.0d0 / z))) - (sqrt(x) + 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 tmp;
if (z <= 550000.0) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y)));
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) + ((0.5 * Math.sqrt((1.0 / z))) - (Math.sqrt(x) + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 550000.0: tmp = (math.sqrt((1.0 + z)) + 2.0) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y))) else: tmp = 1.0 + (math.sqrt((1.0 + y)) + ((0.5 * math.sqrt((1.0 / z))) - (math.sqrt(x) + math.sqrt(y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 550000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y)))); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - Float64(sqrt(x) + sqrt(y))))); 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 <= 550000.0)
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(x) + (sqrt(z) + sqrt(y)));
else
tmp = 1.0 + (sqrt((1.0 + y)) + ((0.5 * sqrt((1.0 / z))) - (sqrt(x) + 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_] := If[LessEqual[z, 550000.0], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $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 550000:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} + \left(0.5 \cdot \sqrt{\frac{1}{z}} - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\end{array}
\end{array}
if z < 5.5e5Initial program 97.2%
+-commutative97.2%
associate-+r+97.2%
associate-+r-82.7%
associate-+l-69.2%
associate-+r-51.5%
Simplified52.1%
Taylor expanded in t around inf 21.8%
associate--l+25.3%
+-commutative25.3%
+-commutative25.3%
+-commutative25.3%
associate-+l+25.3%
+-commutative25.3%
Simplified25.3%
Taylor expanded in x around 0 17.6%
Taylor expanded in y around 0 16.5%
if 5.5e5 < z Initial program 84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+r-65.6%
associate-+l-53.6%
associate-+r-53.4%
Simplified31.3%
Taylor expanded in t around inf 3.9%
associate--l+20.7%
+-commutative20.7%
+-commutative20.7%
+-commutative20.7%
associate-+l+20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in x around 0 2.8%
Taylor expanded in z around inf 15.7%
associate--l+31.6%
associate--l+31.6%
Simplified31.6%
Final simplification23.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 (<= z 0.21) (- (+ 3.0 (* 0.5 z)) (+ (sqrt x) (+ (sqrt z) (sqrt y)))) (+ (sqrt (+ x 1.0)) (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.21) {
tmp = (3.0 + (0.5 * z)) - (sqrt(x) + (sqrt(z) + sqrt(y)));
} else {
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + 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) :: tmp
if (z <= 0.21d0) then
tmp = (3.0d0 + (0.5d0 * z)) - (sqrt(x) + (sqrt(z) + sqrt(y)))
else
tmp = sqrt((x + 1.0d0)) + (sqrt((1.0d0 + y)) - (sqrt(x) + 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 tmp;
if (z <= 0.21) {
tmp = (3.0 + (0.5 * z)) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y)));
} else {
tmp = Math.sqrt((x + 1.0)) + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.21: tmp = (3.0 + (0.5 * z)) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y))) else: tmp = math.sqrt((x + 1.0)) + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) 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(Float64(3.0 + Float64(0.5 * z)) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y)))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); 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 = (3.0 + (0.5 * z)) - (sqrt(x) + (sqrt(z) + sqrt(y)));
else
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + 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_] := If[LessEqual[z, 0.21], N[(N[(3.0 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $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:\\
\;\;\;\;\left(3 + 0.5 \cdot z\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 0.209999999999999992Initial program 97.3%
+-commutative97.3%
associate-+r+97.3%
associate-+r-82.9%
associate-+l-69.1%
associate-+r-51.6%
Simplified52.2%
Taylor expanded in t around inf 21.5%
associate--l+25.0%
+-commutative25.0%
+-commutative25.0%
+-commutative25.0%
associate-+l+25.0%
+-commutative25.0%
Simplified25.0%
Taylor expanded in x around 0 17.4%
Taylor expanded in z around 0 17.4%
Taylor expanded in y around 0 16.2%
*-commutative16.2%
Simplified16.2%
if 0.209999999999999992 < z Initial program 84.5%
+-commutative84.5%
associate-+r+84.5%
associate-+r-65.9%
associate-+l-54.2%
associate-+r-53.2%
Simplified31.8%
Taylor expanded in t around inf 4.8%
associate--l+21.3%
+-commutative21.3%
+-commutative21.3%
+-commutative21.3%
associate-+l+21.3%
+-commutative21.3%
Simplified21.3%
Taylor expanded in z around inf 29.1%
Final simplification22.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 (<= z 6200000000.0) (+ (sqrt (+ 1.0 z)) (- 2.0 (+ (sqrt y) (+ (sqrt x) (sqrt z))))) (+ (sqrt (+ x 1.0)) (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 6200000000.0) {
tmp = sqrt((1.0 + z)) + (2.0 - (sqrt(y) + (sqrt(x) + sqrt(z))));
} else {
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + 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) :: tmp
if (z <= 6200000000.0d0) then
tmp = sqrt((1.0d0 + z)) + (2.0d0 - (sqrt(y) + (sqrt(x) + sqrt(z))))
else
tmp = sqrt((x + 1.0d0)) + (sqrt((1.0d0 + y)) - (sqrt(x) + 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 tmp;
if (z <= 6200000000.0) {
tmp = Math.sqrt((1.0 + z)) + (2.0 - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z))));
} else {
tmp = Math.sqrt((x + 1.0)) + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 6200000000.0: tmp = math.sqrt((1.0 + z)) + (2.0 - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z)))) else: tmp = math.sqrt((x + 1.0)) + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 6200000000.0) tmp = Float64(sqrt(Float64(1.0 + z)) + Float64(2.0 - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z))))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); 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 <= 6200000000.0)
tmp = sqrt((1.0 + z)) + (2.0 - (sqrt(y) + (sqrt(x) + sqrt(z))));
else
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + 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_] := If[LessEqual[z, 6200000000.0], N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6200000000:\\
\;\;\;\;\sqrt{1 + z} + \left(2 - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 6.2e9Initial program 97.2%
+-commutative97.2%
associate-+r+97.2%
associate-+r-82.7%
associate-+l-69.2%
associate-+r-51.5%
Simplified52.1%
Taylor expanded in t around inf 21.8%
associate--l+25.3%
+-commutative25.3%
+-commutative25.3%
+-commutative25.3%
associate-+l+25.3%
+-commutative25.3%
Simplified25.3%
Taylor expanded in x around 0 17.6%
Taylor expanded in y around 0 16.5%
+-commutative16.5%
associate--l+16.5%
+-commutative16.5%
associate-+l+16.5%
+-commutative16.5%
Simplified16.5%
if 6.2e9 < z Initial program 84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+r-65.6%
associate-+l-53.6%
associate-+r-53.4%
Simplified31.3%
Taylor expanded in t around inf 3.9%
associate--l+20.7%
+-commutative20.7%
+-commutative20.7%
+-commutative20.7%
associate-+l+20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in z around inf 29.5%
Final simplification22.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 (<= z 5000000000.0) (- (+ (sqrt (+ 1.0 z)) 2.0) (+ (sqrt x) (+ (sqrt z) (sqrt y)))) (+ (sqrt (+ x 1.0)) (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5000000000.0) {
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(x) + (sqrt(z) + sqrt(y)));
} else {
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + 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) :: tmp
if (z <= 5000000000.0d0) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - (sqrt(x) + (sqrt(z) + sqrt(y)))
else
tmp = sqrt((x + 1.0d0)) + (sqrt((1.0d0 + y)) - (sqrt(x) + 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 tmp;
if (z <= 5000000000.0) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y)));
} else {
tmp = Math.sqrt((x + 1.0)) + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 5000000000.0: tmp = (math.sqrt((1.0 + z)) + 2.0) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y))) else: tmp = math.sqrt((x + 1.0)) + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 5000000000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y)))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); 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 <= 5000000000.0)
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(x) + (sqrt(z) + sqrt(y)));
else
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + 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_] := If[LessEqual[z, 5000000000.0], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5000000000:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 5e9Initial program 97.2%
+-commutative97.2%
associate-+r+97.2%
associate-+r-82.7%
associate-+l-69.2%
associate-+r-51.5%
Simplified52.1%
Taylor expanded in t around inf 21.8%
associate--l+25.3%
+-commutative25.3%
+-commutative25.3%
+-commutative25.3%
associate-+l+25.3%
+-commutative25.3%
Simplified25.3%
Taylor expanded in x around 0 17.6%
Taylor expanded in y around 0 16.5%
if 5e9 < z Initial program 84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+r-65.6%
associate-+l-53.6%
associate-+r-53.4%
Simplified31.3%
Taylor expanded in t around inf 3.9%
associate--l+20.7%
+-commutative20.7%
+-commutative20.7%
+-commutative20.7%
associate-+l+20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in z around inf 29.5%
Final simplification22.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 y))))
(if (<= z 3.05)
(- (+ 2.0 (+ t_1 (* 0.5 z))) (sqrt z))
(if (<= z 1e+143)
(+ t_1 (- 1.0 (+ (sqrt x) (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 + y));
double tmp;
if (z <= 3.05) {
tmp = (2.0 + (t_1 + (0.5 * z))) - sqrt(z);
} else if (z <= 1e+143) {
tmp = t_1 + (1.0 - (sqrt(x) + 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 + y))
if (z <= 3.05d0) then
tmp = (2.0d0 + (t_1 + (0.5d0 * z))) - sqrt(z)
else if (z <= 1d+143) then
tmp = t_1 + (1.0d0 - (sqrt(x) + 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 + y));
double tmp;
if (z <= 3.05) {
tmp = (2.0 + (t_1 + (0.5 * z))) - Math.sqrt(z);
} else if (z <= 1e+143) {
tmp = t_1 + (1.0 - (Math.sqrt(x) + 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 + y)) tmp = 0 if z <= 3.05: tmp = (2.0 + (t_1 + (0.5 * z))) - math.sqrt(z) elif z <= 1e+143: tmp = t_1 + (1.0 - (math.sqrt(x) + 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 + y)) tmp = 0.0 if (z <= 3.05) tmp = Float64(Float64(2.0 + Float64(t_1 + Float64(0.5 * z))) - sqrt(z)); elseif (z <= 1e+143) tmp = Float64(t_1 + Float64(1.0 - Float64(sqrt(x) + 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 + y));
tmp = 0.0;
if (z <= 3.05)
tmp = (2.0 + (t_1 + (0.5 * z))) - sqrt(z);
elseif (z <= 1e+143)
tmp = t_1 + (1.0 - (sqrt(x) + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.05], N[(N[(2.0 + N[(t$95$1 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+143], N[(t$95$1 + N[(1.0 - 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] + 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 + y}\\
\mathbf{if}\;z \leq 3.05:\\
\;\;\;\;\left(2 + \left(t\_1 + 0.5 \cdot z\right)\right) - \sqrt{z}\\
\mathbf{elif}\;z \leq 10^{+143}:\\
\;\;\;\;t\_1 + \left(1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if z < 3.0499999999999998Initial program 97.2%
+-commutative97.2%
associate-+r+97.2%
associate-+r-82.9%
associate-+l-69.2%
associate-+r-51.9%
Simplified52.5%
Taylor expanded in t around inf 21.5%
associate--l+25.0%
+-commutative25.0%
+-commutative25.0%
+-commutative25.0%
associate-+l+25.0%
+-commutative25.0%
Simplified25.0%
Taylor expanded in x around 0 17.3%
Taylor expanded in z around 0 17.3%
Taylor expanded in z around inf 30.4%
if 3.0499999999999998 < z < 1e143Initial program 81.6%
+-commutative81.6%
associate-+r+81.6%
associate-+r-60.8%
associate-+l-49.2%
associate-+r-46.8%
Simplified32.1%
Taylor expanded in t around inf 6.6%
associate--l+22.8%
+-commutative22.8%
+-commutative22.8%
+-commutative22.8%
associate-+l+22.8%
+-commutative22.8%
Simplified22.8%
Taylor expanded in x around 0 4.7%
Taylor expanded in z around inf 9.9%
+-commutative9.9%
associate--l+9.9%
Simplified9.9%
if 1e143 < z Initial program 86.8%
+-commutative86.8%
associate-+r+86.8%
associate-+r-69.7%
associate-+l-57.8%
associate-+r-57.8%
Simplified30.9%
Taylor expanded in t around inf 3.2%
associate--l+20.0%
+-commutative20.0%
+-commutative20.0%
+-commutative20.0%
associate-+l+20.0%
+-commutative20.0%
Simplified20.0%
Taylor expanded in x around inf 20.1%
mul-1-neg20.1%
Simplified20.1%
flip-+20.4%
add-sqr-sqrt20.5%
pow220.5%
Applied egg-rr20.5%
associate--l+24.3%
unpow224.3%
sqr-neg24.3%
rem-square-sqrt26.2%
sub-neg26.2%
remove-double-neg26.2%
+-commutative26.2%
Simplified26.2%
Final simplification25.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 y))))
(if (<= z 2.8)
(- (+ 2.0 (+ t_1 (* 0.5 z))) (sqrt z))
(if (<= z 1.55e+143)
(- (+ 1.0 t_1) (+ (sqrt x) (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 + y));
double tmp;
if (z <= 2.8) {
tmp = (2.0 + (t_1 + (0.5 * z))) - sqrt(z);
} else if (z <= 1.55e+143) {
tmp = (1.0 + t_1) - (sqrt(x) + 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 + y))
if (z <= 2.8d0) then
tmp = (2.0d0 + (t_1 + (0.5d0 * z))) - sqrt(z)
else if (z <= 1.55d+143) then
tmp = (1.0d0 + t_1) - (sqrt(x) + 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 + y));
double tmp;
if (z <= 2.8) {
tmp = (2.0 + (t_1 + (0.5 * z))) - Math.sqrt(z);
} else if (z <= 1.55e+143) {
tmp = (1.0 + t_1) - (Math.sqrt(x) + 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 + y)) tmp = 0 if z <= 2.8: tmp = (2.0 + (t_1 + (0.5 * z))) - math.sqrt(z) elif z <= 1.55e+143: tmp = (1.0 + t_1) - (math.sqrt(x) + 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 + y)) tmp = 0.0 if (z <= 2.8) tmp = Float64(Float64(2.0 + Float64(t_1 + Float64(0.5 * z))) - sqrt(z)); elseif (z <= 1.55e+143) tmp = Float64(Float64(1.0 + t_1) - Float64(sqrt(x) + 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 + y));
tmp = 0.0;
if (z <= 2.8)
tmp = (2.0 + (t_1 + (0.5 * z))) - sqrt(z);
elseif (z <= 1.55e+143)
tmp = (1.0 + t_1) - (sqrt(x) + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.8], N[(N[(2.0 + N[(t$95$1 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+143], N[(N[(1.0 + t$95$1), $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] + 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 + y}\\
\mathbf{if}\;z \leq 2.8:\\
\;\;\;\;\left(2 + \left(t\_1 + 0.5 \cdot z\right)\right) - \sqrt{z}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+143}:\\
\;\;\;\;\left(1 + t\_1\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if z < 2.7999999999999998Initial program 97.2%
+-commutative97.2%
associate-+r+97.2%
associate-+r-82.9%
associate-+l-69.2%
associate-+r-51.9%
Simplified52.5%
Taylor expanded in t around inf 21.5%
associate--l+25.0%
+-commutative25.0%
+-commutative25.0%
+-commutative25.0%
associate-+l+25.0%
+-commutative25.0%
Simplified25.0%
Taylor expanded in x around 0 17.3%
Taylor expanded in z around 0 17.3%
Taylor expanded in z around inf 30.4%
if 2.7999999999999998 < z < 1.54999999999999995e143Initial program 81.6%
+-commutative81.6%
associate-+r+81.6%
associate-+r-60.8%
associate-+l-49.2%
associate-+r-46.8%
Simplified32.1%
Taylor expanded in t around inf 6.6%
associate--l+22.8%
+-commutative22.8%
+-commutative22.8%
+-commutative22.8%
associate-+l+22.8%
+-commutative22.8%
Simplified22.8%
Taylor expanded in x around 0 4.7%
Taylor expanded in z around inf 9.9%
if 1.54999999999999995e143 < z Initial program 86.8%
+-commutative86.8%
associate-+r+86.8%
associate-+r-69.7%
associate-+l-57.8%
associate-+r-57.8%
Simplified30.9%
Taylor expanded in t around inf 3.2%
associate--l+20.0%
+-commutative20.0%
+-commutative20.0%
+-commutative20.0%
associate-+l+20.0%
+-commutative20.0%
Simplified20.0%
Taylor expanded in x around inf 20.1%
mul-1-neg20.1%
Simplified20.1%
flip-+20.4%
add-sqr-sqrt20.5%
pow220.5%
Applied egg-rr20.5%
associate--l+24.3%
unpow224.3%
sqr-neg24.3%
rem-square-sqrt26.2%
sub-neg26.2%
remove-double-neg26.2%
+-commutative26.2%
Simplified26.2%
Final simplification25.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 1.5)
(- (+ 3.0 (* 0.5 z)) (+ (sqrt x) (+ (sqrt z) (sqrt y))))
(if (<= z 1.26e+143)
(- (+ 1.0 (sqrt (+ 1.0 y))) (+ (sqrt x) (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 (z <= 1.5) {
tmp = (3.0 + (0.5 * z)) - (sqrt(x) + (sqrt(z) + sqrt(y)));
} else if (z <= 1.26e+143) {
tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(x) + 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 (z <= 1.5d0) then
tmp = (3.0d0 + (0.5d0 * z)) - (sqrt(x) + (sqrt(z) + sqrt(y)))
else if (z <= 1.26d+143) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - (sqrt(x) + 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 (z <= 1.5) {
tmp = (3.0 + (0.5 * z)) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y)));
} else if (z <= 1.26e+143) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - (Math.sqrt(x) + 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 z <= 1.5: tmp = (3.0 + (0.5 * z)) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y))) elif z <= 1.26e+143: tmp = (1.0 + math.sqrt((1.0 + y))) - (math.sqrt(x) + 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 (z <= 1.5) tmp = Float64(Float64(3.0 + Float64(0.5 * z)) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y)))); elseif (z <= 1.26e+143) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - Float64(sqrt(x) + 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 (z <= 1.5)
tmp = (3.0 + (0.5 * z)) - (sqrt(x) + (sqrt(z) + sqrt(y)));
elseif (z <= 1.26e+143)
tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(x) + 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[z, 1.5], N[(N[(3.0 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.26e+143], N[(N[(1.0 + 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] + 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}\;z \leq 1.5:\\
\;\;\;\;\left(3 + 0.5 \cdot z\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{+143}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if z < 1.5Initial program 97.3%
+-commutative97.3%
associate-+r+97.3%
associate-+r-82.9%
associate-+l-69.1%
associate-+r-51.6%
Simplified52.2%
Taylor expanded in t around inf 21.5%
associate--l+25.0%
+-commutative25.0%
+-commutative25.0%
+-commutative25.0%
associate-+l+25.0%
+-commutative25.0%
Simplified25.0%
Taylor expanded in x around 0 17.4%
Taylor expanded in z around 0 17.4%
Taylor expanded in y around 0 16.2%
*-commutative16.2%
Simplified16.2%
if 1.5 < z < 1.2600000000000001e143Initial program 81.7%
+-commutative81.7%
associate-+r+81.7%
associate-+r-61.2%
associate-+l-49.8%
associate-+r-47.5%
Simplified33.1%
Taylor expanded in t around inf 6.9%
associate--l+22.9%
+-commutative22.9%
+-commutative22.9%
+-commutative22.9%
associate-+l+22.9%
+-commutative22.9%
Simplified22.9%
Taylor expanded in x around 0 4.6%
Taylor expanded in z around inf 9.7%
if 1.2600000000000001e143 < z Initial program 86.8%
+-commutative86.8%
associate-+r+86.8%
associate-+r-69.7%
associate-+l-57.8%
associate-+r-57.8%
Simplified30.9%
Taylor expanded in t around inf 3.2%
associate--l+20.0%
+-commutative20.0%
+-commutative20.0%
+-commutative20.0%
associate-+l+20.0%
+-commutative20.0%
Simplified20.0%
Taylor expanded in x around inf 20.1%
mul-1-neg20.1%
Simplified20.1%
flip-+20.4%
add-sqr-sqrt20.5%
pow220.5%
Applied egg-rr20.5%
associate--l+24.3%
unpow224.3%
sqr-neg24.3%
rem-square-sqrt26.2%
sub-neg26.2%
remove-double-neg26.2%
+-commutative26.2%
Simplified26.2%
Final simplification17.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 2.8) (- (+ 2.0 (+ (sqrt (+ 1.0 y)) (* 0.5 z))) (sqrt z)) (- (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 (z <= 2.8) {
tmp = (2.0 + (sqrt((1.0 + y)) + (0.5 * z))) - sqrt(z);
} 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 (z <= 2.8d0) then
tmp = (2.0d0 + (sqrt((1.0d0 + y)) + (0.5d0 * z))) - sqrt(z)
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 (z <= 2.8) {
tmp = (2.0 + (Math.sqrt((1.0 + y)) + (0.5 * z))) - Math.sqrt(z);
} 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 z <= 2.8: tmp = (2.0 + (math.sqrt((1.0 + y)) + (0.5 * z))) - math.sqrt(z) 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 (z <= 2.8) tmp = Float64(Float64(2.0 + Float64(sqrt(Float64(1.0 + y)) + Float64(0.5 * z))) - sqrt(z)); 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 (z <= 2.8)
tmp = (2.0 + (sqrt((1.0 + y)) + (0.5 * z))) - sqrt(z);
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[z, 2.8], N[(N[(2.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $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}\;z \leq 2.8:\\
\;\;\;\;\left(2 + \left(\sqrt{1 + y} + 0.5 \cdot z\right)\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if z < 2.7999999999999998Initial program 97.2%
+-commutative97.2%
associate-+r+97.2%
associate-+r-82.9%
associate-+l-69.2%
associate-+r-51.9%
Simplified52.5%
Taylor expanded in t around inf 21.5%
associate--l+25.0%
+-commutative25.0%
+-commutative25.0%
+-commutative25.0%
associate-+l+25.0%
+-commutative25.0%
Simplified25.0%
Taylor expanded in x around 0 17.3%
Taylor expanded in z around 0 17.3%
Taylor expanded in z around inf 30.4%
if 2.7999999999999998 < z Initial program 84.5%
+-commutative84.5%
associate-+r+84.5%
associate-+r-65.8%
associate-+l-54.0%
associate-+r-53.0%
Simplified31.4%
Taylor expanded in t around inf 4.7%
associate--l+21.2%
+-commutative21.2%
+-commutative21.2%
+-commutative21.2%
associate-+l+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in x around inf 20.1%
mul-1-neg20.1%
Simplified20.1%
unsub-neg20.1%
Applied egg-rr20.1%
Final simplification25.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 (<= z 1.95) (- (+ 2.0 (+ (sqrt (+ 1.0 y)) (* 0.5 z))) (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 tmp;
if (z <= 1.95) {
tmp = (2.0 + (sqrt((1.0 + y)) + (0.5 * z))) - 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) :: tmp
if (z <= 1.95d0) then
tmp = (2.0d0 + (sqrt((1.0d0 + y)) + (0.5d0 * z))) - 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 tmp;
if (z <= 1.95) {
tmp = (2.0 + (Math.sqrt((1.0 + y)) + (0.5 * z))) - 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): tmp = 0 if z <= 1.95: tmp = (2.0 + (math.sqrt((1.0 + y)) + (0.5 * z))) - 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) tmp = 0.0 if (z <= 1.95) tmp = Float64(Float64(2.0 + Float64(sqrt(Float64(1.0 + y)) + Float64(0.5 * z))) - 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)
tmp = 0.0;
if (z <= 1.95)
tmp = (2.0 + (sqrt((1.0 + y)) + (0.5 * z))) - 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_] := If[LessEqual[z, 1.95], N[(N[(2.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $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}\;z \leq 1.95:\\
\;\;\;\;\left(2 + \left(\sqrt{1 + y} + 0.5 \cdot z\right)\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if z < 1.94999999999999996Initial program 97.3%
+-commutative97.3%
associate-+r+97.3%
associate-+r-82.9%
associate-+l-69.1%
associate-+r-51.6%
Simplified52.2%
Taylor expanded in t around inf 21.5%
associate--l+25.0%
+-commutative25.0%
+-commutative25.0%
+-commutative25.0%
associate-+l+25.0%
+-commutative25.0%
Simplified25.0%
Taylor expanded in x around 0 17.4%
Taylor expanded in z around 0 17.4%
Taylor expanded in z around inf 30.5%
if 1.94999999999999996 < z Initial program 84.5%
+-commutative84.5%
associate-+r+84.5%
associate-+r-65.9%
associate-+l-54.2%
associate-+r-53.2%
Simplified31.8%
Taylor expanded in t around inf 4.8%
associate--l+21.3%
+-commutative21.3%
+-commutative21.3%
+-commutative21.3%
associate-+l+21.3%
+-commutative21.3%
Simplified21.3%
Taylor expanded in x around inf 20.0%
mul-1-neg20.0%
Simplified20.0%
flip-+20.2%
add-sqr-sqrt20.3%
pow220.3%
Applied egg-rr20.3%
associate--l+23.0%
unpow223.0%
sqr-neg23.0%
rem-square-sqrt25.1%
sub-neg25.1%
remove-double-neg25.1%
+-commutative25.1%
Simplified25.1%
Final simplification28.0%
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 60000000.0) (- (sqrt (+ x 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 <= 60000000.0) {
tmp = sqrt((x + 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 <= 60000000.0d0) then
tmp = sqrt((x + 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 <= 60000000.0) {
tmp = Math.sqrt((x + 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 <= 60000000.0: tmp = math.sqrt((x + 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 <= 60000000.0) tmp = Float64(sqrt(Float64(x + 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 <= 60000000.0)
tmp = sqrt((x + 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, 60000000.0], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 60000000:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 6e7Initial program 96.9%
+-commutative96.9%
associate-+r+96.9%
associate-+r-63.5%
associate-+l-61.5%
associate-+r-58.1%
Simplified37.4%
Taylor expanded in t around inf 21.2%
associate--l+39.2%
+-commutative39.2%
+-commutative39.2%
+-commutative39.2%
associate-+l+39.2%
+-commutative39.2%
Simplified39.2%
Taylor expanded in x around inf 26.7%
mul-1-neg26.7%
Simplified26.7%
unsub-neg26.7%
Applied egg-rr26.7%
if 6e7 < x Initial program 86.1%
+-commutative86.1%
associate-+r+86.0%
associate-+r-85.7%
associate-+l-62.7%
associate-+r-47.0%
Simplified47.6%
Taylor expanded in t around inf 6.5%
associate--l+8.2%
+-commutative8.2%
+-commutative8.2%
+-commutative8.2%
associate-+l+8.2%
+-commutative8.2%
Simplified8.2%
Taylor expanded in x around inf 3.4%
mul-1-neg3.4%
Simplified3.4%
pow1/23.4%
pow-to-exp4.9%
log1p-define4.9%
Applied egg-rr4.9%
Taylor expanded in x around inf 9.9%
Final simplification18.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 1.3) (- (+ 1.0 (* x (+ 0.5 (* x (- (* x 0.0625) 0.125))))) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.3) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.3d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * ((x * 0.0625d0) - 0.125d0))))) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.3) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.3: tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.3) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.0625) - 0.125))))) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.3)
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.3], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.3:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.0625 - 0.125\right)\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1.30000000000000004Initial program 97.4%
+-commutative97.4%
associate-+r+97.4%
associate-+r-64.3%
associate-+l-62.3%
associate-+r-58.9%
Simplified37.7%
Taylor expanded in t around inf 21.0%
associate--l+39.4%
+-commutative39.4%
+-commutative39.4%
+-commutative39.4%
associate-+l+39.4%
+-commutative39.4%
Simplified39.4%
Taylor expanded in x around inf 26.2%
mul-1-neg26.2%
Simplified26.2%
Taylor expanded in x around 0 26.2%
if 1.30000000000000004 < x Initial program 85.9%
+-commutative85.9%
associate-+r+85.9%
associate-+r-84.3%
associate-+l-61.9%
associate-+r-46.6%
Simplified47.0%
Taylor expanded in t around inf 7.2%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.6%
mul-1-neg4.6%
Simplified4.6%
pow1/24.6%
pow-to-exp6.0%
log1p-define6.0%
Applied egg-rr6.0%
Taylor expanded in x around inf 10.4%
Final simplification17.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 (<= x 0.9) (+ 1.0 (- (* x (+ 0.5 (* x -0.125))) (sqrt x))) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.9) {
tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - sqrt(x));
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 0.9d0) then
tmp = 1.0d0 + ((x * (0.5d0 + (x * (-0.125d0)))) - sqrt(x))
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.9) {
tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - Math.sqrt(x));
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.9: tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - math.sqrt(x)) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.9) tmp = Float64(1.0 + Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x))); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.9)
tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - sqrt(x));
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.9], N[(1.0 + N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $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 0.9:\\
\;\;\;\;1 + \left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.900000000000000022Initial program 97.4%
+-commutative97.4%
associate-+r+97.4%
associate-+r-64.3%
associate-+l-62.3%
associate-+r-58.9%
Simplified37.7%
Taylor expanded in t around inf 21.0%
associate--l+39.4%
+-commutative39.4%
+-commutative39.4%
+-commutative39.4%
associate-+l+39.4%
+-commutative39.4%
Simplified39.4%
Taylor expanded in x around inf 26.2%
mul-1-neg26.2%
Simplified26.2%
Taylor expanded in x around 0 26.2%
associate--l+26.2%
*-commutative26.2%
Simplified26.2%
if 0.900000000000000022 < x Initial program 85.9%
+-commutative85.9%
associate-+r+85.9%
associate-+r-84.3%
associate-+l-61.9%
associate-+r-46.6%
Simplified47.0%
Taylor expanded in t around inf 7.2%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.6%
mul-1-neg4.6%
Simplified4.6%
pow1/24.6%
pow-to-exp6.0%
log1p-define6.0%
Applied egg-rr6.0%
Taylor expanded in x around inf 10.4%
Final simplification17.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 (<= x 1.0) (+ 1.0 (- (* x 0.5) (sqrt x))) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.0) {
tmp = 1.0 + ((x * 0.5) - sqrt(x));
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.0d0) then
tmp = 1.0d0 + ((x * 0.5d0) - sqrt(x))
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.0) {
tmp = 1.0 + ((x * 0.5) - Math.sqrt(x));
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.0: tmp = 1.0 + ((x * 0.5) - math.sqrt(x)) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.0) tmp = Float64(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 <= 1.0)
tmp = 1.0 + ((x * 0.5) - sqrt(x));
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.0], N[(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 1:\\
\;\;\;\;1 + \left(x \cdot 0.5 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1Initial program 97.4%
+-commutative97.4%
associate-+r+97.4%
associate-+r-64.3%
associate-+l-62.3%
associate-+r-58.9%
Simplified37.7%
Taylor expanded in t around inf 21.0%
associate--l+39.4%
+-commutative39.4%
+-commutative39.4%
+-commutative39.4%
associate-+l+39.4%
+-commutative39.4%
Simplified39.4%
Taylor expanded in x around inf 26.2%
mul-1-neg26.2%
Simplified26.2%
Taylor expanded in x around 0 26.2%
associate--l+26.2%
*-commutative26.2%
Simplified26.2%
if 1 < x Initial program 85.9%
+-commutative85.9%
associate-+r+85.9%
associate-+r-84.3%
associate-+l-61.9%
associate-+r-46.6%
Simplified47.0%
Taylor expanded in t around inf 7.2%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.6%
mul-1-neg4.6%
Simplified4.6%
pow1/24.6%
pow-to-exp6.0%
log1p-define6.0%
Applied egg-rr6.0%
Taylor expanded in x around inf 10.4%
Final simplification17.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 (<= x 0.27) (- 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.27) {
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.27d0) 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.27) {
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.27: 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.27) 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.27)
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.27], 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.27:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.27000000000000002Initial program 97.4%
+-commutative97.4%
associate-+r+97.4%
associate-+r-64.3%
associate-+l-62.3%
associate-+r-58.9%
Simplified37.7%
Taylor expanded in t around inf 21.0%
associate--l+39.4%
+-commutative39.4%
+-commutative39.4%
+-commutative39.4%
associate-+l+39.4%
+-commutative39.4%
Simplified39.4%
Taylor expanded in x around inf 26.2%
mul-1-neg26.2%
Simplified26.2%
Taylor expanded in x around 0 26.2%
if 0.27000000000000002 < x Initial program 85.9%
+-commutative85.9%
associate-+r+85.9%
associate-+r-84.3%
associate-+l-61.9%
associate-+r-46.6%
Simplified47.0%
Taylor expanded in t around inf 7.2%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.6%
mul-1-neg4.6%
Simplified4.6%
pow1/24.6%
pow-to-exp6.0%
log1p-define6.0%
Applied egg-rr6.0%
Taylor expanded in x around inf 10.4%
Final simplification17.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 91.3%
+-commutative91.3%
associate-+r+91.3%
associate-+r-74.9%
associate-+l-62.1%
associate-+r-52.4%
Simplified42.7%
Taylor expanded in t around inf 13.7%
associate--l+23.2%
+-commutative23.2%
+-commutative23.2%
+-commutative23.2%
associate-+l+23.2%
+-commutative23.2%
Simplified23.2%
Taylor expanded in x around inf 14.7%
mul-1-neg14.7%
Simplified14.7%
Taylor expanded in x around 0 13.0%
Final simplification13.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 91.3%
+-commutative91.3%
associate-+r+91.3%
associate-+r-74.9%
associate-+l-62.1%
associate-+r-52.4%
Simplified42.7%
Taylor expanded in t around inf 13.7%
associate--l+23.2%
+-commutative23.2%
+-commutative23.2%
+-commutative23.2%
associate-+l+23.2%
+-commutative23.2%
Simplified23.2%
Taylor expanded in x around 0 10.9%
Taylor expanded in x around inf 1.6%
neg-mul-11.6%
Simplified1.6%
Final simplification1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024076
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))