
(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 15 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 (+ 1.0 (+ y x))) (+ y x)) (/ x (+ y x))))
double code(double x, double y) {
return ((y / (1.0 + (y + x))) / (y + x)) * (x / (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (1.0d0 + (y + x))) / (y + x)) * (x / (y + x))
end function
public static double code(double x, double y) {
return ((y / (1.0 + (y + x))) / (y + x)) * (x / (y + x));
}
def code(x, y): return ((y / (1.0 + (y + x))) / (y + x)) * (x / (y + x))
function code(x, y) return Float64(Float64(Float64(y / Float64(1.0 + Float64(y + x))) / Float64(y + x)) * Float64(x / Float64(y + x))) end
function tmp = code(x, y) tmp = ((y / (1.0 + (y + x))) / (y + x)) * (x / (y + x)); end
code[x_, y_] := N[(N[(N[(y / N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{1 + \left(y + x\right)}}{y + x} \cdot \frac{x}{y + x}
\end{array}
Initial program 67.8%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ y x))))
(if (<= y -1.75e-94)
(* 1.0 (/ (/ y t_0) (+ y x)))
(if (<= y 6.6e+152)
(/ (* (/ x (+ y x)) y) (* t_0 (+ y x)))
(/ (/ x y) (+ y x))))))
double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (y <= -1.75e-94) {
tmp = 1.0 * ((y / t_0) / (y + x));
} else if (y <= 6.6e+152) {
tmp = ((x / (y + x)) * y) / (t_0 * (y + x));
} else {
tmp = (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) :: tmp
t_0 = 1.0d0 + (y + x)
if (y <= (-1.75d-94)) then
tmp = 1.0d0 * ((y / t_0) / (y + x))
else if (y <= 6.6d+152) then
tmp = ((x / (y + x)) * y) / (t_0 * (y + x))
else
tmp = (x / y) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (y <= -1.75e-94) {
tmp = 1.0 * ((y / t_0) / (y + x));
} else if (y <= 6.6e+152) {
tmp = ((x / (y + x)) * y) / (t_0 * (y + x));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y + x) tmp = 0 if y <= -1.75e-94: tmp = 1.0 * ((y / t_0) / (y + x)) elif y <= 6.6e+152: tmp = ((x / (y + x)) * y) / (t_0 * (y + x)) else: tmp = (x / y) / (y + x) return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y + x)) tmp = 0.0 if (y <= -1.75e-94) tmp = Float64(1.0 * Float64(Float64(y / t_0) / Float64(y + x))); elseif (y <= 6.6e+152) tmp = Float64(Float64(Float64(x / Float64(y + x)) * y) / Float64(t_0 * Float64(y + x))); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y + x); tmp = 0.0; if (y <= -1.75e-94) tmp = 1.0 * ((y / t_0) / (y + x)); elseif (y <= 6.6e+152) tmp = ((x / (y + x)) * y) / (t_0 * (y + x)); else tmp = (x / y) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.75e-94], N[(1.0 * N[(N[(y / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+152], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(t$95$0 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y + x\right)\\
\mathbf{if}\;y \leq -1.75 \cdot 10^{-94}:\\
\;\;\;\;1 \cdot \frac{\frac{y}{t\_0}}{y + x}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+152}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot y}{t\_0 \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < -1.74999999999999999e-94Initial program 67.4%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
Applied rewrites44.5%
if -1.74999999999999999e-94 < y < 6.6000000000000003e152Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6498.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.5
Applied rewrites98.5%
if 6.6000000000000003e152 < y Initial program 61.6%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f6490.1
Applied rewrites90.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ y x))))
(if (<= y -5.2e-63)
(* 1.0 (/ (/ y t_0) (+ y x)))
(if (<= y 6.6e+152)
(* (/ x (* t_0 (+ y x))) (/ y (+ y x)))
(/ (/ x y) (+ y x))))))
double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (y <= -5.2e-63) {
tmp = 1.0 * ((y / t_0) / (y + x));
} else if (y <= 6.6e+152) {
tmp = (x / (t_0 * (y + x))) * (y / (y + x));
} else {
tmp = (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) :: tmp
t_0 = 1.0d0 + (y + x)
if (y <= (-5.2d-63)) then
tmp = 1.0d0 * ((y / t_0) / (y + x))
else if (y <= 6.6d+152) then
tmp = (x / (t_0 * (y + x))) * (y / (y + x))
else
tmp = (x / y) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (y <= -5.2e-63) {
tmp = 1.0 * ((y / t_0) / (y + x));
} else if (y <= 6.6e+152) {
tmp = (x / (t_0 * (y + x))) * (y / (y + x));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y + x) tmp = 0 if y <= -5.2e-63: tmp = 1.0 * ((y / t_0) / (y + x)) elif y <= 6.6e+152: tmp = (x / (t_0 * (y + x))) * (y / (y + x)) else: tmp = (x / y) / (y + x) return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y + x)) tmp = 0.0 if (y <= -5.2e-63) tmp = Float64(1.0 * Float64(Float64(y / t_0) / Float64(y + x))); elseif (y <= 6.6e+152) tmp = Float64(Float64(x / Float64(t_0 * Float64(y + x))) * Float64(y / Float64(y + x))); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y + x); tmp = 0.0; if (y <= -5.2e-63) tmp = 1.0 * ((y / t_0) / (y + x)); elseif (y <= 6.6e+152) tmp = (x / (t_0 * (y + x))) * (y / (y + x)); else tmp = (x / y) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e-63], N[(1.0 * N[(N[(y / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+152], N[(N[(x / N[(t$95$0 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y + x\right)\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{-63}:\\
\;\;\;\;1 \cdot \frac{\frac{y}{t\_0}}{y + x}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+152}:\\
\;\;\;\;\frac{x}{t\_0 \cdot \left(y + x\right)} \cdot \frac{y}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < -5.2000000000000003e-63Initial program 64.9%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
Applied rewrites99.7%
Taylor expanded in y around 0
Applied rewrites41.9%
if -5.2000000000000003e-63 < y < 6.6000000000000003e152Initial program 70.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6498.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.5
Applied rewrites98.5%
if 6.6000000000000003e152 < y Initial program 61.6%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f6490.1
Applied rewrites90.1%
Final simplification80.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ y x))))
(if (<= x -2.8e+101)
(* 1.0 (/ (/ y t_0) (+ y x)))
(if (<= x -1.25e-9)
(/ (* y x) (* (* (+ y x) (+ y x)) t_0))
(* (/ x (* (+ 1.0 y) (+ y x))) (/ y (+ y x)))))))
double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -2.8e+101) {
tmp = 1.0 * ((y / t_0) / (y + x));
} else if (x <= -1.25e-9) {
tmp = (y * x) / (((y + x) * (y + x)) * t_0);
} else {
tmp = (x / ((1.0 + y) * (y + 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) :: tmp
t_0 = 1.0d0 + (y + x)
if (x <= (-2.8d+101)) then
tmp = 1.0d0 * ((y / t_0) / (y + x))
else if (x <= (-1.25d-9)) then
tmp = (y * x) / (((y + x) * (y + x)) * t_0)
else
tmp = (x / ((1.0d0 + y) * (y + x))) * (y / (y + x))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -2.8e+101) {
tmp = 1.0 * ((y / t_0) / (y + x));
} else if (x <= -1.25e-9) {
tmp = (y * x) / (((y + x) * (y + x)) * t_0);
} else {
tmp = (x / ((1.0 + y) * (y + x))) * (y / (y + x));
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y + x) tmp = 0 if x <= -2.8e+101: tmp = 1.0 * ((y / t_0) / (y + x)) elif x <= -1.25e-9: tmp = (y * x) / (((y + x) * (y + x)) * t_0) else: tmp = (x / ((1.0 + y) * (y + x))) * (y / (y + x)) return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y + x)) tmp = 0.0 if (x <= -2.8e+101) tmp = Float64(1.0 * Float64(Float64(y / t_0) / Float64(y + x))); elseif (x <= -1.25e-9) tmp = Float64(Float64(y * x) / Float64(Float64(Float64(y + x) * Float64(y + x)) * t_0)); else tmp = Float64(Float64(x / Float64(Float64(1.0 + y) * Float64(y + x))) * Float64(y / Float64(y + x))); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y + x); tmp = 0.0; if (x <= -2.8e+101) tmp = 1.0 * ((y / t_0) / (y + x)); elseif (x <= -1.25e-9) tmp = (y * x) / (((y + x) * (y + x)) * t_0); else tmp = (x / ((1.0 + y) * (y + x))) * (y / (y + x)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8e+101], N[(1.0 * N[(N[(y / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.25e-9], N[(N[(y * x), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(N[(1.0 + y), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y + x\right)\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+101}:\\
\;\;\;\;1 \cdot \frac{\frac{y}{t\_0}}{y + x}\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-9}:\\
\;\;\;\;\frac{y \cdot x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(1 + y\right) \cdot \left(y + x\right)} \cdot \frac{y}{y + x}\\
\end{array}
\end{array}
if x < -2.79999999999999981e101Initial program 47.0%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
Applied rewrites74.6%
if -2.79999999999999981e101 < x < -1.25e-9Initial program 79.3%
if -1.25e-9 < x Initial program 69.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6496.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.0
Applied rewrites96.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f6482.0
Applied rewrites82.0%
Final simplification80.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ y x))))
(if (<= x -2.8e+101)
(* 1.0 (/ (/ y t_0) (+ y x)))
(if (<= x -2.6e-142)
(/ (* y x) (* (* (+ y x) (+ y x)) t_0))
(/ (/ x (+ y x)) (+ 1.0 y))))))
double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -2.8e+101) {
tmp = 1.0 * ((y / t_0) / (y + x));
} else if (x <= -2.6e-142) {
tmp = (y * x) / (((y + x) * (y + x)) * t_0);
} else {
tmp = (x / (y + x)) / (1.0 + y);
}
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 = 1.0d0 + (y + x)
if (x <= (-2.8d+101)) then
tmp = 1.0d0 * ((y / t_0) / (y + x))
else if (x <= (-2.6d-142)) then
tmp = (y * x) / (((y + x) * (y + x)) * t_0)
else
tmp = (x / (y + x)) / (1.0d0 + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -2.8e+101) {
tmp = 1.0 * ((y / t_0) / (y + x));
} else if (x <= -2.6e-142) {
tmp = (y * x) / (((y + x) * (y + x)) * t_0);
} else {
tmp = (x / (y + x)) / (1.0 + y);
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y + x) tmp = 0 if x <= -2.8e+101: tmp = 1.0 * ((y / t_0) / (y + x)) elif x <= -2.6e-142: tmp = (y * x) / (((y + x) * (y + x)) * t_0) else: tmp = (x / (y + x)) / (1.0 + y) return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y + x)) tmp = 0.0 if (x <= -2.8e+101) tmp = Float64(1.0 * Float64(Float64(y / t_0) / Float64(y + x))); elseif (x <= -2.6e-142) tmp = Float64(Float64(y * x) / Float64(Float64(Float64(y + x) * Float64(y + x)) * t_0)); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(1.0 + y)); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y + x); tmp = 0.0; if (x <= -2.8e+101) tmp = 1.0 * ((y / t_0) / (y + x)); elseif (x <= -2.6e-142) tmp = (y * x) / (((y + x) * (y + x)) * t_0); else tmp = (x / (y + x)) / (1.0 + y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8e+101], N[(1.0 * N[(N[(y / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.6e-142], N[(N[(y * x), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y + x\right)\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+101}:\\
\;\;\;\;1 \cdot \frac{\frac{y}{t\_0}}{y + x}\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-142}:\\
\;\;\;\;\frac{y \cdot x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{1 + y}\\
\end{array}
\end{array}
if x < -2.79999999999999981e101Initial program 47.0%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
Applied rewrites74.6%
if -2.79999999999999981e101 < x < -2.6e-142Initial program 82.5%
if -2.6e-142 < x Initial program 67.8%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f6455.4
Applied rewrites55.4%
Final simplification63.5%
(FPCore (x y)
:precision binary64
(if (<= y -0.94)
(/ (/ y x) (+ y x))
(if (<= y 1.95e-156)
(/ y (fma x x x))
(if (<= y 6.6e+152)
(* 1.0 (/ x (* (+ 1.0 (+ y x)) (+ y x))))
(/ (/ x y) (+ y x))))))
double code(double x, double y) {
double tmp;
if (y <= -0.94) {
tmp = (y / x) / (y + x);
} else if (y <= 1.95e-156) {
tmp = y / fma(x, x, x);
} else if (y <= 6.6e+152) {
tmp = 1.0 * (x / ((1.0 + (y + x)) * (y + x)));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= -0.94) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (y <= 1.95e-156) tmp = Float64(y / fma(x, x, x)); elseif (y <= 6.6e+152) tmp = Float64(1.0 * Float64(x / Float64(Float64(1.0 + Float64(y + x)) * Float64(y + x)))); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
code[x_, y_] := If[LessEqual[y, -0.94], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.95e-156], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+152], N[(1.0 * N[(x / N[(N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.94:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-156}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+152}:\\
\;\;\;\;1 \cdot \frac{x}{\left(1 + \left(y + x\right)\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < -0.93999999999999995Initial program 57.4%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.6
Applied rewrites99.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.0
Applied rewrites99.0%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6498.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.9
Applied rewrites98.9%
Taylor expanded in x around inf
lower-/.f6431.0
Applied rewrites31.0%
if -0.93999999999999995 < y < 1.9500000000000001e-156Initial program 72.4%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6477.7
Applied rewrites77.7%
if 1.9500000000000001e-156 < y < 6.6000000000000003e152Initial program 73.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
Applied rewrites97.1%
Taylor expanded in y around inf
Applied rewrites65.0%
if 6.6000000000000003e152 < y Initial program 61.6%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f6490.1
Applied rewrites90.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ y x))))
(if (<= y 1.95e-156)
(* 1.0 (/ (/ y t_0) (+ y x)))
(if (<= y 6.6e+152) (* 1.0 (/ x (* t_0 (+ y x)))) (/ (/ x y) (+ y x))))))
double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (y <= 1.95e-156) {
tmp = 1.0 * ((y / t_0) / (y + x));
} else if (y <= 6.6e+152) {
tmp = 1.0 * (x / (t_0 * (y + x)));
} else {
tmp = (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) :: tmp
t_0 = 1.0d0 + (y + x)
if (y <= 1.95d-156) then
tmp = 1.0d0 * ((y / t_0) / (y + x))
else if (y <= 6.6d+152) then
tmp = 1.0d0 * (x / (t_0 * (y + x)))
else
tmp = (x / y) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (y <= 1.95e-156) {
tmp = 1.0 * ((y / t_0) / (y + x));
} else if (y <= 6.6e+152) {
tmp = 1.0 * (x / (t_0 * (y + x)));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y + x) tmp = 0 if y <= 1.95e-156: tmp = 1.0 * ((y / t_0) / (y + x)) elif y <= 6.6e+152: tmp = 1.0 * (x / (t_0 * (y + x))) else: tmp = (x / y) / (y + x) return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y + x)) tmp = 0.0 if (y <= 1.95e-156) tmp = Float64(1.0 * Float64(Float64(y / t_0) / Float64(y + x))); elseif (y <= 6.6e+152) tmp = Float64(1.0 * Float64(x / Float64(t_0 * Float64(y + x)))); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y + x); tmp = 0.0; if (y <= 1.95e-156) tmp = 1.0 * ((y / t_0) / (y + x)); elseif (y <= 6.6e+152) tmp = 1.0 * (x / (t_0 * (y + x))); else tmp = (x / y) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.95e-156], N[(1.0 * N[(N[(y / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+152], N[(1.0 * N[(x / N[(t$95$0 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y + x\right)\\
\mathbf{if}\;y \leq 1.95 \cdot 10^{-156}:\\
\;\;\;\;1 \cdot \frac{\frac{y}{t\_0}}{y + x}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+152}:\\
\;\;\;\;1 \cdot \frac{x}{t\_0 \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < 1.9500000000000001e-156Initial program 66.3%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
Applied rewrites59.0%
if 1.9500000000000001e-156 < y < 6.6000000000000003e152Initial program 73.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.1
Applied rewrites97.1%
Taylor expanded in y around inf
Applied rewrites65.0%
if 6.6000000000000003e152 < y Initial program 61.6%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f6490.1
Applied rewrites90.1%
(FPCore (x y)
:precision binary64
(if (<= x -1.45e+154)
(/ (/ y x) (+ y x))
(if (<= x -1.85e-134)
(/ (* 1.0 y) (* (+ 1.0 (+ y x)) (+ y x)))
(/ (/ x (+ y x)) (+ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (x <= -1.45e+154) {
tmp = (y / x) / (y + x);
} else if (x <= -1.85e-134) {
tmp = (1.0 * y) / ((1.0 + (y + x)) * (y + x));
} else {
tmp = (x / (y + x)) / (1.0 + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.45d+154)) then
tmp = (y / x) / (y + x)
else if (x <= (-1.85d-134)) then
tmp = (1.0d0 * y) / ((1.0d0 + (y + x)) * (y + x))
else
tmp = (x / (y + x)) / (1.0d0 + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.45e+154) {
tmp = (y / x) / (y + x);
} else if (x <= -1.85e-134) {
tmp = (1.0 * y) / ((1.0 + (y + x)) * (y + x));
} else {
tmp = (x / (y + x)) / (1.0 + y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.45e+154: tmp = (y / x) / (y + x) elif x <= -1.85e-134: tmp = (1.0 * y) / ((1.0 + (y + x)) * (y + x)) else: tmp = (x / (y + x)) / (1.0 + y) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.45e+154) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -1.85e-134) tmp = Float64(Float64(1.0 * y) / Float64(Float64(1.0 + Float64(y + x)) * Float64(y + x))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(1.0 + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.45e+154) tmp = (y / x) / (y + x); elseif (x <= -1.85e-134) tmp = (1.0 * y) / ((1.0 + (y + x)) * (y + x)); else tmp = (x / (y + x)) / (1.0 + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.45e+154], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.85e-134], N[(N[(1.0 * y), $MachinePrecision] / N[(N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-134}:\\
\;\;\;\;\frac{1 \cdot y}{\left(1 + \left(y + x\right)\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{1 + y}\\
\end{array}
\end{array}
if x < -1.4499999999999999e154Initial program 54.2%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6497.9
Applied rewrites97.9%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6497.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.9
Applied rewrites97.9%
Taylor expanded in x around inf
lower-/.f6479.1
Applied rewrites79.1%
if -1.4499999999999999e154 < x < -1.85e-134Initial program 73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6493.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.4
Applied rewrites93.4%
Taylor expanded in y around 0
Applied rewrites66.9%
if -1.85e-134 < x Initial program 68.0%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f6455.0
Applied rewrites55.0%
Final simplification60.2%
(FPCore (x y) :precision binary64 (if (<= y -0.94) (/ (/ y x) (+ y x)) (if (<= y 3.6e-150) (/ y (fma x x x)) (/ (/ x (+ y x)) (+ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= -0.94) {
tmp = (y / x) / (y + x);
} else if (y <= 3.6e-150) {
tmp = y / fma(x, x, x);
} else {
tmp = (x / (y + x)) / (1.0 + y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= -0.94) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (y <= 3.6e-150) tmp = Float64(y / fma(x, x, x)); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(1.0 + y)); end return tmp end
code[x_, y_] := If[LessEqual[y, -0.94], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e-150], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.94:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-150}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{1 + y}\\
\end{array}
\end{array}
if y < -0.93999999999999995Initial program 57.4%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.6
Applied rewrites99.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.0
Applied rewrites99.0%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6498.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.9
Applied rewrites98.9%
Taylor expanded in x around inf
lower-/.f6431.0
Applied rewrites31.0%
if -0.93999999999999995 < y < 3.6000000000000002e-150Initial program 71.7%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6476.9
Applied rewrites76.9%
if 3.6000000000000002e-150 < y Initial program 71.0%
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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.4
Applied rewrites99.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f6461.8
Applied rewrites61.8%
Final simplification59.6%
(FPCore (x y) :precision binary64 (if (<= y 3.6e-150) (/ y (fma x x x)) (if (<= y 1.5e+58) (/ x (fma y y y)) (/ (/ x y) y))))
double code(double x, double y) {
double tmp;
if (y <= 3.6e-150) {
tmp = y / fma(x, x, x);
} else if (y <= 1.5e+58) {
tmp = x / fma(y, y, y);
} else {
tmp = (x / y) / y;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 3.6e-150) tmp = Float64(y / fma(x, x, x)); elseif (y <= 1.5e+58) tmp = Float64(x / fma(y, y, y)); else tmp = Float64(Float64(x / y) / y); end return tmp end
code[x_, y_] := If[LessEqual[y, 3.6e-150], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+58], 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 3.6 \cdot 10^{-150}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+58}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 3.6000000000000002e-150Initial program 65.9%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6455.5
Applied rewrites55.5%
if 3.6000000000000002e-150 < y < 1.5000000000000001e58Initial program 79.8%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6443.5
Applied rewrites43.5%
if 1.5000000000000001e58 < y Initial program 61.1%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6471.6
Applied rewrites71.6%
Applied rewrites81.0%
(FPCore (x y) :precision binary64 (if (<= x -7.8e+29) (/ (/ y x) (+ y x)) (/ x (fma y y y))))
double code(double x, double y) {
double tmp;
if (x <= -7.8e+29) {
tmp = (y / x) / (y + x);
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -7.8e+29) tmp = Float64(Float64(y / x) / Float64(y + x)); else tmp = Float64(x / fma(y, y, y)); end return tmp end
code[x_, y_] := If[LessEqual[x, -7.8e+29], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if x < -7.79999999999999937e29Initial program 59.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
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6498.3
Applied rewrites98.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6498.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.3
Applied rewrites98.3%
Taylor expanded in x around inf
lower-/.f6472.3
Applied rewrites72.3%
if -7.79999999999999937e29 < x Initial program 70.2%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6456.1
Applied rewrites56.1%
(FPCore (x y) :precision binary64 (if (<= x -7.8e+29) (/ (/ y x) x) (/ x (fma y y y))))
double code(double x, double y) {
double tmp;
if (x <= -7.8e+29) {
tmp = (y / x) / x;
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -7.8e+29) tmp = Float64(Float64(y / x) / x); else tmp = Float64(x / fma(y, y, y)); end return tmp end
code[x_, y_] := If[LessEqual[x, -7.8e+29], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if x < -7.79999999999999937e29Initial program 59.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6480.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6480.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6480.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6480.1
Applied rewrites80.1%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6467.6
Applied rewrites67.6%
Applied rewrites71.5%
if -7.79999999999999937e29 < x Initial program 70.2%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6456.1
Applied rewrites56.1%
(FPCore (x y) :precision binary64 (if (<= x -7.8e+29) (/ y (* x x)) (/ x (fma y y y))))
double code(double x, double y) {
double tmp;
if (x <= -7.8e+29) {
tmp = y / (x * x);
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -7.8e+29) 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.8e+29], 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.8 \cdot 10^{+29}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if x < -7.79999999999999937e29Initial program 59.7%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6467.6
Applied rewrites67.6%
if -7.79999999999999937e29 < x Initial program 70.2%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6456.1
Applied rewrites56.1%
(FPCore (x y) :precision binary64 (if (<= x -7.8e+29) (/ y (* x x)) (/ x (* y y))))
double code(double x, double y) {
double tmp;
if (x <= -7.8e+29) {
tmp = y / (x * x);
} 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 (x <= (-7.8d+29)) then
tmp = y / (x * x)
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -7.8e+29) {
tmp = y / (x * x);
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -7.8e+29: tmp = y / (x * x) else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (x <= -7.8e+29) tmp = Float64(y / Float64(x * x)); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -7.8e+29) tmp = y / (x * x); else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -7.8e+29], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{+29}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if x < -7.79999999999999937e29Initial program 59.7%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6467.6
Applied rewrites67.6%
if -7.79999999999999937e29 < x Initial program 70.2%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6439.0
Applied rewrites39.0%
(FPCore (x y) :precision binary64 (/ x (* y y)))
double code(double x, double y) {
return x / (y * y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / (y * y)
end function
public static double code(double x, double y) {
return x / (y * y);
}
def code(x, y): return x / (y * y)
function code(x, y) return Float64(x / Float64(y * y)) end
function tmp = code(x, y) tmp = x / (y * y); end
code[x_, y_] := N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y \cdot y}
\end{array}
Initial program 67.8%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6433.8
Applied rewrites33.8%
(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 2024254
(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))))