
(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 20 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}
(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}
Initial program 89.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ z 1.0)) (sqrt z)))
(t_2 (- (sqrt (+ t 1.0)) (sqrt t)))
(t_3 (sqrt (+ y 1.0)))
(t_4 (- t_3 (sqrt y)))
(t_5 (+ (- (sqrt (+ x 1.0)) (sqrt x)) t_4)))
(if (<= t_5 0.5)
(+ t_1 t_2)
(if (<= t_5 1.0012) (+ (+ t_2 t_2) t_1) (+ (+ t_3 t_4) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0)) - sqrt(z);
double t_2 = sqrt((t + 1.0)) - sqrt(t);
double t_3 = sqrt((y + 1.0));
double t_4 = t_3 - sqrt(y);
double t_5 = (sqrt((x + 1.0)) - sqrt(x)) + t_4;
double tmp;
if (t_5 <= 0.5) {
tmp = t_1 + t_2;
} else if (t_5 <= 1.0012) {
tmp = (t_2 + t_2) + t_1;
} else {
tmp = (t_3 + t_4) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((z + 1.0d0)) - sqrt(z)
t_2 = sqrt((t + 1.0d0)) - sqrt(t)
t_3 = sqrt((y + 1.0d0))
t_4 = t_3 - sqrt(y)
t_5 = (sqrt((x + 1.0d0)) - sqrt(x)) + t_4
if (t_5 <= 0.5d0) then
tmp = t_1 + t_2
else if (t_5 <= 1.0012d0) then
tmp = (t_2 + t_2) + t_1
else
tmp = (t_3 + t_4) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double t_2 = Math.sqrt((t + 1.0)) - Math.sqrt(t);
double t_3 = Math.sqrt((y + 1.0));
double t_4 = t_3 - Math.sqrt(y);
double t_5 = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + t_4;
double tmp;
if (t_5 <= 0.5) {
tmp = t_1 + t_2;
} else if (t_5 <= 1.0012) {
tmp = (t_2 + t_2) + t_1;
} else {
tmp = (t_3 + t_4) + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) - math.sqrt(z) t_2 = math.sqrt((t + 1.0)) - math.sqrt(t) t_3 = math.sqrt((y + 1.0)) t_4 = t_3 - math.sqrt(y) t_5 = (math.sqrt((x + 1.0)) - math.sqrt(x)) + t_4 tmp = 0 if t_5 <= 0.5: tmp = t_1 + t_2 elif t_5 <= 1.0012: tmp = (t_2 + t_2) + t_1 else: tmp = (t_3 + t_4) + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) t_2 = Float64(sqrt(Float64(t + 1.0)) - sqrt(t)) t_3 = sqrt(Float64(y + 1.0)) t_4 = Float64(t_3 - sqrt(y)) t_5 = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + t_4) tmp = 0.0 if (t_5 <= 0.5) tmp = Float64(t_1 + t_2); elseif (t_5 <= 1.0012) tmp = Float64(Float64(t_2 + t_2) + t_1); else tmp = Float64(Float64(t_3 + t_4) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + 1.0)) - sqrt(z); t_2 = sqrt((t + 1.0)) - sqrt(t); t_3 = sqrt((y + 1.0)); t_4 = t_3 - sqrt(y); t_5 = (sqrt((x + 1.0)) - sqrt(x)) + t_4; tmp = 0.0; if (t_5 <= 0.5) tmp = t_1 + t_2; elseif (t_5 <= 1.0012) tmp = (t_2 + t_2) + t_1; else tmp = (t_3 + t_4) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]}, If[LessEqual[t$95$5, 0.5], N[(t$95$1 + t$95$2), $MachinePrecision], If[LessEqual[t$95$5, 1.0012], N[(N[(t$95$2 + t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(t$95$3 + t$95$4), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z + 1} - \sqrt{z}\\
t_2 := \sqrt{t + 1} - \sqrt{t}\\
t_3 := \sqrt{y + 1}\\
t_4 := t\_3 - \sqrt{y}\\
t_5 := \left(\sqrt{x + 1} - \sqrt{x}\right) + t\_4\\
\mathbf{if}\;t\_5 \leq 0.5:\\
\;\;\;\;t\_1 + t\_2\\
\mathbf{elif}\;t\_5 \leq 1.0012:\\
\;\;\;\;\left(t\_2 + t\_2\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(t\_3 + t\_4\right) + t\_1\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 0.5Initial program 71.1%
Taylor expanded in x around 0
Applied rewrites67.2%
if 0.5 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1.00120000000000009Initial program 95.2%
Taylor expanded in x around 0
Applied rewrites60.9%
Taylor expanded in x around 0
Applied rewrites46.1%
if 1.00120000000000009 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) Initial program 97.0%
Taylor expanded in x around 0
Applied rewrites58.9%
Taylor expanded in x around 0
Applied rewrites53.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ z 1.0)) (sqrt z)))
(t_2 (sqrt (+ y 1.0)))
(t_3 (- t_2 (sqrt y)))
(t_4 (+ (- (sqrt (+ x 1.0)) (sqrt x)) t_3)))
(if (<= t_4 0.95)
(+ t_1 (- (sqrt (+ t 1.0)) (sqrt t)))
(if (<= t_4 1.98) t_4 (+ (+ t_2 t_3) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0)) - sqrt(z);
double t_2 = sqrt((y + 1.0));
double t_3 = t_2 - sqrt(y);
double t_4 = (sqrt((x + 1.0)) - sqrt(x)) + t_3;
double tmp;
if (t_4 <= 0.95) {
tmp = t_1 + (sqrt((t + 1.0)) - sqrt(t));
} else if (t_4 <= 1.98) {
tmp = t_4;
} else {
tmp = (t_2 + t_3) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((z + 1.0d0)) - sqrt(z)
t_2 = sqrt((y + 1.0d0))
t_3 = t_2 - sqrt(y)
t_4 = (sqrt((x + 1.0d0)) - sqrt(x)) + t_3
if (t_4 <= 0.95d0) then
tmp = t_1 + (sqrt((t + 1.0d0)) - sqrt(t))
else if (t_4 <= 1.98d0) then
tmp = t_4
else
tmp = (t_2 + t_3) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double t_2 = Math.sqrt((y + 1.0));
double t_3 = t_2 - Math.sqrt(y);
double t_4 = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + t_3;
double tmp;
if (t_4 <= 0.95) {
tmp = t_1 + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
} else if (t_4 <= 1.98) {
tmp = t_4;
} else {
tmp = (t_2 + t_3) + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) - math.sqrt(z) t_2 = math.sqrt((y + 1.0)) t_3 = t_2 - math.sqrt(y) t_4 = (math.sqrt((x + 1.0)) - math.sqrt(x)) + t_3 tmp = 0 if t_4 <= 0.95: tmp = t_1 + (math.sqrt((t + 1.0)) - math.sqrt(t)) elif t_4 <= 1.98: tmp = t_4 else: tmp = (t_2 + t_3) + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) t_2 = sqrt(Float64(y + 1.0)) t_3 = Float64(t_2 - sqrt(y)) t_4 = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + t_3) tmp = 0.0 if (t_4 <= 0.95) tmp = Float64(t_1 + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))); elseif (t_4 <= 1.98) tmp = t_4; else tmp = Float64(Float64(t_2 + t_3) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + 1.0)) - sqrt(z); t_2 = sqrt((y + 1.0)); t_3 = t_2 - sqrt(y); t_4 = (sqrt((x + 1.0)) - sqrt(x)) + t_3; tmp = 0.0; if (t_4 <= 0.95) tmp = t_1 + (sqrt((t + 1.0)) - sqrt(t)); elseif (t_4 <= 1.98) tmp = t_4; else tmp = (t_2 + t_3) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]}, If[LessEqual[t$95$4, 0.95], N[(t$95$1 + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 1.98], t$95$4, N[(N[(t$95$2 + t$95$3), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z + 1} - \sqrt{z}\\
t_2 := \sqrt{y + 1}\\
t_3 := t\_2 - \sqrt{y}\\
t_4 := \left(\sqrt{x + 1} - \sqrt{x}\right) + t\_3\\
\mathbf{if}\;t\_4 \leq 0.95:\\
\;\;\;\;t\_1 + \left(\sqrt{t + 1} - \sqrt{t}\right)\\
\mathbf{elif}\;t\_4 \leq 1.98:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 + t\_3\right) + t\_1\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 0.94999999999999996Initial program 71.4%
Taylor expanded in x around 0
Applied rewrites66.6%
if 0.94999999999999996 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1.98Initial program 95.0%
Taylor expanded in x around 0
Applied rewrites39.3%
if 1.98 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) Initial program 97.3%
Taylor expanded in x around 0
Applied rewrites57.1%
Taylor expanded in x around 0
Applied rewrites55.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ y 1.0)) (sqrt y)))
(t_2 (- (sqrt (+ t 1.0)) (sqrt t)))
(t_3 (- (sqrt (+ z 1.0)) (sqrt z))))
(if (<= t_2 1e-6)
(+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) t_1) t_3)
(+ (+ (+ t_1 t_2) t_1) t_3))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double t_2 = sqrt((t + 1.0)) - sqrt(t);
double t_3 = sqrt((z + 1.0)) - sqrt(z);
double tmp;
if (t_2 <= 1e-6) {
tmp = ((sqrt((x + 1.0)) - sqrt(x)) + t_1) + t_3;
} else {
tmp = ((t_1 + t_2) + t_1) + t_3;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((y + 1.0d0)) - sqrt(y)
t_2 = sqrt((t + 1.0d0)) - sqrt(t)
t_3 = sqrt((z + 1.0d0)) - sqrt(z)
if (t_2 <= 1d-6) then
tmp = ((sqrt((x + 1.0d0)) - sqrt(x)) + t_1) + t_3
else
tmp = ((t_1 + t_2) + t_1) + t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double t_2 = Math.sqrt((t + 1.0)) - Math.sqrt(t);
double t_3 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double tmp;
if (t_2 <= 1e-6) {
tmp = ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + t_1) + t_3;
} else {
tmp = ((t_1 + t_2) + t_1) + t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) - math.sqrt(y) t_2 = math.sqrt((t + 1.0)) - math.sqrt(t) t_3 = math.sqrt((z + 1.0)) - math.sqrt(z) tmp = 0 if t_2 <= 1e-6: tmp = ((math.sqrt((x + 1.0)) - math.sqrt(x)) + t_1) + t_3 else: tmp = ((t_1 + t_2) + t_1) + t_3 return tmp
function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_2 = Float64(sqrt(Float64(t + 1.0)) - sqrt(t)) t_3 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) tmp = 0.0 if (t_2 <= 1e-6) tmp = Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + t_1) + t_3); else tmp = Float64(Float64(Float64(t_1 + t_2) + t_1) + t_3); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((y + 1.0)) - sqrt(y); t_2 = sqrt((t + 1.0)) - sqrt(t); t_3 = sqrt((z + 1.0)) - sqrt(z); tmp = 0.0; if (t_2 <= 1e-6) tmp = ((sqrt((x + 1.0)) - sqrt(x)) + t_1) + t_3; else tmp = ((t_1 + t_2) + t_1) + t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 1e-6], N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision], N[(N[(N[(t$95$1 + t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} - \sqrt{y}\\
t_2 := \sqrt{t + 1} - \sqrt{t}\\
t_3 := \sqrt{z + 1} - \sqrt{z}\\
\mathbf{if}\;t\_2 \leq 10^{-6}:\\
\;\;\;\;\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + t\_1\right) + t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 + t\_2\right) + t\_1\right) + t\_3\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) < 9.99999999999999955e-7Initial program 82.0%
Taylor expanded in x around 0
Applied rewrites81.4%
if 9.99999999999999955e-7 < (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) Initial program 96.7%
Taylor expanded in x around 0
Applied rewrites18.1%
Taylor expanded in x around 0
Applied rewrites65.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ y 1.0)) (sqrt y)))
(t_2 (sqrt (+ t 1.0)))
(t_3 (- (sqrt (+ z 1.0)) (sqrt z))))
(if (<= (- t_2 (sqrt t)) 0.005)
(+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) t_1) t_3)
(+ (+ t_2 t_1) t_3))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double t_2 = sqrt((t + 1.0));
double t_3 = sqrt((z + 1.0)) - sqrt(z);
double tmp;
if ((t_2 - sqrt(t)) <= 0.005) {
tmp = ((sqrt((x + 1.0)) - sqrt(x)) + t_1) + t_3;
} else {
tmp = (t_2 + t_1) + t_3;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((y + 1.0d0)) - sqrt(y)
t_2 = sqrt((t + 1.0d0))
t_3 = sqrt((z + 1.0d0)) - sqrt(z)
if ((t_2 - sqrt(t)) <= 0.005d0) then
tmp = ((sqrt((x + 1.0d0)) - sqrt(x)) + t_1) + t_3
else
tmp = (t_2 + t_1) + t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double t_2 = Math.sqrt((t + 1.0));
double t_3 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double tmp;
if ((t_2 - Math.sqrt(t)) <= 0.005) {
tmp = ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + t_1) + t_3;
} else {
tmp = (t_2 + t_1) + t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) - math.sqrt(y) t_2 = math.sqrt((t + 1.0)) t_3 = math.sqrt((z + 1.0)) - math.sqrt(z) tmp = 0 if (t_2 - math.sqrt(t)) <= 0.005: tmp = ((math.sqrt((x + 1.0)) - math.sqrt(x)) + t_1) + t_3 else: tmp = (t_2 + t_1) + t_3 return tmp
function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_2 = sqrt(Float64(t + 1.0)) t_3 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) tmp = 0.0 if (Float64(t_2 - sqrt(t)) <= 0.005) tmp = Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + t_1) + t_3); else tmp = Float64(Float64(t_2 + t_1) + t_3); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((y + 1.0)) - sqrt(y); t_2 = sqrt((t + 1.0)); t_3 = sqrt((z + 1.0)) - sqrt(z); tmp = 0.0; if ((t_2 - sqrt(t)) <= 0.005) tmp = ((sqrt((x + 1.0)) - sqrt(x)) + t_1) + t_3; else tmp = (t_2 + t_1) + t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision], 0.005], N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision], N[(N[(t$95$2 + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} - \sqrt{y}\\
t_2 := \sqrt{t + 1}\\
t_3 := \sqrt{z + 1} - \sqrt{z}\\
\mathbf{if}\;t\_2 - \sqrt{t} \leq 0.005:\\
\;\;\;\;\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + t\_1\right) + t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 + t\_1\right) + t\_3\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) < 0.0050000000000000001Initial program 82.1%
Taylor expanded in x around 0
Applied rewrites80.5%
if 0.0050000000000000001 < (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) Initial program 96.9%
Taylor expanded in x around 0
Applied rewrites17.6%
Taylor expanded in x around 0
Applied rewrites64.6%
Taylor expanded in x around 0
Applied rewrites55.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y)))))
(if (<= t_1 0.95)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) (- (sqrt (+ t 1.0)) (sqrt t)))
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = (sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y));
double tmp;
if (t_1 <= 0.95) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (sqrt((t + 1.0)) - sqrt(t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))
if (t_1 <= 0.95d0) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + (sqrt((t + 1.0d0)) - sqrt(t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y));
double tmp;
if (t_1 <= 0.95) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y)) tmp = 0 if t_1 <= 0.95: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + (math.sqrt((t + 1.0)) - math.sqrt(t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) tmp = 0.0 if (t_1 <= 0.95) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y)); tmp = 0.0; if (t_1 <= 0.95) tmp = (sqrt((z + 1.0)) - sqrt(z)) + (sqrt((t + 1.0)) - sqrt(t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, 0.95], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\mathbf{if}\;t\_1 \leq 0.95:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 0.94999999999999996Initial program 71.4%
Taylor expanded in x around 0
Applied rewrites66.6%
if 0.94999999999999996 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) Initial program 96.0%
Taylor expanded in x around 0
Applied rewrites37.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))))) (if (<= t_1 0.95) (+ (sqrt (+ t 1.0)) (- (sqrt (+ z 1.0)) (sqrt z))) t_1)))
double code(double x, double y, double z, double t) {
double t_1 = (sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y));
double tmp;
if (t_1 <= 0.95) {
tmp = sqrt((t + 1.0)) + (sqrt((z + 1.0)) - sqrt(z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))
if (t_1 <= 0.95d0) then
tmp = sqrt((t + 1.0d0)) + (sqrt((z + 1.0d0)) - sqrt(z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y));
double tmp;
if (t_1 <= 0.95) {
tmp = Math.sqrt((t + 1.0)) + (Math.sqrt((z + 1.0)) - Math.sqrt(z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y)) tmp = 0 if t_1 <= 0.95: tmp = math.sqrt((t + 1.0)) + (math.sqrt((z + 1.0)) - math.sqrt(z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) tmp = 0.0 if (t_1 <= 0.95) tmp = Float64(sqrt(Float64(t + 1.0)) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y)); tmp = 0.0; if (t_1 <= 0.95) tmp = sqrt((t + 1.0)) + (sqrt((z + 1.0)) - sqrt(z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, 0.95], N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\mathbf{if}\;t\_1 \leq 0.95:\\
\;\;\;\;\sqrt{t + 1} + \left(\sqrt{z + 1} - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 0.94999999999999996Initial program 71.4%
Taylor expanded in x around 0
Applied rewrites27.4%
Taylor expanded in x around 0
Applied rewrites48.9%
if 0.94999999999999996 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) Initial program 96.0%
Taylor expanded in x around 0
Applied rewrites37.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ z 1.0)) (sqrt z)))
(t_2 (sqrt (+ t 1.0)))
(t_3 (- (sqrt (+ y 1.0)) (sqrt y))))
(if (<= t 5e-230)
(+ (+ t_2 t_3) t_1)
(if (<= t 1.46)
(+ (+ (+ t_2 t_1) t_3) t_1)
(+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) t_3) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0)) - sqrt(z);
double t_2 = sqrt((t + 1.0));
double t_3 = sqrt((y + 1.0)) - sqrt(y);
double tmp;
if (t <= 5e-230) {
tmp = (t_2 + t_3) + t_1;
} else if (t <= 1.46) {
tmp = ((t_2 + t_1) + t_3) + t_1;
} else {
tmp = ((sqrt((x + 1.0)) - sqrt(x)) + t_3) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((z + 1.0d0)) - sqrt(z)
t_2 = sqrt((t + 1.0d0))
t_3 = sqrt((y + 1.0d0)) - sqrt(y)
if (t <= 5d-230) then
tmp = (t_2 + t_3) + t_1
else if (t <= 1.46d0) then
tmp = ((t_2 + t_1) + t_3) + t_1
else
tmp = ((sqrt((x + 1.0d0)) - sqrt(x)) + t_3) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double t_2 = Math.sqrt((t + 1.0));
double t_3 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double tmp;
if (t <= 5e-230) {
tmp = (t_2 + t_3) + t_1;
} else if (t <= 1.46) {
tmp = ((t_2 + t_1) + t_3) + t_1;
} else {
tmp = ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + t_3) + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) - math.sqrt(z) t_2 = math.sqrt((t + 1.0)) t_3 = math.sqrt((y + 1.0)) - math.sqrt(y) tmp = 0 if t <= 5e-230: tmp = (t_2 + t_3) + t_1 elif t <= 1.46: tmp = ((t_2 + t_1) + t_3) + t_1 else: tmp = ((math.sqrt((x + 1.0)) - math.sqrt(x)) + t_3) + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) t_2 = sqrt(Float64(t + 1.0)) t_3 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) tmp = 0.0 if (t <= 5e-230) tmp = Float64(Float64(t_2 + t_3) + t_1); elseif (t <= 1.46) tmp = Float64(Float64(Float64(t_2 + t_1) + t_3) + t_1); else tmp = Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + t_3) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + 1.0)) - sqrt(z); t_2 = sqrt((t + 1.0)); t_3 = sqrt((y + 1.0)) - sqrt(y); tmp = 0.0; if (t <= 5e-230) tmp = (t_2 + t_3) + t_1; elseif (t <= 1.46) tmp = ((t_2 + t_1) + t_3) + t_1; else tmp = ((sqrt((x + 1.0)) - sqrt(x)) + t_3) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 5e-230], N[(N[(t$95$2 + t$95$3), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 1.46], N[(N[(N[(t$95$2 + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z + 1} - \sqrt{z}\\
t_2 := \sqrt{t + 1}\\
t_3 := \sqrt{y + 1} - \sqrt{y}\\
\mathbf{if}\;t \leq 5 \cdot 10^{-230}:\\
\;\;\;\;\left(t\_2 + t\_3\right) + t\_1\\
\mathbf{elif}\;t \leq 1.46:\\
\;\;\;\;\left(\left(t\_2 + t\_1\right) + t\_3\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + t\_3\right) + t\_1\\
\end{array}
\end{array}
if t < 5.00000000000000035e-230Initial program 98.0%
Taylor expanded in x around 0
Applied rewrites16.2%
Taylor expanded in x around 0
Applied rewrites73.1%
Taylor expanded in x around 0
Applied rewrites73.4%
if 5.00000000000000035e-230 < t < 1.46Initial program 96.6%
Taylor expanded in x around 0
Applied rewrites18.0%
Taylor expanded in x around 0
Applied rewrites61.9%
Taylor expanded in x around 0
Applied rewrites57.2%
if 1.46 < t Initial program 82.1%
Taylor expanded in x around 0
Applied rewrites80.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ y 1.0)) (sqrt y))))
(if (<= t 57.0)
(+ (+ (sqrt (+ t 1.0)) t_1) (- (sqrt (+ z 1.0)) (sqrt z)))
(+ (- (sqrt (+ x 1.0)) (sqrt x)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double tmp;
if (t <= 57.0) {
tmp = (sqrt((t + 1.0)) + t_1) + (sqrt((z + 1.0)) - sqrt(z));
} else {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + t_1;
}
return tmp;
}
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 <= 57.0d0) then
tmp = (sqrt((t + 1.0d0)) + t_1) + (sqrt((z + 1.0d0)) - sqrt(z))
else
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + t_1
end if
code = tmp
end function
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 <= 57.0) {
tmp = (Math.sqrt((t + 1.0)) + t_1) + (Math.sqrt((z + 1.0)) - Math.sqrt(z));
} else {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) - math.sqrt(y) tmp = 0 if t <= 57.0: tmp = (math.sqrt((t + 1.0)) + t_1) + (math.sqrt((z + 1.0)) - math.sqrt(z)) else: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) tmp = 0.0 if (t <= 57.0) tmp = Float64(Float64(sqrt(Float64(t + 1.0)) + t_1) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((y + 1.0)) - sqrt(y); tmp = 0.0; if (t <= 57.0) tmp = (sqrt((t + 1.0)) + t_1) + (sqrt((z + 1.0)) - sqrt(z)); else tmp = (sqrt((x + 1.0)) - sqrt(x)) + t_1; end tmp_2 = tmp; end
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, 57.0], N[(N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} - \sqrt{y}\\
\mathbf{if}\;t \leq 57:\\
\;\;\;\;\left(\sqrt{t + 1} + t\_1\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + t\_1\\
\end{array}
\end{array}
if t < 57Initial program 96.9%
Taylor expanded in x around 0
Applied rewrites17.6%
Taylor expanded in x around 0
Applied rewrites64.6%
Taylor expanded in x around 0
Applied rewrites55.3%
if 57 < t Initial program 82.1%
Taylor expanded in x around 0
Applied rewrites40.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (sqrt (+ y 1.0)) (sqrt y)))) (if (<= t_1 0.95) (+ (sqrt (+ t 1.0)) t_1) (+ (+ y 1.0) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double tmp;
if (t_1 <= 0.95) {
tmp = sqrt((t + 1.0)) + t_1;
} else {
tmp = (y + 1.0) + t_1;
}
return tmp;
}
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 <= 0.95d0) then
tmp = sqrt((t + 1.0d0)) + t_1
else
tmp = (y + 1.0d0) + t_1
end if
code = tmp
end function
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 <= 0.95) {
tmp = Math.sqrt((t + 1.0)) + t_1;
} else {
tmp = (y + 1.0) + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) - math.sqrt(y) tmp = 0 if t_1 <= 0.95: tmp = math.sqrt((t + 1.0)) + t_1 else: tmp = (y + 1.0) + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) tmp = 0.0 if (t_1 <= 0.95) tmp = Float64(sqrt(Float64(t + 1.0)) + t_1); else tmp = Float64(Float64(y + 1.0) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((y + 1.0)) - sqrt(y); tmp = 0.0; if (t_1 <= 0.95) tmp = sqrt((t + 1.0)) + t_1; else tmp = (y + 1.0) + t_1; end tmp_2 = tmp; end
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, 0.95], N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(y + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} - \sqrt{y}\\
\mathbf{if}\;t\_1 \leq 0.95:\\
\;\;\;\;\sqrt{t + 1} + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + 1\right) + t\_1\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 0.94999999999999996Initial program 82.5%
Taylor expanded in x around 0
Applied rewrites45.0%
Taylor expanded in x around 0
Applied rewrites20.7%
Taylor expanded in x around 0
Applied rewrites21.9%
if 0.94999999999999996 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 96.1%
Taylor expanded in x around 0
Applied rewrites35.4%
Taylor expanded in x around 0
Applied rewrites52.9%
Taylor expanded in x around 0
Applied rewrites42.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ t 1.0)) (sqrt t))))
(if (<= t 3.8e-11)
(+ t_1 t_1)
(+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((t + 1.0)) - sqrt(t);
double tmp;
if (t <= 3.8e-11) {
tmp = t_1 + t_1;
} else {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y));
}
return tmp;
}
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((t + 1.0d0)) - sqrt(t)
if (t <= 3.8d-11) then
tmp = t_1 + t_1
else
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((t + 1.0)) - Math.sqrt(t);
double tmp;
if (t <= 3.8e-11) {
tmp = t_1 + t_1;
} else {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((t + 1.0)) - math.sqrt(t) tmp = 0 if t <= 3.8e-11: tmp = t_1 + t_1 else: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y)) return tmp
function code(x, y, z, t) t_1 = Float64(sqrt(Float64(t + 1.0)) - sqrt(t)) tmp = 0.0 if (t <= 3.8e-11) tmp = Float64(t_1 + t_1); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((t + 1.0)) - sqrt(t); tmp = 0.0; if (t <= 3.8e-11) tmp = t_1 + t_1; else tmp = (sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 3.8e-11], N[(t$95$1 + t$95$1), $MachinePrecision], 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]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{t + 1} - \sqrt{t}\\
\mathbf{if}\;t \leq 3.8 \cdot 10^{-11}:\\
\;\;\;\;t\_1 + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\end{array}
\end{array}
if t < 3.7999999999999998e-11Initial program 97.2%
Taylor expanded in x around 0
Applied rewrites44.1%
if 3.7999999999999998e-11 < t Initial program 82.3%
Taylor expanded in x around 0
Applied rewrites39.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= y 3.1e+23)
(+ t_1 (- t_1 (sqrt y)))
(+ (sqrt (+ t 1.0)) (- (sqrt (+ z 1.0)) (sqrt z))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (y <= 3.1e+23) {
tmp = t_1 + (t_1 - sqrt(y));
} else {
tmp = sqrt((t + 1.0)) + (sqrt((z + 1.0)) - sqrt(z));
}
return tmp;
}
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))
if (y <= 3.1d+23) then
tmp = t_1 + (t_1 - sqrt(y))
else
tmp = sqrt((t + 1.0d0)) + (sqrt((z + 1.0d0)) - sqrt(z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (y <= 3.1e+23) {
tmp = t_1 + (t_1 - Math.sqrt(y));
} else {
tmp = Math.sqrt((t + 1.0)) + (Math.sqrt((z + 1.0)) - Math.sqrt(z));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if y <= 3.1e+23: tmp = t_1 + (t_1 - math.sqrt(y)) else: tmp = math.sqrt((t + 1.0)) + (math.sqrt((z + 1.0)) - math.sqrt(z)) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (y <= 3.1e+23) tmp = Float64(t_1 + Float64(t_1 - sqrt(y))); else tmp = Float64(sqrt(Float64(t + 1.0)) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((y + 1.0)); tmp = 0.0; if (y <= 3.1e+23) tmp = t_1 + (t_1 - sqrt(y)); else tmp = sqrt((t + 1.0)) + (sqrt((z + 1.0)) - sqrt(z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.1e+23], N[(t$95$1 + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;y \leq 3.1 \cdot 10^{+23}:\\
\;\;\;\;t\_1 + \left(t\_1 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t + 1} + \left(\sqrt{z + 1} - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 3.09999999999999971e23Initial program 94.4%
Taylor expanded in x around 0
Applied rewrites36.0%
Taylor expanded in x around 0
Applied rewrites39.9%
if 3.09999999999999971e23 < y Initial program 83.1%
Taylor expanded in x around 0
Applied rewrites44.1%
Taylor expanded in x around 0
Applied rewrites34.0%
(FPCore (x y z t) :precision binary64 (if (<= y 3.1e+23) (+ (+ y 1.0) (- (sqrt (+ y 1.0)) (sqrt y))) (+ (sqrt (+ t 1.0)) (- (sqrt (+ z 1.0)) (sqrt z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.1e+23) {
tmp = (y + 1.0) + (sqrt((y + 1.0)) - sqrt(y));
} else {
tmp = sqrt((t + 1.0)) + (sqrt((z + 1.0)) - sqrt(z));
}
return tmp;
}
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 <= 3.1d+23) then
tmp = (y + 1.0d0) + (sqrt((y + 1.0d0)) - sqrt(y))
else
tmp = sqrt((t + 1.0d0)) + (sqrt((z + 1.0d0)) - sqrt(z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.1e+23) {
tmp = (y + 1.0) + (Math.sqrt((y + 1.0)) - Math.sqrt(y));
} else {
tmp = Math.sqrt((t + 1.0)) + (Math.sqrt((z + 1.0)) - Math.sqrt(z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.1e+23: tmp = (y + 1.0) + (math.sqrt((y + 1.0)) - math.sqrt(y)) else: tmp = math.sqrt((t + 1.0)) + (math.sqrt((z + 1.0)) - math.sqrt(z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.1e+23) tmp = Float64(Float64(y + 1.0) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))); else tmp = Float64(sqrt(Float64(t + 1.0)) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.1e+23) tmp = (y + 1.0) + (sqrt((y + 1.0)) - sqrt(y)); else tmp = sqrt((t + 1.0)) + (sqrt((z + 1.0)) - sqrt(z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.1e+23], N[(N[(y + 1.0), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{+23}:\\
\;\;\;\;\left(y + 1\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t + 1} + \left(\sqrt{z + 1} - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 3.09999999999999971e23Initial program 94.4%
Taylor expanded in x around 0
Applied rewrites36.0%
Taylor expanded in x around 0
Applied rewrites49.2%
Taylor expanded in x around 0
Applied rewrites39.8%
if 3.09999999999999971e23 < y Initial program 83.1%
Taylor expanded in x around 0
Applied rewrites44.1%
Taylor expanded in x around 0
Applied rewrites34.0%
(FPCore (x y z t) :precision binary64 (if (<= y 3.1e+23) (+ (+ y 1.0) (- (sqrt (+ y 1.0)) (sqrt y))) (sqrt (+ t 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.1e+23) {
tmp = (y + 1.0) + (sqrt((y + 1.0)) - sqrt(y));
} else {
tmp = sqrt((t + 1.0));
}
return tmp;
}
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 <= 3.1d+23) then
tmp = (y + 1.0d0) + (sqrt((y + 1.0d0)) - sqrt(y))
else
tmp = sqrt((t + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.1e+23) {
tmp = (y + 1.0) + (Math.sqrt((y + 1.0)) - Math.sqrt(y));
} else {
tmp = Math.sqrt((t + 1.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.1e+23: tmp = (y + 1.0) + (math.sqrt((y + 1.0)) - math.sqrt(y)) else: tmp = math.sqrt((t + 1.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.1e+23) tmp = Float64(Float64(y + 1.0) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))); else tmp = sqrt(Float64(t + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.1e+23) tmp = (y + 1.0) + (sqrt((y + 1.0)) - sqrt(y)); else tmp = sqrt((t + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.1e+23], N[(N[(y + 1.0), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{+23}:\\
\;\;\;\;\left(y + 1\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t + 1}\\
\end{array}
\end{array}
if y < 3.09999999999999971e23Initial program 94.4%
Taylor expanded in x around 0
Applied rewrites36.0%
Taylor expanded in x around 0
Applied rewrites49.2%
Taylor expanded in x around 0
Applied rewrites39.8%
if 3.09999999999999971e23 < y Initial program 83.1%
Taylor expanded in x around 0
Applied rewrites19.4%
Taylor expanded in x around 0
Applied rewrites22.0%
(FPCore (x y z t) :precision binary64 (if (<= y 3.1e+23) (+ (+ y 1.0) (- (sqrt (+ z 1.0)) (sqrt z))) (sqrt (+ t 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.1e+23) {
tmp = (y + 1.0) + (sqrt((z + 1.0)) - sqrt(z));
} else {
tmp = sqrt((t + 1.0));
}
return tmp;
}
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 <= 3.1d+23) then
tmp = (y + 1.0d0) + (sqrt((z + 1.0d0)) - sqrt(z))
else
tmp = sqrt((t + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.1e+23) {
tmp = (y + 1.0) + (Math.sqrt((z + 1.0)) - Math.sqrt(z));
} else {
tmp = Math.sqrt((t + 1.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.1e+23: tmp = (y + 1.0) + (math.sqrt((z + 1.0)) - math.sqrt(z)) else: tmp = math.sqrt((t + 1.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.1e+23) tmp = Float64(Float64(y + 1.0) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))); else tmp = sqrt(Float64(t + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.1e+23) tmp = (y + 1.0) + (sqrt((z + 1.0)) - sqrt(z)); else tmp = sqrt((t + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.1e+23], N[(N[(y + 1.0), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{+23}:\\
\;\;\;\;\left(y + 1\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t + 1}\\
\end{array}
\end{array}
if y < 3.09999999999999971e23Initial program 94.4%
Taylor expanded in x around 0
Applied rewrites57.0%
Taylor expanded in x around 0
Applied rewrites61.3%
Taylor expanded in x around 0
Applied rewrites29.9%
if 3.09999999999999971e23 < y Initial program 83.1%
Taylor expanded in x around 0
Applied rewrites19.4%
Taylor expanded in x around 0
Applied rewrites22.0%
(FPCore (x y z t) :precision binary64 (if (<= x 180000.0) (- (sqrt (+ x 1.0)) (sqrt x)) (sqrt (+ t 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 180000.0) {
tmp = sqrt((x + 1.0)) - sqrt(x);
} else {
tmp = sqrt((t + 1.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 180000.0d0) then
tmp = sqrt((x + 1.0d0)) - sqrt(x)
else
tmp = sqrt((t + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 180000.0) {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
} else {
tmp = Math.sqrt((t + 1.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 180000.0: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) else: tmp = math.sqrt((t + 1.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 180000.0) tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); else tmp = sqrt(Float64(t + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 180000.0) tmp = sqrt((x + 1.0)) - sqrt(x); else tmp = sqrt((t + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 180000.0], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 180000:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t + 1}\\
\end{array}
\end{array}
if x < 1.8e5Initial program 96.6%
Taylor expanded in x around 0
Applied rewrites26.6%
if 1.8e5 < x Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites16.3%
Taylor expanded in x around 0
Applied rewrites23.0%
(FPCore (x y z t) :precision binary64 (if (<= t 3.8e-11) (- (sqrt (+ t 1.0)) (sqrt t)) (sqrt (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.8e-11) {
tmp = sqrt((t + 1.0)) - sqrt(t);
} else {
tmp = sqrt((x + 1.0));
}
return tmp;
}
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 (t <= 3.8d-11) then
tmp = sqrt((t + 1.0d0)) - sqrt(t)
else
tmp = sqrt((x + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.8e-11) {
tmp = Math.sqrt((t + 1.0)) - Math.sqrt(t);
} else {
tmp = Math.sqrt((x + 1.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3.8e-11: tmp = math.sqrt((t + 1.0)) - math.sqrt(t) else: tmp = math.sqrt((x + 1.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3.8e-11) tmp = Float64(sqrt(Float64(t + 1.0)) - sqrt(t)); else tmp = sqrt(Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.8e-11) tmp = sqrt((t + 1.0)) - sqrt(t); else tmp = sqrt((x + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.8e-11], N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.8 \cdot 10^{-11}:\\
\;\;\;\;\sqrt{t + 1} - \sqrt{t}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1}\\
\end{array}
\end{array}
if t < 3.7999999999999998e-11Initial program 97.2%
Taylor expanded in x around 0
Applied rewrites14.3%
Taylor expanded in x around 0
Applied rewrites28.5%
if 3.7999999999999998e-11 < t Initial program 82.3%
Taylor expanded in x around 0
Applied rewrites79.2%
Taylor expanded in x around 0
Applied rewrites21.8%
(FPCore (x y z t) :precision binary64 (if (<= t 5000.0) (sqrt (+ t 1.0)) (sqrt (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5000.0) {
tmp = sqrt((t + 1.0));
} else {
tmp = sqrt((x + 1.0));
}
return tmp;
}
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 (t <= 5000.0d0) then
tmp = sqrt((t + 1.0d0))
else
tmp = sqrt((x + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5000.0) {
tmp = Math.sqrt((t + 1.0));
} else {
tmp = Math.sqrt((x + 1.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 5000.0: tmp = math.sqrt((t + 1.0)) else: tmp = math.sqrt((x + 1.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 5000.0) tmp = sqrt(Float64(t + 1.0)); else tmp = sqrt(Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 5000.0) tmp = sqrt((t + 1.0)); else tmp = sqrt((x + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 5000.0], N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5000:\\
\;\;\;\;\sqrt{t + 1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1}\\
\end{array}
\end{array}
if t < 5e3Initial program 96.9%
Taylor expanded in x around 0
Applied rewrites14.5%
Taylor expanded in x around 0
Applied rewrites28.2%
if 5e3 < t Initial program 82.1%
Taylor expanded in x around 0
Applied rewrites80.5%
Taylor expanded in x around 0
Applied rewrites21.9%
(FPCore (x y z t) :precision binary64 (sqrt (+ x 1.0)))
double code(double x, double y, double z, double t) {
return sqrt((x + 1.0));
}
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))
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((x + 1.0));
}
def code(x, y, z, t): return math.sqrt((x + 1.0))
function code(x, y, z, t) return sqrt(Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = sqrt((x + 1.0)); end
code[x_, y_, z_, t_] := N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x + 1}
\end{array}
Initial program 89.1%
Taylor expanded in x around 0
Applied rewrites51.0%
Taylor expanded in x around 0
Applied rewrites17.6%
(FPCore (x y z t) :precision binary64 (+ x 1.0))
double code(double x, double y, double z, double t) {
return x + 1.0;
}
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 = x + 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return x + 1.0;
}
def code(x, y, z, t): return x + 1.0
function code(x, y, z, t) return Float64(x + 1.0) end
function tmp = code(x, y, z, t) tmp = x + 1.0; end
code[x_, y_, z_, t_] := N[(x + 1.0), $MachinePrecision]
\begin{array}{l}
\\
x + 1
\end{array}
Initial program 89.1%
Taylor expanded in x around 0
Applied rewrites51.0%
Taylor expanded in x around 0
Applied rewrites16.9%
(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 2024321
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:pre (TRUE)
:alt
(! :herbie-platform default (+ (+ (+ (/ 1 (+ (sqrt (+ x 1)) (sqrt x))) (/ 1 (+ (sqrt (+ y 1)) (sqrt y)))) (/ 1 (+ (sqrt (+ z 1)) (sqrt z)))) (- (sqrt (+ t 1)) (sqrt t))))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))