
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
(FPCore (x y) :precision binary64 (/ (* (/ y (+ y (+ 1.0 x))) (/ x (+ y x))) (+ y x)))
double code(double x, double y) {
return ((y / (y + (1.0 + x))) * (x / (y + x))) / (y + x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (y + (1.0d0 + x))) * (x / (y + x))) / (y + x)
end function
public static double code(double x, double y) {
return ((y / (y + (1.0 + x))) * (x / (y + x))) / (y + x);
}
def code(x, y): return ((y / (y + (1.0 + x))) * (x / (y + x))) / (y + x)
function code(x, y) return Float64(Float64(Float64(y / Float64(y + Float64(1.0 + x))) * Float64(x / Float64(y + x))) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((y / (y + (1.0 + x))) * (x / (y + x))) / (y + x); end
code[x_, y_] := N[(N[(N[(y / N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{y + \left(1 + x\right)} \cdot \frac{x}{y + x}}{y + x}
\end{array}
Initial program 64.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))) (t_1 (+ y (+ 1.0 x))))
(if (<= x -1.4e+154)
(/ (* (/ y t_1) 1.0) (+ y x))
(if (<= x 2e-60)
(* t_0 (/ y (* t_1 (+ y x))))
(/ t_0 (fma x (+ 2.0 (/ 1.0 y)) (+ y 1.0)))))))
double code(double x, double y) {
double t_0 = x / (y + x);
double t_1 = y + (1.0 + x);
double tmp;
if (x <= -1.4e+154) {
tmp = ((y / t_1) * 1.0) / (y + x);
} else if (x <= 2e-60) {
tmp = t_0 * (y / (t_1 * (y + x)));
} else {
tmp = t_0 / fma(x, (2.0 + (1.0 / y)), (y + 1.0));
}
return tmp;
}
function code(x, y) t_0 = Float64(x / Float64(y + x)) t_1 = Float64(y + Float64(1.0 + x)) tmp = 0.0 if (x <= -1.4e+154) tmp = Float64(Float64(Float64(y / t_1) * 1.0) / Float64(y + x)); elseif (x <= 2e-60) tmp = Float64(t_0 * Float64(y / Float64(t_1 * Float64(y + x)))); else tmp = Float64(t_0 / fma(x, Float64(2.0 + Float64(1.0 / y)), Float64(y + 1.0))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.4e+154], N[(N[(N[(y / t$95$1), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2e-60], N[(t$95$0 * N[(y / N[(t$95$1 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(x * N[(2.0 + N[(1.0 / y), $MachinePrecision]), $MachinePrecision] + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
t_1 := y + \left(1 + x\right)\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{y}{t\_1} \cdot 1}{y + x}\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-60}:\\
\;\;\;\;t\_0 \cdot \frac{y}{t\_1 \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\mathsf{fma}\left(x, 2 + \frac{1}{y}, y + 1\right)}\\
\end{array}
\end{array}
if x < -1.4e154Initial program 37.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
Applied rewrites76.5%
if -1.4e154 < x < 1.9999999999999999e-60Initial program 71.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6496.1
Applied rewrites96.1%
if 1.9999999999999999e-60 < x Initial program 61.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6498.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.4
Applied rewrites98.4%
Taylor expanded in x around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6459.3
Applied rewrites59.3%
Final simplification82.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ 1.0 x))) (t_1 (/ y t_0)))
(if (<= x -1.4e+154)
(/ (* t_1 1.0) (+ y x))
(if (<= x 1.85e-50)
(* (/ x (+ y x)) (/ y (* t_0 (+ y x))))
(/ (* t_1 (/ x y)) (+ y x))))))
double code(double x, double y) {
double t_0 = y + (1.0 + x);
double t_1 = y / t_0;
double tmp;
if (x <= -1.4e+154) {
tmp = (t_1 * 1.0) / (y + x);
} else if (x <= 1.85e-50) {
tmp = (x / (y + x)) * (y / (t_0 * (y + x)));
} else {
tmp = (t_1 * (x / y)) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y + (1.0d0 + x)
t_1 = y / t_0
if (x <= (-1.4d+154)) then
tmp = (t_1 * 1.0d0) / (y + x)
else if (x <= 1.85d-50) then
tmp = (x / (y + x)) * (y / (t_0 * (y + x)))
else
tmp = (t_1 * (x / y)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y + (1.0 + x);
double t_1 = y / t_0;
double tmp;
if (x <= -1.4e+154) {
tmp = (t_1 * 1.0) / (y + x);
} else if (x <= 1.85e-50) {
tmp = (x / (y + x)) * (y / (t_0 * (y + x)));
} else {
tmp = (t_1 * (x / y)) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = y + (1.0 + x) t_1 = y / t_0 tmp = 0 if x <= -1.4e+154: tmp = (t_1 * 1.0) / (y + x) elif x <= 1.85e-50: tmp = (x / (y + x)) * (y / (t_0 * (y + x))) else: tmp = (t_1 * (x / y)) / (y + x) return tmp
function code(x, y) t_0 = Float64(y + Float64(1.0 + x)) t_1 = Float64(y / t_0) tmp = 0.0 if (x <= -1.4e+154) tmp = Float64(Float64(t_1 * 1.0) / Float64(y + x)); elseif (x <= 1.85e-50) tmp = Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(t_0 * Float64(y + x)))); else tmp = Float64(Float64(t_1 * Float64(x / y)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = y + (1.0 + x); t_1 = y / t_0; tmp = 0.0; if (x <= -1.4e+154) tmp = (t_1 * 1.0) / (y + x); elseif (x <= 1.85e-50) tmp = (x / (y + x)) * (y / (t_0 * (y + x))); else tmp = (t_1 * (x / y)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y / t$95$0), $MachinePrecision]}, If[LessEqual[x, -1.4e+154], N[(N[(t$95$1 * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e-50], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(t$95$0 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * N[(x / y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(1 + x\right)\\
t_1 := \frac{y}{t\_0}\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{t\_1 \cdot 1}{y + x}\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-50}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{y}{t\_0 \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 \cdot \frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if x < -1.4e154Initial program 37.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
Applied rewrites76.5%
if -1.4e154 < x < 1.85e-50Initial program 71.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6496.1
Applied rewrites96.1%
if 1.85e-50 < x Initial program 61.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f6431.5
Applied rewrites31.5%
Final simplification73.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))) (t_1 (+ y (+ 1.0 x))))
(if (<= x -1.4e+154)
(/ (* (/ y t_1) 1.0) (+ y x))
(if (<= x 1.85e-50)
(* t_0 (/ y (* t_1 (+ y x))))
(/ (* t_0 1.0) (+ y x))))))
double code(double x, double y) {
double t_0 = x / (y + x);
double t_1 = y + (1.0 + x);
double tmp;
if (x <= -1.4e+154) {
tmp = ((y / t_1) * 1.0) / (y + x);
} else if (x <= 1.85e-50) {
tmp = t_0 * (y / (t_1 * (y + x)));
} else {
tmp = (t_0 * 1.0) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / (y + x)
t_1 = y + (1.0d0 + x)
if (x <= (-1.4d+154)) then
tmp = ((y / t_1) * 1.0d0) / (y + x)
else if (x <= 1.85d-50) then
tmp = t_0 * (y / (t_1 * (y + x)))
else
tmp = (t_0 * 1.0d0) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y + x);
double t_1 = y + (1.0 + x);
double tmp;
if (x <= -1.4e+154) {
tmp = ((y / t_1) * 1.0) / (y + x);
} else if (x <= 1.85e-50) {
tmp = t_0 * (y / (t_1 * (y + x)));
} else {
tmp = (t_0 * 1.0) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = x / (y + x) t_1 = y + (1.0 + x) tmp = 0 if x <= -1.4e+154: tmp = ((y / t_1) * 1.0) / (y + x) elif x <= 1.85e-50: tmp = t_0 * (y / (t_1 * (y + x))) else: tmp = (t_0 * 1.0) / (y + x) return tmp
function code(x, y) t_0 = Float64(x / Float64(y + x)) t_1 = Float64(y + Float64(1.0 + x)) tmp = 0.0 if (x <= -1.4e+154) tmp = Float64(Float64(Float64(y / t_1) * 1.0) / Float64(y + x)); elseif (x <= 1.85e-50) tmp = Float64(t_0 * Float64(y / Float64(t_1 * Float64(y + x)))); else tmp = Float64(Float64(t_0 * 1.0) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y + x); t_1 = y + (1.0 + x); tmp = 0.0; if (x <= -1.4e+154) tmp = ((y / t_1) * 1.0) / (y + x); elseif (x <= 1.85e-50) tmp = t_0 * (y / (t_1 * (y + x))); else tmp = (t_0 * 1.0) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.4e+154], N[(N[(N[(y / t$95$1), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e-50], N[(t$95$0 * N[(y / N[(t$95$1 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
t_1 := y + \left(1 + x\right)\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{y}{t\_1} \cdot 1}{y + x}\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-50}:\\
\;\;\;\;t\_0 \cdot \frac{y}{t\_1 \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 \cdot 1}{y + x}\\
\end{array}
\end{array}
if x < -1.4e154Initial program 37.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
Applied rewrites76.5%
if -1.4e154 < x < 1.85e-50Initial program 71.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6496.1
Applied rewrites96.1%
if 1.85e-50 < x Initial program 61.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
Applied rewrites32.7%
Final simplification73.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ 1.0 x))))
(if (<= y 1.5e-172)
(/ (* (/ y t_0) 1.0) (+ y x))
(if (<= y 1.2e+93)
(* x (* y (/ 1.0 (* t_0 (* (+ y x) (+ y x))))))
(/ (* (/ x (+ y x)) 1.0) (+ y x))))))
double code(double x, double y) {
double t_0 = y + (1.0 + x);
double tmp;
if (y <= 1.5e-172) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (y <= 1.2e+93) {
tmp = x * (y * (1.0 / (t_0 * ((y + x) * (y + x)))));
} else {
tmp = ((x / (y + x)) * 1.0) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y + (1.0d0 + x)
if (y <= 1.5d-172) then
tmp = ((y / t_0) * 1.0d0) / (y + x)
else if (y <= 1.2d+93) then
tmp = x * (y * (1.0d0 / (t_0 * ((y + x) * (y + x)))))
else
tmp = ((x / (y + x)) * 1.0d0) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y + (1.0 + x);
double tmp;
if (y <= 1.5e-172) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (y <= 1.2e+93) {
tmp = x * (y * (1.0 / (t_0 * ((y + x) * (y + x)))));
} else {
tmp = ((x / (y + x)) * 1.0) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = y + (1.0 + x) tmp = 0 if y <= 1.5e-172: tmp = ((y / t_0) * 1.0) / (y + x) elif y <= 1.2e+93: tmp = x * (y * (1.0 / (t_0 * ((y + x) * (y + x))))) else: tmp = ((x / (y + x)) * 1.0) / (y + x) return tmp
function code(x, y) t_0 = Float64(y + Float64(1.0 + x)) tmp = 0.0 if (y <= 1.5e-172) tmp = Float64(Float64(Float64(y / t_0) * 1.0) / Float64(y + x)); elseif (y <= 1.2e+93) tmp = Float64(x * Float64(y * Float64(1.0 / Float64(t_0 * Float64(Float64(y + x) * Float64(y + x)))))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * 1.0) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = y + (1.0 + x); tmp = 0.0; if (y <= 1.5e-172) tmp = ((y / t_0) * 1.0) / (y + x); elseif (y <= 1.2e+93) tmp = x * (y * (1.0 / (t_0 * ((y + x) * (y + x))))); else tmp = ((x / (y + x)) * 1.0) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.5e-172], N[(N[(N[(y / t$95$0), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+93], N[(x * N[(y * N[(1.0 / N[(t$95$0 * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(1 + x\right)\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{-172}:\\
\;\;\;\;\frac{\frac{y}{t\_0} \cdot 1}{y + x}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+93}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{1}{t\_0 \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot 1}{y + x}\\
\end{array}
\end{array}
if y < 1.49999999999999992e-172Initial program 63.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
Applied rewrites54.8%
if 1.49999999999999992e-172 < y < 1.20000000000000005e93Initial program 80.2%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6488.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f6488.9
Applied rewrites88.9%
if 1.20000000000000005e93 < y Initial program 46.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
Applied rewrites79.3%
Final simplification67.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ 1.0 x))))
(if (<= y 1.5e-172)
(/ (* (/ y t_0) 1.0) (+ y x))
(if (<= y 1.2e+93)
(* x (/ y (* t_0 (* (+ y x) (+ y x)))))
(/ (* (/ x (+ y x)) 1.0) (+ y x))))))
double code(double x, double y) {
double t_0 = y + (1.0 + x);
double tmp;
if (y <= 1.5e-172) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (y <= 1.2e+93) {
tmp = x * (y / (t_0 * ((y + x) * (y + x))));
} else {
tmp = ((x / (y + x)) * 1.0) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y + (1.0d0 + x)
if (y <= 1.5d-172) then
tmp = ((y / t_0) * 1.0d0) / (y + x)
else if (y <= 1.2d+93) then
tmp = x * (y / (t_0 * ((y + x) * (y + x))))
else
tmp = ((x / (y + x)) * 1.0d0) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y + (1.0 + x);
double tmp;
if (y <= 1.5e-172) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (y <= 1.2e+93) {
tmp = x * (y / (t_0 * ((y + x) * (y + x))));
} else {
tmp = ((x / (y + x)) * 1.0) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = y + (1.0 + x) tmp = 0 if y <= 1.5e-172: tmp = ((y / t_0) * 1.0) / (y + x) elif y <= 1.2e+93: tmp = x * (y / (t_0 * ((y + x) * (y + x)))) else: tmp = ((x / (y + x)) * 1.0) / (y + x) return tmp
function code(x, y) t_0 = Float64(y + Float64(1.0 + x)) tmp = 0.0 if (y <= 1.5e-172) tmp = Float64(Float64(Float64(y / t_0) * 1.0) / Float64(y + x)); elseif (y <= 1.2e+93) tmp = Float64(x * Float64(y / Float64(t_0 * Float64(Float64(y + x) * Float64(y + x))))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * 1.0) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = y + (1.0 + x); tmp = 0.0; if (y <= 1.5e-172) tmp = ((y / t_0) * 1.0) / (y + x); elseif (y <= 1.2e+93) tmp = x * (y / (t_0 * ((y + x) * (y + x)))); else tmp = ((x / (y + x)) * 1.0) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.5e-172], N[(N[(N[(y / t$95$0), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+93], N[(x * N[(y / N[(t$95$0 * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(1 + x\right)\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{-172}:\\
\;\;\;\;\frac{\frac{y}{t\_0} \cdot 1}{y + x}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+93}:\\
\;\;\;\;x \cdot \frac{y}{t\_0 \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot 1}{y + x}\\
\end{array}
\end{array}
if y < 1.49999999999999992e-172Initial program 63.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
Applied rewrites54.8%
if 1.49999999999999992e-172 < y < 1.20000000000000005e93Initial program 80.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6488.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f6488.9
Applied rewrites88.9%
if 1.20000000000000005e93 < y Initial program 46.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
Applied rewrites79.3%
Final simplification67.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ 1.0 x))))
(if (<= y 1.5e-172)
(/ (* (/ y t_0) 1.0) (+ y x))
(if (<= y 1.2e+93)
(* y (/ x (* t_0 (* (+ y x) (+ y x)))))
(/ (* (/ x (+ y x)) 1.0) (+ y x))))))
double code(double x, double y) {
double t_0 = y + (1.0 + x);
double tmp;
if (y <= 1.5e-172) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (y <= 1.2e+93) {
tmp = y * (x / (t_0 * ((y + x) * (y + x))));
} else {
tmp = ((x / (y + x)) * 1.0) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y + (1.0d0 + x)
if (y <= 1.5d-172) then
tmp = ((y / t_0) * 1.0d0) / (y + x)
else if (y <= 1.2d+93) then
tmp = y * (x / (t_0 * ((y + x) * (y + x))))
else
tmp = ((x / (y + x)) * 1.0d0) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y + (1.0 + x);
double tmp;
if (y <= 1.5e-172) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (y <= 1.2e+93) {
tmp = y * (x / (t_0 * ((y + x) * (y + x))));
} else {
tmp = ((x / (y + x)) * 1.0) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = y + (1.0 + x) tmp = 0 if y <= 1.5e-172: tmp = ((y / t_0) * 1.0) / (y + x) elif y <= 1.2e+93: tmp = y * (x / (t_0 * ((y + x) * (y + x)))) else: tmp = ((x / (y + x)) * 1.0) / (y + x) return tmp
function code(x, y) t_0 = Float64(y + Float64(1.0 + x)) tmp = 0.0 if (y <= 1.5e-172) tmp = Float64(Float64(Float64(y / t_0) * 1.0) / Float64(y + x)); elseif (y <= 1.2e+93) tmp = Float64(y * Float64(x / Float64(t_0 * Float64(Float64(y + x) * Float64(y + x))))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * 1.0) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = y + (1.0 + x); tmp = 0.0; if (y <= 1.5e-172) tmp = ((y / t_0) * 1.0) / (y + x); elseif (y <= 1.2e+93) tmp = y * (x / (t_0 * ((y + x) * (y + x)))); else tmp = ((x / (y + x)) * 1.0) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.5e-172], N[(N[(N[(y / t$95$0), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+93], N[(y * N[(x / N[(t$95$0 * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(1 + x\right)\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{-172}:\\
\;\;\;\;\frac{\frac{y}{t\_0} \cdot 1}{y + x}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+93}:\\
\;\;\;\;y \cdot \frac{x}{t\_0 \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot 1}{y + x}\\
\end{array}
\end{array}
if y < 1.49999999999999992e-172Initial program 63.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
Applied rewrites54.8%
if 1.49999999999999992e-172 < y < 1.20000000000000005e93Initial program 80.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6491.6
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f6491.6
Applied rewrites91.6%
if 1.20000000000000005e93 < y Initial program 46.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
Applied rewrites79.3%
Final simplification67.9%
(FPCore (x y) :precision binary64 (* (/ x (+ y x)) (/ (/ y (+ y (+ 1.0 x))) (+ y x))))
double code(double x, double y) {
return (x / (y + x)) * ((y / (y + (1.0 + x))) / (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (y + x)) * ((y / (y + (1.0d0 + x))) / (y + x))
end function
public static double code(double x, double y) {
return (x / (y + x)) * ((y / (y + (1.0 + x))) / (y + x));
}
def code(x, y): return (x / (y + x)) * ((y / (y + (1.0 + x))) / (y + x))
function code(x, y) return Float64(Float64(x / Float64(y + x)) * Float64(Float64(y / Float64(y + Float64(1.0 + x))) / Float64(y + x))) end
function tmp = code(x, y) tmp = (x / (y + x)) * ((y / (y + (1.0 + x))) / (y + x)); end
code[x_, y_] := N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{y + x}
\end{array}
Initial program 64.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6499.8
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f6499.8
Applied rewrites99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(if (<= y 6e-138)
(/ (* (/ y (+ y (+ 1.0 x))) 1.0) (+ y x))
(if (<= y 1.2e+93)
(* x (/ y (* (* (+ y x) (+ y x)) (+ y 1.0))))
(/ (* (/ x (+ y x)) 1.0) (+ y x)))))
double code(double x, double y) {
double tmp;
if (y <= 6e-138) {
tmp = ((y / (y + (1.0 + x))) * 1.0) / (y + x);
} else if (y <= 1.2e+93) {
tmp = x * (y / (((y + x) * (y + x)) * (y + 1.0)));
} else {
tmp = ((x / (y + x)) * 1.0) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6d-138) then
tmp = ((y / (y + (1.0d0 + x))) * 1.0d0) / (y + x)
else if (y <= 1.2d+93) then
tmp = x * (y / (((y + x) * (y + x)) * (y + 1.0d0)))
else
tmp = ((x / (y + x)) * 1.0d0) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 6e-138) {
tmp = ((y / (y + (1.0 + x))) * 1.0) / (y + x);
} else if (y <= 1.2e+93) {
tmp = x * (y / (((y + x) * (y + x)) * (y + 1.0)));
} else {
tmp = ((x / (y + x)) * 1.0) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6e-138: tmp = ((y / (y + (1.0 + x))) * 1.0) / (y + x) elif y <= 1.2e+93: tmp = x * (y / (((y + x) * (y + x)) * (y + 1.0))) else: tmp = ((x / (y + x)) * 1.0) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 6e-138) tmp = Float64(Float64(Float64(y / Float64(y + Float64(1.0 + x))) * 1.0) / Float64(y + x)); elseif (y <= 1.2e+93) tmp = Float64(x * Float64(y / Float64(Float64(Float64(y + x) * Float64(y + x)) * Float64(y + 1.0)))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * 1.0) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 6e-138) tmp = ((y / (y + (1.0 + x))) * 1.0) / (y + x); elseif (y <= 1.2e+93) tmp = x * (y / (((y + x) * (y + x)) * (y + 1.0))); else tmp = ((x / (y + x)) * 1.0) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6e-138], N[(N[(N[(y / N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+93], N[(x * N[(y / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{-138}:\\
\;\;\;\;\frac{\frac{y}{y + \left(1 + x\right)} \cdot 1}{y + x}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+93}:\\
\;\;\;\;x \cdot \frac{y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot 1}{y + x}\\
\end{array}
\end{array}
if y < 6.0000000000000001e-138Initial program 65.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
Applied rewrites56.2%
if 6.0000000000000001e-138 < y < 1.20000000000000005e93Initial program 77.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.1
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f6489.1
Applied rewrites89.1%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f6476.9
Applied rewrites76.9%
if 1.20000000000000005e93 < y Initial program 46.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
Applied rewrites79.3%
Final simplification64.5%
(FPCore (x y)
:precision binary64
(if (<= y 6e-138)
(/ (/ y (+ 1.0 x)) (+ y x))
(if (<= y 1.2e+93)
(* x (/ y (* (* (+ y x) (+ y x)) (+ y 1.0))))
(/ (* (/ x (+ y x)) 1.0) (+ y x)))))
double code(double x, double y) {
double tmp;
if (y <= 6e-138) {
tmp = (y / (1.0 + x)) / (y + x);
} else if (y <= 1.2e+93) {
tmp = x * (y / (((y + x) * (y + x)) * (y + 1.0)));
} else {
tmp = ((x / (y + x)) * 1.0) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6d-138) then
tmp = (y / (1.0d0 + x)) / (y + x)
else if (y <= 1.2d+93) then
tmp = x * (y / (((y + x) * (y + x)) * (y + 1.0d0)))
else
tmp = ((x / (y + x)) * 1.0d0) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 6e-138) {
tmp = (y / (1.0 + x)) / (y + x);
} else if (y <= 1.2e+93) {
tmp = x * (y / (((y + x) * (y + x)) * (y + 1.0)));
} else {
tmp = ((x / (y + x)) * 1.0) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6e-138: tmp = (y / (1.0 + x)) / (y + x) elif y <= 1.2e+93: tmp = x * (y / (((y + x) * (y + x)) * (y + 1.0))) else: tmp = ((x / (y + x)) * 1.0) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 6e-138) tmp = Float64(Float64(y / Float64(1.0 + x)) / Float64(y + x)); elseif (y <= 1.2e+93) tmp = Float64(x * Float64(y / Float64(Float64(Float64(y + x) * Float64(y + x)) * Float64(y + 1.0)))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * 1.0) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 6e-138) tmp = (y / (1.0 + x)) / (y + x); elseif (y <= 1.2e+93) tmp = x * (y / (((y + x) * (y + x)) * (y + 1.0))); else tmp = ((x / (y + x)) * 1.0) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6e-138], N[(N[(y / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+93], N[(x * N[(y / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{-138}:\\
\;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+93}:\\
\;\;\;\;x \cdot \frac{y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot 1}{y + x}\\
\end{array}
\end{array}
if y < 6.0000000000000001e-138Initial program 65.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f6455.3
Applied rewrites55.3%
if 6.0000000000000001e-138 < y < 1.20000000000000005e93Initial program 77.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6489.1
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f6489.1
Applied rewrites89.1%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f6476.9
Applied rewrites76.9%
if 1.20000000000000005e93 < y Initial program 46.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
Applied rewrites79.3%
Final simplification63.9%
(FPCore (x y)
:precision binary64
(if (<= y -1.75e+19)
(/ (/ y x) (+ y x))
(if (<= y 6e-92)
(/ y (fma x x x))
(if (<= y 1.16e+20) (/ x (fma y y y)) (/ (/ x y) (+ y x))))))
double code(double x, double y) {
double tmp;
if (y <= -1.75e+19) {
tmp = (y / x) / (y + x);
} else if (y <= 6e-92) {
tmp = y / fma(x, x, x);
} else if (y <= 1.16e+20) {
tmp = x / fma(y, y, y);
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= -1.75e+19) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (y <= 6e-92) tmp = Float64(y / fma(x, x, x)); elseif (y <= 1.16e+20) tmp = Float64(x / fma(y, y, y)); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
code[x_, y_] := If[LessEqual[y, -1.75e+19], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-92], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.16e+20], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-92}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < -1.75e19Initial program 56.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6421.0
Applied rewrites21.0%
if -1.75e19 < y < 6.00000000000000027e-92Initial program 74.5%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6483.8
Applied rewrites83.8%
if 6.00000000000000027e-92 < y < 1.16e20Initial program 76.5%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6454.4
Applied rewrites54.4%
if 1.16e20 < y Initial program 50.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f6470.2
Applied rewrites70.2%
Final simplification60.4%
(FPCore (x y)
:precision binary64
(if (<= y -5.2e+20)
(/ (/ y x) x)
(if (<= y 6e-92)
(/ y (fma x x x))
(if (<= y 1.16e+20) (/ x (fma y y y)) (/ (/ x y) (+ y x))))))
double code(double x, double y) {
double tmp;
if (y <= -5.2e+20) {
tmp = (y / x) / x;
} else if (y <= 6e-92) {
tmp = y / fma(x, x, x);
} else if (y <= 1.16e+20) {
tmp = x / fma(y, y, y);
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= -5.2e+20) tmp = Float64(Float64(y / x) / x); elseif (y <= 6e-92) tmp = Float64(y / fma(x, x, x)); elseif (y <= 1.16e+20) tmp = Float64(x / fma(y, y, y)); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
code[x_, y_] := If[LessEqual[y, -5.2e+20], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 6e-92], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.16e+20], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+20}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-92}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < -5.2e20Initial program 56.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6421.1
Applied rewrites21.1%
Applied rewrites20.4%
if -5.2e20 < y < 6.00000000000000027e-92Initial program 74.5%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6483.8
Applied rewrites83.8%
if 6.00000000000000027e-92 < y < 1.16e20Initial program 76.5%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6454.4
Applied rewrites54.4%
if 1.16e20 < y Initial program 50.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f6470.2
Applied rewrites70.2%
Final simplification60.2%
(FPCore (x y)
:precision binary64
(if (<= y -5.2e+20)
(/ (/ y x) x)
(if (<= y 6e-92)
(/ y (fma x x x))
(if (<= y 1.65e+177) (/ x (fma y y y)) (/ (/ x y) y)))))
double code(double x, double y) {
double tmp;
if (y <= -5.2e+20) {
tmp = (y / x) / x;
} else if (y <= 6e-92) {
tmp = y / fma(x, x, x);
} else if (y <= 1.65e+177) {
tmp = x / fma(y, y, y);
} else {
tmp = (x / y) / y;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= -5.2e+20) tmp = Float64(Float64(y / x) / x); elseif (y <= 6e-92) tmp = Float64(y / fma(x, x, x)); elseif (y <= 1.65e+177) tmp = Float64(x / fma(y, y, y)); else tmp = Float64(Float64(x / y) / y); end return tmp end
code[x_, y_] := If[LessEqual[y, -5.2e+20], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 6e-92], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+177], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+20}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-92}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+177}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -5.2e20Initial program 56.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6421.1
Applied rewrites21.1%
Applied rewrites20.4%
if -5.2e20 < y < 6.00000000000000027e-92Initial program 74.5%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6483.8
Applied rewrites83.8%
if 6.00000000000000027e-92 < y < 1.6500000000000001e177Initial program 65.4%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6454.3
Applied rewrites54.3%
if 1.6500000000000001e177 < y Initial program 46.6%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6463.9
Applied rewrites63.9%
Applied rewrites80.0%
(FPCore (x y) :precision binary64 (if (<= y -1.75e+19) (/ (/ y x) (+ y x)) (if (<= y 6e-92) (/ y (fma x x x)) (/ (/ x (+ y 1.0)) (+ y x)))))
double code(double x, double y) {
double tmp;
if (y <= -1.75e+19) {
tmp = (y / x) / (y + x);
} else if (y <= 6e-92) {
tmp = y / fma(x, x, x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= -1.75e+19) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (y <= 6e-92) tmp = Float64(y / fma(x, x, x)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
code[x_, y_] := If[LessEqual[y, -1.75e+19], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-92], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-92}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < -1.75e19Initial program 56.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6421.0
Applied rewrites21.0%
if -1.75e19 < y < 6.00000000000000027e-92Initial program 74.5%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6483.8
Applied rewrites83.8%
if 6.00000000000000027e-92 < y Initial program 59.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f6464.7
Applied rewrites64.7%
Final simplification60.5%
(FPCore (x y) :precision binary64 (if (<= y 6e-92) (/ y (fma x x x)) (if (<= y 1.65e+177) (/ x (fma y y y)) (/ (/ x y) y))))
double code(double x, double y) {
double tmp;
if (y <= 6e-92) {
tmp = y / fma(x, x, x);
} else if (y <= 1.65e+177) {
tmp = x / fma(y, y, y);
} else {
tmp = (x / y) / y;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 6e-92) tmp = Float64(y / fma(x, x, x)); elseif (y <= 1.65e+177) tmp = Float64(x / fma(y, y, y)); else tmp = Float64(Float64(x / y) / y); end return tmp end
code[x_, y_] := If[LessEqual[y, 6e-92], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+177], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{-92}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+177}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 6.00000000000000027e-92Initial program 67.3%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6458.3
Applied rewrites58.3%
if 6.00000000000000027e-92 < y < 1.6500000000000001e177Initial program 65.4%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6454.3
Applied rewrites54.3%
if 1.6500000000000001e177 < y Initial program 46.6%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6463.9
Applied rewrites63.9%
Applied rewrites80.0%
(FPCore (x y) :precision binary64 (if (<= y 6e-92) (/ (/ y (+ 1.0 x)) (+ y x)) (/ (/ x (+ y x)) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (y <= 6e-92) {
tmp = (y / (1.0 + x)) / (y + x);
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6d-92) then
tmp = (y / (1.0d0 + x)) / (y + x)
else
tmp = (x / (y + x)) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 6e-92) {
tmp = (y / (1.0 + x)) / (y + x);
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6e-92: tmp = (y / (1.0 + x)) / (y + x) else: tmp = (x / (y + x)) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 6e-92) tmp = Float64(Float64(y / Float64(1.0 + x)) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 6e-92) tmp = (y / (1.0 + x)) / (y + x); else tmp = (x / (y + x)) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6e-92], N[(N[(y / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{-92}:\\
\;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if y < 6.00000000000000027e-92Initial program 67.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f6458.4
Applied rewrites58.4%
if 6.00000000000000027e-92 < y Initial program 59.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6498.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.8
Applied rewrites98.8%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f6464.7
Applied rewrites64.7%
Final simplification60.5%
(FPCore (x y) :precision binary64 (if (<= y 6e-92) (/ (/ y (+ 1.0 x)) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
double tmp;
if (y <= 6e-92) {
tmp = (y / (1.0 + x)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6d-92) then
tmp = (y / (1.0d0 + x)) / (y + x)
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 6e-92) {
tmp = (y / (1.0 + x)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6e-92: tmp = (y / (1.0 + x)) / (y + x) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 6e-92) tmp = Float64(Float64(y / Float64(1.0 + x)) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 6e-92) tmp = (y / (1.0 + x)) / (y + x); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6e-92], N[(N[(y / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{-92}:\\
\;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 6.00000000000000027e-92Initial program 67.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f6458.4
Applied rewrites58.4%
if 6.00000000000000027e-92 < y Initial program 59.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f6464.7
Applied rewrites64.7%
Final simplification60.5%
(FPCore (x y) :precision binary64 (if (<= y 1.25e-92) (/ y (* x x)) (if (<= y 1.0) (/ x y) (/ x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.25e-92) {
tmp = y / (x * x);
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.25d-92) then
tmp = y / (x * x)
else if (y <= 1.0d0) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.25e-92) {
tmp = y / (x * x);
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.25e-92: tmp = y / (x * x) elif y <= 1.0: tmp = x / y else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.25e-92) tmp = Float64(y / Float64(x * x)); elseif (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.25e-92) tmp = y / (x * x); elseif (y <= 1.0) tmp = x / y; else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.25e-92], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{-92}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 1.25000000000000003e-92Initial program 67.3%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6439.0
Applied rewrites39.0%
if 1.25000000000000003e-92 < y < 1Initial program 73.5%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6453.3
Applied rewrites53.3%
Taylor expanded in y around 0
Applied rewrites47.3%
if 1 < y Initial program 54.4%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6455.8
Applied rewrites55.8%
(FPCore (x y) :precision binary64 (if (<= y 6e-92) (/ y (fma x x x)) (/ x (fma y y y))))
double code(double x, double y) {
double tmp;
if (y <= 6e-92) {
tmp = y / fma(x, x, x);
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 6e-92) tmp = Float64(y / fma(x, x, x)); else tmp = Float64(x / fma(y, y, y)); end return tmp end
code[x_, y_] := If[LessEqual[y, 6e-92], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{-92}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if y < 6.00000000000000027e-92Initial program 67.3%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6458.3
Applied rewrites58.3%
if 6.00000000000000027e-92 < y Initial program 59.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6457.2
Applied rewrites57.2%
(FPCore (x y) :precision binary64 (if (<= x -7.4e+17) (/ y (* x x)) (/ x (fma y y y))))
double code(double x, double y) {
double tmp;
if (x <= -7.4e+17) {
tmp = y / (x * x);
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -7.4e+17) tmp = Float64(y / Float64(x * x)); else tmp = Float64(x / fma(y, y, y)); end return tmp end
code[x_, y_] := If[LessEqual[x, -7.4e+17], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.4 \cdot 10^{+17}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if x < -7.4e17Initial program 48.9%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6464.3
Applied rewrites64.3%
if -7.4e17 < x Initial program 69.2%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6455.0
Applied rewrites55.0%
(FPCore (x y) :precision binary64 (if (<= y 1.0) (/ x y) (/ x (* y y))))
double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.0d0) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.0: tmp = x / y else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.0) tmp = x / y; else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 1Initial program 68.0%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6442.1
Applied rewrites42.1%
Taylor expanded in y around 0
Applied rewrites26.5%
if 1 < y Initial program 54.4%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6455.8
Applied rewrites55.8%
(FPCore (x y) :precision binary64 (/ x y))
double code(double x, double y) {
return x / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / y
end function
public static double code(double x, double y) {
return x / y;
}
def code(x, y): return x / y
function code(x, y) return Float64(x / y) end
function tmp = code(x, y) tmp = x / y; end
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y}
\end{array}
Initial program 64.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6446.1
Applied rewrites46.1%
Taylor expanded in y around 0
Applied rewrites25.7%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2024228
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))