
(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 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ y 1.0)) (sqrt y))))
(if (<= t_1 5e-5)
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
(* 0.5 (sqrt (/ 1.0 z))))
(+
(+ (- 1.0 (sqrt x)) t_1)
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(- (sqrt (+ 1.0 t)) (sqrt t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double tmp;
if (t_1 <= 5e-5) {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
} else {
tmp = ((1.0 - sqrt(x)) + t_1) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0)) - sqrt(y)
if (t_1 <= 5d-5) then
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (0.5d0 * sqrt((1.0d0 / z)))
else
tmp = ((1.0d0 - sqrt(x)) + t_1) + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (sqrt((1.0d0 + t)) - sqrt(t)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double tmp;
if (t_1 <= 5e-5) {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + (0.5 * Math.sqrt((1.0 / z)));
} else {
tmp = ((1.0 - Math.sqrt(x)) + t_1) + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) - math.sqrt(y) tmp = 0 if t_1 <= 5e-5: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + (0.5 * math.sqrt((1.0 / z))) else: tmp = ((1.0 - math.sqrt(x)) + t_1) + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) tmp = 0.0 if (t_1 <= 5e-5) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + t_1) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0)) - sqrt(y);
tmp = 0.0;
if (t_1 <= 5e-5)
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
else
tmp = ((1.0 - sqrt(x)) + t_1) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-5], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} - \sqrt{y}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + t\_1\right) + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) < 5.00000000000000024e-5Initial program 79.1%
associate-+l+79.1%
sub-neg79.1%
sub-neg79.1%
+-commutative79.1%
+-commutative79.1%
+-commutative79.1%
Simplified79.1%
flip--79.1%
div-inv79.1%
add-sqr-sqrt65.7%
+-commutative65.7%
add-sqr-sqrt80.1%
+-commutative80.1%
Applied egg-rr80.1%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
*-lft-identity86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in t around inf 46.4%
Taylor expanded in y around inf 50.5%
Taylor expanded in z around inf 33.6%
if 5.00000000000000024e-5 < (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 49.2%
flip--49.1%
div-inv49.1%
add-sqr-sqrt37.8%
add-sqr-sqrt49.4%
associate--l+49.6%
Applied egg-rr49.6%
+-inverses49.6%
metadata-eval49.6%
*-lft-identity49.6%
+-commutative49.6%
Simplified49.6%
Final simplification42.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 170000000.0)
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt (+ 1.0 z)) (sqrt z))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
(* 0.5 (sqrt (/ 1.0 z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 170000000.0) {
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 170000000.0d0) then
tmp = ((1.0d0 - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (sqrt((1.0d0 + z)) - sqrt(z)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 170000000.0) {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 170000000.0: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (math.sqrt((1.0 + z)) - math.sqrt(z))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 170000000.0) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 170000000.0)
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 170000000.0], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 170000000:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if y < 1.7e8Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 49.2%
if 1.7e8 < y Initial program 79.1%
associate-+l+79.1%
sub-neg79.1%
sub-neg79.1%
+-commutative79.1%
+-commutative79.1%
+-commutative79.1%
Simplified79.1%
flip--79.1%
div-inv79.1%
add-sqr-sqrt65.7%
+-commutative65.7%
add-sqr-sqrt80.1%
+-commutative80.1%
Applied egg-rr80.1%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
*-lft-identity86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in t around inf 46.4%
Taylor expanded in y around inf 50.5%
Taylor expanded in z around inf 33.6%
Final simplification42.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 (<= y 1.2)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt (+ 1.0 z)) (sqrt z)))
(+ (- 1.0 (sqrt x)) (+ 1.0 (- (* y 0.5) (sqrt y)))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
(* 0.5 (sqrt (/ 1.0 z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.2) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z))) + ((1.0 - sqrt(x)) + (1.0 + ((y * 0.5) - sqrt(y))));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.2d0) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (sqrt((1.0d0 + z)) - sqrt(z))) + ((1.0d0 - sqrt(x)) + (1.0d0 + ((y * 0.5d0) - sqrt(y))))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.2) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z))) + ((1.0 - Math.sqrt(x)) + (1.0 + ((y * 0.5) - Math.sqrt(y))));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.2: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (math.sqrt((1.0 + z)) - math.sqrt(z))) + ((1.0 - math.sqrt(x)) + (1.0 + ((y * 0.5) - math.sqrt(y)))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.2) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))) + Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 + Float64(Float64(y * 0.5) - sqrt(y))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.2)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z))) + ((1.0 - sqrt(x)) + (1.0 + ((y * 0.5) - sqrt(y))));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.2], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.2:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right) + \left(\left(1 - \sqrt{x}\right) + \left(1 + \left(y \cdot 0.5 - \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if y < 1.19999999999999996Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 49.1%
Taylor expanded in y around 0 48.6%
associate--l+31.5%
Simplified48.6%
if 1.19999999999999996 < y Initial program 79.5%
associate-+l+79.5%
sub-neg79.5%
sub-neg79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
Simplified79.5%
flip--79.4%
div-inv79.4%
add-sqr-sqrt66.2%
+-commutative66.2%
add-sqr-sqrt80.4%
+-commutative80.4%
Applied egg-rr80.4%
associate--l+86.2%
+-inverses86.2%
metadata-eval86.2%
*-lft-identity86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 46.5%
Taylor expanded in y around inf 50.1%
Taylor expanded in z around inf 33.2%
Final simplification41.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (- 1.0 (sqrt x))))
(if (<= y 5.5e-90)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- t_1 (sqrt z)))
(+ t_2 (- 1.0 (sqrt y))))
(if (<= y 270000000.0)
(+ (+ t_2 (- (sqrt (+ y 1.0)) (sqrt y))) (/ 1.0 (+ (sqrt z) t_1)))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
(* 0.5 (sqrt (/ 1.0 z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = 1.0 - sqrt(x);
double tmp;
if (y <= 5.5e-90) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (t_1 - sqrt(z))) + (t_2 + (1.0 - sqrt(y)));
} else if (y <= 270000000.0) {
tmp = (t_2 + (sqrt((y + 1.0)) - sqrt(y))) + (1.0 / (sqrt(z) + t_1));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = 1.0d0 - sqrt(x)
if (y <= 5.5d-90) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (t_1 - sqrt(z))) + (t_2 + (1.0d0 - sqrt(y)))
else if (y <= 270000000.0d0) then
tmp = (t_2 + (sqrt((y + 1.0d0)) - sqrt(y))) + (1.0d0 / (sqrt(z) + t_1))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = 1.0 - Math.sqrt(x);
double tmp;
if (y <= 5.5e-90) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (t_1 - Math.sqrt(z))) + (t_2 + (1.0 - Math.sqrt(y)));
} else if (y <= 270000000.0) {
tmp = (t_2 + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (1.0 / (Math.sqrt(z) + t_1));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = 1.0 - math.sqrt(x) tmp = 0 if y <= 5.5e-90: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (t_1 - math.sqrt(z))) + (t_2 + (1.0 - math.sqrt(y))) elif y <= 270000000.0: tmp = (t_2 + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (1.0 / (math.sqrt(z) + t_1)) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = Float64(1.0 - sqrt(x)) tmp = 0.0 if (y <= 5.5e-90) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(t_1 - sqrt(z))) + Float64(t_2 + Float64(1.0 - sqrt(y)))); elseif (y <= 270000000.0) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(1.0 / Float64(sqrt(z) + t_1))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = 1.0 - sqrt(x);
tmp = 0.0;
if (y <= 5.5e-90)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (t_1 - sqrt(z))) + (t_2 + (1.0 - sqrt(y)));
elseif (y <= 270000000.0)
tmp = (t_2 + (sqrt((y + 1.0)) - sqrt(y))) + (1.0 / (sqrt(z) + t_1));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.5e-90], N[(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] + N[(t$95$2 + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 270000000.0], N[(N[(t$95$2 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := 1 - \sqrt{x}\\
\mathbf{if}\;y \leq 5.5 \cdot 10^{-90}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(t\_1 - \sqrt{z}\right)\right) + \left(t\_2 + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{elif}\;y \leq 270000000:\\
\;\;\;\;\left(t\_2 + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \frac{1}{\sqrt{z} + t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if y < 5.5000000000000003e-90Initial program 97.4%
associate-+l+97.4%
sub-neg97.4%
sub-neg97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 46.8%
Taylor expanded in y around 0 46.8%
if 5.5000000000000003e-90 < y < 2.7e8Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 53.6%
Taylor expanded in t around inf 33.6%
flip--53.6%
div-inv53.6%
add-sqr-sqrt34.1%
add-sqr-sqrt54.0%
associate--l+54.0%
Applied egg-rr34.0%
+-inverses54.0%
metadata-eval54.0%
*-lft-identity54.0%
+-commutative54.0%
Simplified34.0%
if 2.7e8 < y Initial program 79.1%
associate-+l+79.1%
sub-neg79.1%
sub-neg79.1%
+-commutative79.1%
+-commutative79.1%
+-commutative79.1%
Simplified79.1%
flip--79.1%
div-inv79.1%
add-sqr-sqrt65.7%
+-commutative65.7%
add-sqr-sqrt80.1%
+-commutative80.1%
Applied egg-rr80.1%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
*-lft-identity86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in t around inf 46.4%
Taylor expanded in y around inf 50.5%
Taylor expanded in z around inf 33.6%
Final simplification38.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 170000000.0)
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y)))
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
(* 0.5 (sqrt (/ 1.0 z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 170000000.0) {
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (1.0 / (sqrt(z) + sqrt((1.0 + z))));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 170000000.0d0) then
tmp = ((1.0d0 - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 170000000.0) {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 170000000.0: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 170000000.0) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 170000000.0)
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (1.0 / (sqrt(z) + sqrt((1.0 + z))));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 170000000.0], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 170000000:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if y < 1.7e8Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 49.2%
Taylor expanded in t around inf 31.7%
flip--49.1%
div-inv49.1%
add-sqr-sqrt37.8%
add-sqr-sqrt49.4%
associate--l+49.6%
Applied egg-rr32.1%
+-inverses49.6%
metadata-eval49.6%
*-lft-identity49.6%
+-commutative49.6%
Simplified32.1%
if 1.7e8 < y Initial program 79.1%
associate-+l+79.1%
sub-neg79.1%
sub-neg79.1%
+-commutative79.1%
+-commutative79.1%
+-commutative79.1%
Simplified79.1%
flip--79.1%
div-inv79.1%
add-sqr-sqrt65.7%
+-commutative65.7%
add-sqr-sqrt80.1%
+-commutative80.1%
Applied egg-rr80.1%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
*-lft-identity86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in t around inf 46.4%
Taylor expanded in y around inf 50.5%
Taylor expanded in z around inf 33.6%
Final simplification32.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 (<= y 160000000.0)
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y)))
(- (sqrt (+ 1.0 z)) (sqrt z)))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
(* 0.5 (sqrt (/ 1.0 z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 160000000.0) {
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((1.0 + z)) - sqrt(z));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 160000000.0d0) then
tmp = ((1.0d0 - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((1.0d0 + z)) - sqrt(z))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 160000000.0) {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 160000000.0: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((1.0 + z)) - math.sqrt(z)) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 160000000.0) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 160000000.0)
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((1.0 + z)) - sqrt(z));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 160000000.0], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 160000000:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if y < 1.6e8Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 49.2%
Taylor expanded in t around inf 31.7%
if 1.6e8 < y Initial program 79.1%
associate-+l+79.1%
sub-neg79.1%
sub-neg79.1%
+-commutative79.1%
+-commutative79.1%
+-commutative79.1%
Simplified79.1%
flip--79.1%
div-inv79.1%
add-sqr-sqrt65.7%
+-commutative65.7%
add-sqr-sqrt80.1%
+-commutative80.1%
Applied egg-rr80.1%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
*-lft-identity86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in t around inf 46.4%
Taylor expanded in y around inf 50.5%
Taylor expanded in z around inf 33.6%
Final simplification32.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (sqrt x))) (t_2 (sqrt (+ 1.0 z))))
(if (<= y 6.2e-13)
(+ (/ 1.0 (+ (sqrt z) t_2)) (+ t_1 (- 1.0 (sqrt y))))
(if (<= y 1.12e+23)
(+ (* 0.5 (sqrt (/ 1.0 z))) (+ t_1 (- (sqrt (+ y 1.0)) (sqrt y))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (- t_2 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - sqrt(x);
double t_2 = sqrt((1.0 + z));
double tmp;
if (y <= 6.2e-13) {
tmp = (1.0 / (sqrt(z) + t_2)) + (t_1 + (1.0 - sqrt(y)));
} else if (y <= 1.12e+23) {
tmp = (0.5 * sqrt((1.0 / z))) + (t_1 + (sqrt((y + 1.0)) - sqrt(y)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_2 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 - sqrt(x)
t_2 = sqrt((1.0d0 + z))
if (y <= 6.2d-13) then
tmp = (1.0d0 / (sqrt(z) + t_2)) + (t_1 + (1.0d0 - sqrt(y)))
else if (y <= 1.12d+23) then
tmp = (0.5d0 * sqrt((1.0d0 / z))) + (t_1 + (sqrt((y + 1.0d0)) - sqrt(y)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (t_2 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 6.2e-13) {
tmp = (1.0 / (Math.sqrt(z) + t_2)) + (t_1 + (1.0 - Math.sqrt(y)));
} else if (y <= 1.12e+23) {
tmp = (0.5 * Math.sqrt((1.0 / z))) + (t_1 + (Math.sqrt((y + 1.0)) - Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (t_2 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 - math.sqrt(x) t_2 = math.sqrt((1.0 + z)) tmp = 0 if y <= 6.2e-13: tmp = (1.0 / (math.sqrt(z) + t_2)) + (t_1 + (1.0 - math.sqrt(y))) elif y <= 1.12e+23: tmp = (0.5 * math.sqrt((1.0 / z))) + (t_1 + (math.sqrt((y + 1.0)) - math.sqrt(y))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_2 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 - sqrt(x)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 6.2e-13) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_2)) + Float64(t_1 + Float64(1.0 - sqrt(y)))); elseif (y <= 1.12e+23) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) - sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(t_2 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 - sqrt(x);
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 6.2e-13)
tmp = (1.0 / (sqrt(z) + t_2)) + (t_1 + (1.0 - sqrt(y)));
elseif (y <= 1.12e+23)
tmp = (0.5 * sqrt((1.0 / z))) + (t_1 + (sqrt((y + 1.0)) - sqrt(y)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_2 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 6.2e-13], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e+23], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 - \sqrt{x}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 6.2 \cdot 10^{-13}:\\
\;\;\;\;\frac{1}{\sqrt{z} + t\_2} + \left(t\_1 + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{+23}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(t\_1 + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_2 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 6.1999999999999998e-13Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 49.8%
Taylor expanded in t around inf 32.6%
Taylor expanded in y around 0 32.5%
flip--49.8%
div-inv49.8%
add-sqr-sqrt39.2%
add-sqr-sqrt50.1%
associate--l+50.3%
Applied egg-rr32.9%
+-inverses50.3%
metadata-eval50.3%
*-lft-identity50.3%
+-commutative50.3%
Simplified32.9%
if 6.1999999999999998e-13 < y < 1.12e23Initial program 89.1%
associate-+l+89.1%
sub-neg89.1%
sub-neg89.1%
+-commutative89.1%
+-commutative89.1%
+-commutative89.1%
Simplified89.1%
Taylor expanded in x around 0 45.5%
Taylor expanded in t around inf 20.5%
Taylor expanded in z around inf 14.2%
if 1.12e23 < y Initial program 79.4%
associate-+l+79.4%
sub-neg79.4%
sub-neg79.4%
+-commutative79.4%
+-commutative79.4%
+-commutative79.4%
Simplified79.4%
flip--79.4%
div-inv79.4%
add-sqr-sqrt65.3%
+-commutative65.3%
add-sqr-sqrt80.4%
+-commutative80.4%
Applied egg-rr80.4%
associate--l+86.5%
+-inverses86.5%
metadata-eval86.5%
*-lft-identity86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 47.2%
Taylor expanded in y around inf 47.2%
Final simplification38.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 1.4)
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
(* 0.5 (sqrt (/ 1.0 z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.4) {
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + (1.0 - sqrt(y)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.4d0) then
tmp = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.4) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.4: tmp = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.4) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.4)
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + (1.0 - sqrt(y)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.4], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.4:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if y < 1.3999999999999999Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 49.1%
Taylor expanded in t around inf 32.1%
Taylor expanded in y around 0 31.4%
flip--49.1%
div-inv49.1%
add-sqr-sqrt38.3%
add-sqr-sqrt49.4%
associate--l+49.6%
Applied egg-rr31.8%
+-inverses49.6%
metadata-eval49.6%
*-lft-identity49.6%
+-commutative49.6%
Simplified31.8%
if 1.3999999999999999 < y Initial program 79.5%
associate-+l+79.5%
sub-neg79.5%
sub-neg79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
Simplified79.5%
flip--79.4%
div-inv79.4%
add-sqr-sqrt66.2%
+-commutative66.2%
add-sqr-sqrt80.4%
+-commutative80.4%
Applied egg-rr80.4%
associate--l+86.2%
+-inverses86.2%
metadata-eval86.2%
*-lft-identity86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 46.5%
Taylor expanded in y around inf 50.1%
Taylor expanded in z around inf 33.2%
Final simplification32.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 0.8)
(+ (/ 1.0 (+ (sqrt z) t_1)) (+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (- t_1 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 0.8) {
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 - sqrt(x)) + (1.0 - sqrt(y)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 0.8d0) then
tmp = (1.0d0 / (sqrt(z) + t_1)) + ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 0.8) {
tmp = (1.0 / (Math.sqrt(z) + t_1)) + ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (t_1 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 0.8: tmp = (1.0 / (math.sqrt(z) + t_1)) + ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_1 - math.sqrt(z)) 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 <= 0.8) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(t_1 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 0.8)
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 - sqrt(x)) + (1.0 - sqrt(y)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 0.8], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $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 0.8:\\
\;\;\;\;\frac{1}{\sqrt{z} + t\_1} + \left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 0.80000000000000004Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 49.1%
Taylor expanded in t around inf 32.1%
Taylor expanded in y around 0 31.4%
flip--49.1%
div-inv49.1%
add-sqr-sqrt38.3%
add-sqr-sqrt49.4%
associate--l+49.6%
Applied egg-rr31.8%
+-inverses49.6%
metadata-eval49.6%
*-lft-identity49.6%
+-commutative49.6%
Simplified31.8%
if 0.80000000000000004 < y Initial program 79.5%
associate-+l+79.5%
sub-neg79.5%
sub-neg79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
Simplified79.5%
flip--79.4%
div-inv79.4%
add-sqr-sqrt66.2%
+-commutative66.2%
add-sqr-sqrt80.4%
+-commutative80.4%
Applied egg-rr80.4%
associate--l+86.2%
+-inverses86.2%
metadata-eval86.2%
*-lft-identity86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 46.5%
Taylor expanded in y around inf 46.0%
Final simplification38.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))) (t_2 (- 1.0 (sqrt x)))) (if (<= y 1.0) (+ t_1 (+ t_2 (- 1.0 (sqrt y)))) (+ t_2 t_1))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double t_2 = 1.0 - sqrt(x);
double tmp;
if (y <= 1.0) {
tmp = t_1 + (t_2 + (1.0 - sqrt(y)));
} else {
tmp = t_2 + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = 1.0d0 - sqrt(x)
if (y <= 1.0d0) then
tmp = t_1 + (t_2 + (1.0d0 - sqrt(y)))
else
tmp = t_2 + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_2 = 1.0 - Math.sqrt(x);
double tmp;
if (y <= 1.0) {
tmp = t_1 + (t_2 + (1.0 - Math.sqrt(y)));
} else {
tmp = t_2 + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) t_2 = 1.0 - math.sqrt(x) tmp = 0 if y <= 1.0: tmp = t_1 + (t_2 + (1.0 - math.sqrt(y))) else: tmp = t_2 + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = Float64(1.0 - sqrt(x)) tmp = 0.0 if (y <= 1.0) tmp = Float64(t_1 + Float64(t_2 + Float64(1.0 - sqrt(y)))); else tmp = Float64(t_2 + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
t_2 = 1.0 - sqrt(x);
tmp = 0.0;
if (y <= 1.0)
tmp = t_1 + (t_2 + (1.0 - sqrt(y)));
else
tmp = t_2 + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.0], N[(t$95$1 + N[(t$95$2 + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + 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}\\
t_2 := 1 - \sqrt{x}\\
\mathbf{if}\;y \leq 1:\\
\;\;\;\;t\_1 + \left(t\_2 + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + t\_1\\
\end{array}
\end{array}
if y < 1Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 49.1%
Taylor expanded in t around inf 32.1%
Taylor expanded in y around 0 31.4%
if 1 < y Initial program 79.5%
associate-+l+79.5%
sub-neg79.5%
sub-neg79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
Simplified79.5%
Taylor expanded in x around 0 48.4%
Taylor expanded in t around inf 28.5%
Taylor expanded in y around inf 28.5%
Final simplification30.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 0.78)
(+ t_1 (+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 0.78) {
tmp = t_1 + ((1.0 - sqrt(x)) + (1.0 - sqrt(y)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 0.78d0) then
tmp = t_1 + ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 0.78) {
tmp = t_1 + ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 0.78: tmp = t_1 + ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + 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 (y <= 0.78) tmp = Float64(t_1 + Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 0.78)
tmp = t_1 + ((1.0 - sqrt(x)) + (1.0 - sqrt(y)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.78], N[(t$95$1 + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $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}\;y \leq 0.78:\\
\;\;\;\;t\_1 + \left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_1\\
\end{array}
\end{array}
if y < 0.78000000000000003Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 49.1%
Taylor expanded in t around inf 32.1%
Taylor expanded in y around 0 31.4%
if 0.78000000000000003 < y Initial program 79.5%
associate-+l+79.5%
sub-neg79.5%
sub-neg79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
Simplified79.5%
flip--79.4%
div-inv79.4%
add-sqr-sqrt66.2%
+-commutative66.2%
add-sqr-sqrt80.4%
+-commutative80.4%
Applied egg-rr80.4%
associate--l+86.2%
+-inverses86.2%
metadata-eval86.2%
*-lft-identity86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 46.5%
Taylor expanded in y around inf 46.0%
Final simplification38.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 1.7)
(+ 2.0 (- t_1 (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+ (- 1.0 (sqrt x)) (- t_1 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 1.7) {
tmp = 2.0 + (t_1 - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = (1.0 - sqrt(x)) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 1.7d0) then
tmp = 2.0d0 + (t_1 - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = (1.0d0 - sqrt(x)) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 1.7) {
tmp = 2.0 + (t_1 - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = (1.0 - Math.sqrt(x)) + (t_1 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 1.7: tmp = 2.0 + (t_1 - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = (1.0 - math.sqrt(x)) + (t_1 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 1.7) tmp = Float64(2.0 + Float64(t_1 - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(t_1 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 1.7)
tmp = 2.0 + (t_1 - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = (1.0 - sqrt(x)) + (t_1 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.7], N[(2.0 + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 1.7:\\
\;\;\;\;2 + \left(t\_1 - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 1.69999999999999996Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 49.1%
Taylor expanded in t around inf 32.1%
Taylor expanded in y around 0 19.2%
associate--l+35.0%
Simplified35.0%
if 1.69999999999999996 < y Initial program 79.5%
associate-+l+79.5%
sub-neg79.5%
sub-neg79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
Simplified79.5%
Taylor expanded in x around 0 48.4%
Taylor expanded in t around inf 28.5%
Taylor expanded in y around inf 28.5%
Final simplification32.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 1.0)
(+ t_1 (- 2.0 (+ (sqrt y) (sqrt x))))
(+ (- 1.0 (sqrt x)) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 1.0) {
tmp = t_1 + (2.0 - (sqrt(y) + sqrt(x)));
} else {
tmp = (1.0 - sqrt(x)) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 1.0d0) then
tmp = t_1 + (2.0d0 - (sqrt(y) + sqrt(x)))
else
tmp = (1.0d0 - sqrt(x)) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 1.0) {
tmp = t_1 + (2.0 - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (1.0 - Math.sqrt(x)) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 1.0: tmp = t_1 + (2.0 - (math.sqrt(y) + math.sqrt(x))) else: tmp = (1.0 - math.sqrt(x)) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 1.0) tmp = Float64(t_1 + Float64(2.0 - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(1.0 - sqrt(x)) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 1.0)
tmp = t_1 + (2.0 - (sqrt(y) + sqrt(x)));
else
tmp = (1.0 - sqrt(x)) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.0], N[(t$95$1 + N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $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}\;y \leq 1:\\
\;\;\;\;t\_1 + \left(2 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + t\_1\\
\end{array}
\end{array}
if y < 1Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 49.1%
Taylor expanded in t around inf 32.1%
Taylor expanded in y around 0 31.4%
if 1 < y Initial program 79.5%
associate-+l+79.5%
sub-neg79.5%
sub-neg79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
Simplified79.5%
Taylor expanded in x around 0 48.4%
Taylor expanded in t around inf 28.5%
Taylor expanded in y around inf 28.5%
Final simplification30.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 y) (sqrt x))))
(if (<= z 0.43)
(- 3.0 (+ (sqrt z) t_1))
(if (or (<= z 8e+119) (and (not (<= z 2.85e+132)) (<= z 1.6e+149)))
(- (+ (* 0.5 (sqrt (/ 1.0 z))) 2.0) t_1)
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 z)) (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(x);
double tmp;
if (z <= 0.43) {
tmp = 3.0 - (sqrt(z) + t_1);
} else if ((z <= 8e+119) || (!(z <= 2.85e+132) && (z <= 1.6e+149))) {
tmp = ((0.5 * sqrt((1.0 / z))) + 2.0) - t_1;
} else {
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
if (z <= 0.43d0) then
tmp = 3.0d0 - (sqrt(z) + t_1)
else if ((z <= 8d+119) .or. (.not. (z <= 2.85d+132)) .and. (z <= 1.6d+149)) then
tmp = ((0.5d0 * sqrt((1.0d0 / z))) + 2.0d0) - t_1
else
tmp = (1.0d0 - sqrt(x)) + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt(x);
double tmp;
if (z <= 0.43) {
tmp = 3.0 - (Math.sqrt(z) + t_1);
} else if ((z <= 8e+119) || (!(z <= 2.85e+132) && (z <= 1.6e+149))) {
tmp = ((0.5 * Math.sqrt((1.0 / z))) + 2.0) - t_1;
} else {
tmp = (1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(x) tmp = 0 if z <= 0.43: tmp = 3.0 - (math.sqrt(z) + t_1) elif (z <= 8e+119) or (not (z <= 2.85e+132) and (z <= 1.6e+149)): tmp = ((0.5 * math.sqrt((1.0 / z))) + 2.0) - t_1 else: tmp = (1.0 - math.sqrt(x)) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) tmp = 0.0 if (z <= 0.43) tmp = Float64(3.0 - Float64(sqrt(z) + t_1)); elseif ((z <= 8e+119) || (!(z <= 2.85e+132) && (z <= 1.6e+149))) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + 2.0) - t_1); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(x);
tmp = 0.0;
if (z <= 0.43)
tmp = 3.0 - (sqrt(z) + t_1);
elseif ((z <= 8e+119) || (~((z <= 2.85e+132)) && (z <= 1.6e+149)))
tmp = ((0.5 * sqrt((1.0 / z))) + 2.0) - t_1;
else
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 0.43], N[(3.0 - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 8e+119], And[N[Not[LessEqual[z, 2.85e+132]], $MachinePrecision], LessEqual[z, 1.6e+149]]], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
\mathbf{if}\;z \leq 0.43:\\
\;\;\;\;3 - \left(\sqrt{z} + t\_1\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+119} \lor \neg \left(z \leq 2.85 \cdot 10^{+132}\right) \land z \leq 1.6 \cdot 10^{+149}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{z}} + 2\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 0.429999999999999993Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 54.7%
Taylor expanded in t around inf 32.8%
Taylor expanded in y around 0 19.1%
Taylor expanded in z around 0 18.4%
associate-+r+18.4%
Simplified18.4%
if 0.429999999999999993 < z < 7.99999999999999955e119 or 2.8499999999999999e132 < z < 1.6000000000000001e149Initial program 83.6%
associate-+l+83.6%
sub-neg83.6%
sub-neg83.6%
+-commutative83.6%
+-commutative83.6%
+-commutative83.6%
Simplified83.6%
Taylor expanded in x around 0 39.2%
Taylor expanded in t around inf 26.3%
Taylor expanded in y around 0 14.1%
Taylor expanded in z around inf 14.8%
if 7.99999999999999955e119 < z < 2.8499999999999999e132 or 1.6000000000000001e149 < z Initial program 79.1%
associate-+l+79.1%
sub-neg79.1%
sub-neg79.1%
+-commutative79.1%
+-commutative79.1%
+-commutative79.1%
Simplified79.1%
Taylor expanded in x around 0 46.3%
Taylor expanded in t around inf 29.6%
Taylor expanded in y around inf 18.3%
Final simplification17.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 0.68)
(- (+ (* y 0.5) 3.0) (+ (sqrt x) (+ (sqrt y) (sqrt z))))
(if (or (<= z 7.5e+119) (and (not (<= z 2.8e+132)) (<= z 1.6e+149)))
(- (+ (* 0.5 (sqrt (/ 1.0 z))) 2.0) (+ (sqrt y) (sqrt x)))
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 z)) (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.68) {
tmp = ((y * 0.5) + 3.0) - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else if ((z <= 7.5e+119) || (!(z <= 2.8e+132) && (z <= 1.6e+149))) {
tmp = ((0.5 * sqrt((1.0 / z))) + 2.0) - (sqrt(y) + sqrt(x));
} else {
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.68d0) then
tmp = ((y * 0.5d0) + 3.0d0) - (sqrt(x) + (sqrt(y) + sqrt(z)))
else if ((z <= 7.5d+119) .or. (.not. (z <= 2.8d+132)) .and. (z <= 1.6d+149)) then
tmp = ((0.5d0 * sqrt((1.0d0 / z))) + 2.0d0) - (sqrt(y) + sqrt(x))
else
tmp = (1.0d0 - sqrt(x)) + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.68) {
tmp = ((y * 0.5) + 3.0) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else if ((z <= 7.5e+119) || (!(z <= 2.8e+132) && (z <= 1.6e+149))) {
tmp = ((0.5 * Math.sqrt((1.0 / z))) + 2.0) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = (1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.68: tmp = ((y * 0.5) + 3.0) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) elif (z <= 7.5e+119) or (not (z <= 2.8e+132) and (z <= 1.6e+149)): tmp = ((0.5 * math.sqrt((1.0 / z))) + 2.0) - (math.sqrt(y) + math.sqrt(x)) else: tmp = (1.0 - math.sqrt(x)) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.68) tmp = Float64(Float64(Float64(y * 0.5) + 3.0) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); elseif ((z <= 7.5e+119) || (!(z <= 2.8e+132) && (z <= 1.6e+149))) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + 2.0) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.68)
tmp = ((y * 0.5) + 3.0) - (sqrt(x) + (sqrt(y) + sqrt(z)));
elseif ((z <= 7.5e+119) || (~((z <= 2.8e+132)) && (z <= 1.6e+149)))
tmp = ((0.5 * sqrt((1.0 / z))) + 2.0) - (sqrt(y) + sqrt(x));
else
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.68], N[(N[(N[(y * 0.5), $MachinePrecision] + 3.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 7.5e+119], And[N[Not[LessEqual[z, 2.8e+132]], $MachinePrecision], LessEqual[z, 1.6e+149]]], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.68:\\
\;\;\;\;\left(y \cdot 0.5 + 3\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+119} \lor \neg \left(z \leq 2.8 \cdot 10^{+132}\right) \land z \leq 1.6 \cdot 10^{+149}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{z}} + 2\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 0.680000000000000049Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 54.7%
Taylor expanded in t around inf 32.8%
Taylor expanded in y around 0 20.7%
associate--l+20.7%
Simplified20.7%
Taylor expanded in z around 0 20.0%
if 0.680000000000000049 < z < 7.500000000000001e119 or 2.7999999999999999e132 < z < 1.6000000000000001e149Initial program 83.6%
associate-+l+83.6%
sub-neg83.6%
sub-neg83.6%
+-commutative83.6%
+-commutative83.6%
+-commutative83.6%
Simplified83.6%
Taylor expanded in x around 0 39.2%
Taylor expanded in t around inf 26.3%
Taylor expanded in y around 0 14.1%
Taylor expanded in z around inf 14.8%
if 7.500000000000001e119 < z < 2.7999999999999999e132 or 1.6000000000000001e149 < z Initial program 79.1%
associate-+l+79.1%
sub-neg79.1%
sub-neg79.1%
+-commutative79.1%
+-commutative79.1%
+-commutative79.1%
Simplified79.1%
Taylor expanded in x around 0 46.3%
Taylor expanded in t around inf 29.6%
Taylor expanded in y around inf 18.3%
Final simplification18.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 y) (sqrt x))))
(if (<= z 1.0)
(- (+ 3.0 (* 0.5 z)) (+ (sqrt z) t_1))
(if (or (<= z 8e+119) (and (not (<= z 2.85e+132)) (<= z 1.45e+149)))
(- (+ (* 0.5 (sqrt (/ 1.0 z))) 2.0) t_1)
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 z)) (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(x);
double tmp;
if (z <= 1.0) {
tmp = (3.0 + (0.5 * z)) - (sqrt(z) + t_1);
} else if ((z <= 8e+119) || (!(z <= 2.85e+132) && (z <= 1.45e+149))) {
tmp = ((0.5 * sqrt((1.0 / z))) + 2.0) - t_1;
} else {
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
if (z <= 1.0d0) then
tmp = (3.0d0 + (0.5d0 * z)) - (sqrt(z) + t_1)
else if ((z <= 8d+119) .or. (.not. (z <= 2.85d+132)) .and. (z <= 1.45d+149)) then
tmp = ((0.5d0 * sqrt((1.0d0 / z))) + 2.0d0) - t_1
else
tmp = (1.0d0 - sqrt(x)) + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt(x);
double tmp;
if (z <= 1.0) {
tmp = (3.0 + (0.5 * z)) - (Math.sqrt(z) + t_1);
} else if ((z <= 8e+119) || (!(z <= 2.85e+132) && (z <= 1.45e+149))) {
tmp = ((0.5 * Math.sqrt((1.0 / z))) + 2.0) - t_1;
} else {
tmp = (1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(x) tmp = 0 if z <= 1.0: tmp = (3.0 + (0.5 * z)) - (math.sqrt(z) + t_1) elif (z <= 8e+119) or (not (z <= 2.85e+132) and (z <= 1.45e+149)): tmp = ((0.5 * math.sqrt((1.0 / z))) + 2.0) - t_1 else: tmp = (1.0 - math.sqrt(x)) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) tmp = 0.0 if (z <= 1.0) tmp = Float64(Float64(3.0 + Float64(0.5 * z)) - Float64(sqrt(z) + t_1)); elseif ((z <= 8e+119) || (!(z <= 2.85e+132) && (z <= 1.45e+149))) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + 2.0) - t_1); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(x);
tmp = 0.0;
if (z <= 1.0)
tmp = (3.0 + (0.5 * z)) - (sqrt(z) + t_1);
elseif ((z <= 8e+119) || (~((z <= 2.85e+132)) && (z <= 1.45e+149)))
tmp = ((0.5 * sqrt((1.0 / z))) + 2.0) - t_1;
else
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.0], N[(N[(3.0 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 8e+119], And[N[Not[LessEqual[z, 2.85e+132]], $MachinePrecision], LessEqual[z, 1.45e+149]]], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
\mathbf{if}\;z \leq 1:\\
\;\;\;\;\left(3 + 0.5 \cdot z\right) - \left(\sqrt{z} + t\_1\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+119} \lor \neg \left(z \leq 2.85 \cdot 10^{+132}\right) \land z \leq 1.45 \cdot 10^{+149}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{z}} + 2\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 1Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 54.7%
Taylor expanded in t around inf 32.8%
Taylor expanded in y around 0 19.1%
Taylor expanded in z around 0 19.0%
associate-+r+19.0%
Simplified19.0%
if 1 < z < 7.99999999999999955e119 or 2.8499999999999999e132 < z < 1.4500000000000001e149Initial program 83.6%
associate-+l+83.6%
sub-neg83.6%
sub-neg83.6%
+-commutative83.6%
+-commutative83.6%
+-commutative83.6%
Simplified83.6%
Taylor expanded in x around 0 39.2%
Taylor expanded in t around inf 26.3%
Taylor expanded in y around 0 14.1%
Taylor expanded in z around inf 14.8%
if 7.99999999999999955e119 < z < 2.8499999999999999e132 or 1.4500000000000001e149 < z Initial program 79.1%
associate-+l+79.1%
sub-neg79.1%
sub-neg79.1%
+-commutative79.1%
+-commutative79.1%
+-commutative79.1%
Simplified79.1%
Taylor expanded in x around 0 46.3%
Taylor expanded in t around inf 29.6%
Taylor expanded in y around inf 18.3%
Final simplification17.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 (- 1.0 (sqrt x))))
(if (<= y 4.4e-171)
(- (+ 3.0 (* 0.5 z)) (+ (sqrt z) (+ (sqrt y) (sqrt x))))
(if (<= y 0.62)
(+ (* 0.5 (sqrt (/ 1.0 z))) (+ t_1 (+ 1.0 (- (* y 0.5) (sqrt y)))))
(+ t_1 (- (sqrt (+ 1.0 z)) (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - sqrt(x);
double tmp;
if (y <= 4.4e-171) {
tmp = (3.0 + (0.5 * z)) - (sqrt(z) + (sqrt(y) + sqrt(x)));
} else if (y <= 0.62) {
tmp = (0.5 * sqrt((1.0 / z))) + (t_1 + (1.0 + ((y * 0.5) - sqrt(y))));
} else {
tmp = t_1 + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - sqrt(x)
if (y <= 4.4d-171) then
tmp = (3.0d0 + (0.5d0 * z)) - (sqrt(z) + (sqrt(y) + sqrt(x)))
else if (y <= 0.62d0) then
tmp = (0.5d0 * sqrt((1.0d0 / z))) + (t_1 + (1.0d0 + ((y * 0.5d0) - sqrt(y))))
else
tmp = t_1 + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - Math.sqrt(x);
double tmp;
if (y <= 4.4e-171) {
tmp = (3.0 + (0.5 * z)) - (Math.sqrt(z) + (Math.sqrt(y) + Math.sqrt(x)));
} else if (y <= 0.62) {
tmp = (0.5 * Math.sqrt((1.0 / z))) + (t_1 + (1.0 + ((y * 0.5) - Math.sqrt(y))));
} else {
tmp = t_1 + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 - math.sqrt(x) tmp = 0 if y <= 4.4e-171: tmp = (3.0 + (0.5 * z)) - (math.sqrt(z) + (math.sqrt(y) + math.sqrt(x))) elif y <= 0.62: tmp = (0.5 * math.sqrt((1.0 / z))) + (t_1 + (1.0 + ((y * 0.5) - math.sqrt(y)))) else: tmp = t_1 + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 - sqrt(x)) tmp = 0.0 if (y <= 4.4e-171) tmp = Float64(Float64(3.0 + Float64(0.5 * z)) - Float64(sqrt(z) + Float64(sqrt(y) + sqrt(x)))); elseif (y <= 0.62) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(t_1 + Float64(1.0 + Float64(Float64(y * 0.5) - sqrt(y))))); else tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 - sqrt(x);
tmp = 0.0;
if (y <= 4.4e-171)
tmp = (3.0 + (0.5 * z)) - (sqrt(z) + (sqrt(y) + sqrt(x)));
elseif (y <= 0.62)
tmp = (0.5 * sqrt((1.0 / z))) + (t_1 + (1.0 + ((y * 0.5) - sqrt(y))));
else
tmp = t_1 + (sqrt((1.0 + z)) - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4.4e-171], N[(N[(3.0 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.62], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 - \sqrt{x}\\
\mathbf{if}\;y \leq 4.4 \cdot 10^{-171}:\\
\;\;\;\;\left(3 + 0.5 \cdot z\right) - \left(\sqrt{z} + \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{elif}\;y \leq 0.62:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(t\_1 + \left(1 + \left(y \cdot 0.5 - \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 4.4000000000000003e-171Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in x around 0 49.5%
Taylor expanded in t around inf 33.4%
Taylor expanded in y around 0 33.4%
Taylor expanded in z around 0 20.4%
associate-+r+20.4%
Simplified20.4%
if 4.4000000000000003e-171 < y < 0.619999999999999996Initial program 98.5%
associate-+l+98.5%
sub-neg98.5%
sub-neg98.5%
+-commutative98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in x around 0 49.5%
Taylor expanded in t around inf 31.4%
Taylor expanded in y around 0 30.5%
associate--l+30.5%
Simplified30.5%
Taylor expanded in z around inf 17.8%
if 0.619999999999999996 < y Initial program 79.6%
associate-+l+79.6%
sub-neg79.6%
sub-neg79.6%
+-commutative79.6%
+-commutative79.6%
+-commutative79.6%
Simplified79.6%
Taylor expanded in x around 0 48.0%
Taylor expanded in t around inf 28.3%
Taylor expanded in y around inf 28.3%
Final simplification23.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt y) (sqrt x))))
(if (<= y 4.4e-171)
(- (+ 3.0 (* 0.5 z)) (+ (sqrt z) t_1))
(if (<= y 0.75)
(- (+ 2.0 (* 0.5 (+ y (sqrt (/ 1.0 z))))) t_1)
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 z)) (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(x);
double tmp;
if (y <= 4.4e-171) {
tmp = (3.0 + (0.5 * z)) - (sqrt(z) + t_1);
} else if (y <= 0.75) {
tmp = (2.0 + (0.5 * (y + sqrt((1.0 / z))))) - t_1;
} else {
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
if (y <= 4.4d-171) then
tmp = (3.0d0 + (0.5d0 * z)) - (sqrt(z) + t_1)
else if (y <= 0.75d0) then
tmp = (2.0d0 + (0.5d0 * (y + sqrt((1.0d0 / z))))) - t_1
else
tmp = (1.0d0 - sqrt(x)) + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt(x);
double tmp;
if (y <= 4.4e-171) {
tmp = (3.0 + (0.5 * z)) - (Math.sqrt(z) + t_1);
} else if (y <= 0.75) {
tmp = (2.0 + (0.5 * (y + Math.sqrt((1.0 / z))))) - t_1;
} else {
tmp = (1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(x) tmp = 0 if y <= 4.4e-171: tmp = (3.0 + (0.5 * z)) - (math.sqrt(z) + t_1) elif y <= 0.75: tmp = (2.0 + (0.5 * (y + math.sqrt((1.0 / z))))) - t_1 else: tmp = (1.0 - math.sqrt(x)) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) tmp = 0.0 if (y <= 4.4e-171) tmp = Float64(Float64(3.0 + Float64(0.5 * z)) - Float64(sqrt(z) + t_1)); elseif (y <= 0.75) tmp = Float64(Float64(2.0 + Float64(0.5 * Float64(y + sqrt(Float64(1.0 / z))))) - t_1); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(x);
tmp = 0.0;
if (y <= 4.4e-171)
tmp = (3.0 + (0.5 * z)) - (sqrt(z) + t_1);
elseif (y <= 0.75)
tmp = (2.0 + (0.5 * (y + sqrt((1.0 / z))))) - t_1;
else
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4.4e-171], N[(N[(3.0 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.75], N[(N[(2.0 + N[(0.5 * N[(y + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
\mathbf{if}\;y \leq 4.4 \cdot 10^{-171}:\\
\;\;\;\;\left(3 + 0.5 \cdot z\right) - \left(\sqrt{z} + t\_1\right)\\
\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\left(2 + 0.5 \cdot \left(y + \sqrt{\frac{1}{z}}\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 4.4000000000000003e-171Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in x around 0 49.5%
Taylor expanded in t around inf 33.4%
Taylor expanded in y around 0 33.4%
Taylor expanded in z around 0 20.4%
associate-+r+20.4%
Simplified20.4%
if 4.4000000000000003e-171 < y < 0.75Initial program 98.5%
associate-+l+98.5%
sub-neg98.5%
sub-neg98.5%
+-commutative98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in x around 0 49.5%
Taylor expanded in t around inf 31.4%
Taylor expanded in y around 0 30.5%
associate--l+30.5%
Simplified30.5%
Taylor expanded in z around inf 17.8%
distribute-lft-out17.8%
Simplified17.8%
if 0.75 < y Initial program 79.6%
associate-+l+79.6%
sub-neg79.6%
sub-neg79.6%
+-commutative79.6%
+-commutative79.6%
+-commutative79.6%
Simplified79.6%
Taylor expanded in x around 0 48.0%
Taylor expanded in t around inf 28.3%
Taylor expanded in y around inf 28.3%
Final simplification23.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 0.78) (- 3.0 (+ (sqrt z) (+ (sqrt y) (sqrt x)))) (+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 z)) (sqrt z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.78) {
tmp = 3.0 - (sqrt(z) + (sqrt(y) + sqrt(x)));
} else {
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.78d0) then
tmp = 3.0d0 - (sqrt(z) + (sqrt(y) + sqrt(x)))
else
tmp = (1.0d0 - sqrt(x)) + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.78) {
tmp = 3.0 - (Math.sqrt(z) + (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.78: tmp = 3.0 - (math.sqrt(z) + (math.sqrt(y) + math.sqrt(x))) else: tmp = (1.0 - math.sqrt(x)) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.78) tmp = Float64(3.0 - Float64(sqrt(z) + Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.78)
tmp = 3.0 - (sqrt(z) + (sqrt(y) + sqrt(x)));
else
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.78], N[(3.0 - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.78:\\
\;\;\;\;3 - \left(\sqrt{z} + \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 0.78000000000000003Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 54.7%
Taylor expanded in t around inf 32.8%
Taylor expanded in y around 0 19.1%
Taylor expanded in z around 0 18.4%
associate-+r+18.4%
Simplified18.4%
if 0.78000000000000003 < z Initial program 81.0%
associate-+l+81.0%
sub-neg81.0%
sub-neg81.0%
+-commutative81.0%
+-commutative81.0%
+-commutative81.0%
Simplified81.0%
Taylor expanded in x around 0 43.3%
Taylor expanded in t around inf 28.2%
Taylor expanded in y around inf 17.7%
Final simplification18.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 2.05) (- 3.0 (+ (sqrt z) (+ (sqrt y) (sqrt x)))) (- (* 0.5 (sqrt (/ 1.0 z))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.05) {
tmp = 3.0 - (sqrt(z) + (sqrt(y) + sqrt(x)));
} else {
tmp = (0.5 * sqrt((1.0 / z))) - 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.05d0) then
tmp = 3.0d0 - (sqrt(z) + (sqrt(y) + sqrt(x)))
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) - 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.05) {
tmp = 3.0 - (Math.sqrt(z) + (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) - 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.05: tmp = 3.0 - (math.sqrt(z) + (math.sqrt(y) + math.sqrt(x))) else: tmp = (0.5 * math.sqrt((1.0 / z))) - 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.05) tmp = Float64(3.0 - Float64(sqrt(z) + Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - 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.05)
tmp = 3.0 - (sqrt(z) + (sqrt(y) + sqrt(x)));
else
tmp = (0.5 * sqrt((1.0 / z))) - 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.05], N[(3.0 - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.05:\\
\;\;\;\;3 - \left(\sqrt{z} + \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} - \sqrt{x}\\
\end{array}
\end{array}
if z < 2.0499999999999998Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 54.7%
Taylor expanded in t around inf 32.8%
Taylor expanded in y around 0 19.1%
Taylor expanded in z around 0 18.4%
associate-+r+18.4%
Simplified18.4%
if 2.0499999999999998 < z Initial program 81.0%
associate-+l+81.0%
sub-neg81.0%
sub-neg81.0%
+-commutative81.0%
+-commutative81.0%
+-commutative81.0%
Simplified81.0%
Taylor expanded in x around 0 43.3%
Taylor expanded in t around inf 28.2%
Taylor expanded in x around inf 1.8%
mul-1-neg1.8%
Simplified1.8%
Taylor expanded in z around inf 3.0%
Final simplification10.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.0038) (- (- 1.0 (sqrt x)) (sqrt z)) (- (* 0.5 (sqrt (/ 1.0 z))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.0038) {
tmp = (1.0 - sqrt(x)) - sqrt(z);
} else {
tmp = (0.5 * sqrt((1.0 / z))) - 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 <= 0.0038d0) then
tmp = (1.0d0 - sqrt(x)) - sqrt(z)
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) - 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 <= 0.0038) {
tmp = (1.0 - Math.sqrt(x)) - Math.sqrt(z);
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.0038: tmp = (1.0 - math.sqrt(x)) - math.sqrt(z) else: tmp = (0.5 * math.sqrt((1.0 / z))) - 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 <= 0.0038) tmp = Float64(Float64(1.0 - sqrt(x)) - sqrt(z)); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - 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 <= 0.0038)
tmp = (1.0 - sqrt(x)) - sqrt(z);
else
tmp = (0.5 * sqrt((1.0 / z))) - 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, 0.0038], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.0038:\\
\;\;\;\;\left(1 - \sqrt{x}\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} - \sqrt{x}\\
\end{array}
\end{array}
if z < 0.00379999999999999999Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 54.7%
Taylor expanded in t around inf 32.8%
Taylor expanded in x around inf 10.5%
mul-1-neg10.5%
Simplified10.5%
Taylor expanded in z around 0 10.5%
associate--r+10.5%
Simplified10.5%
if 0.00379999999999999999 < z Initial program 81.0%
associate-+l+81.0%
sub-neg81.0%
sub-neg81.0%
+-commutative81.0%
+-commutative81.0%
+-commutative81.0%
Simplified81.0%
Taylor expanded in x around 0 43.3%
Taylor expanded in t around inf 28.2%
Taylor expanded in x around inf 1.8%
mul-1-neg1.8%
Simplified1.8%
Taylor expanded in z around inf 3.0%
Final simplification6.6%
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 (- (* 0.5 z) (+ (sqrt x) (sqrt z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((0.5 * z) - (sqrt(x) + sqrt(z)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + ((0.5d0 * z) - (sqrt(x) + sqrt(z)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((0.5 * z) - (Math.sqrt(x) + Math.sqrt(z)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((0.5 * z) - (math.sqrt(x) + math.sqrt(z)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(0.5 * z) - Float64(sqrt(x) + sqrt(z)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((0.5 * z) - (sqrt(x) + sqrt(z)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[(0.5 * z), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(0.5 \cdot z - \left(\sqrt{x} + \sqrt{z}\right)\right)
\end{array}
Initial program 89.2%
associate-+l+89.2%
sub-neg89.2%
sub-neg89.2%
+-commutative89.2%
+-commutative89.2%
+-commutative89.2%
Simplified89.2%
Taylor expanded in x around 0 48.8%
Taylor expanded in t around inf 30.4%
Taylor expanded in x around inf 5.9%
mul-1-neg5.9%
Simplified5.9%
Taylor expanded in z around 0 7.2%
associate--l+7.2%
Simplified7.2%
Final simplification7.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (- 1.0 (sqrt x)) (sqrt z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 - sqrt(x)) - sqrt(z);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 - sqrt(x)) - sqrt(z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 - Math.sqrt(x)) - Math.sqrt(z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 - math.sqrt(x)) - math.sqrt(z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 - sqrt(x)) - sqrt(z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 - sqrt(x)) - sqrt(z);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 - \sqrt{x}\right) - \sqrt{z}
\end{array}
Initial program 89.2%
associate-+l+89.2%
sub-neg89.2%
sub-neg89.2%
+-commutative89.2%
+-commutative89.2%
+-commutative89.2%
Simplified89.2%
Taylor expanded in x around 0 48.8%
Taylor expanded in t around inf 30.4%
Taylor expanded in x around inf 5.9%
mul-1-neg5.9%
Simplified5.9%
Taylor expanded in z around 0 5.7%
associate--r+5.7%
Simplified5.7%
Final simplification5.7%
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 89.2%
associate-+l+89.2%
sub-neg89.2%
sub-neg89.2%
+-commutative89.2%
+-commutative89.2%
+-commutative89.2%
Simplified89.2%
Taylor expanded in x around 0 48.8%
Taylor expanded in t around inf 30.4%
Taylor expanded in x around inf 5.9%
mul-1-neg5.9%
Simplified5.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 2024083
(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))))