
(FPCore (x y) :precision binary64 (/ (+ x y) (+ y 1.0)))
double code(double x, double y) {
return (x + y) / (y + 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x + y) / (y + 1.0d0)
end function
public static double code(double x, double y) {
return (x + y) / (y + 1.0);
}
def code(x, y): return (x + y) / (y + 1.0)
function code(x, y) return Float64(Float64(x + y) / Float64(y + 1.0)) end
function tmp = code(x, y) tmp = (x + y) / (y + 1.0); end
code[x_, y_] := N[(N[(x + y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{y + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (+ x y) (+ y 1.0)))
double code(double x, double y) {
return (x + y) / (y + 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x + y) / (y + 1.0d0)
end function
public static double code(double x, double y) {
return (x + y) / (y + 1.0);
}
def code(x, y): return (x + y) / (y + 1.0)
function code(x, y) return Float64(Float64(x + y) / Float64(y + 1.0)) end
function tmp = code(x, y) tmp = (x + y) / (y + 1.0); end
code[x_, y_] := N[(N[(x + y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{y + 1}
\end{array}
(FPCore (x y) :precision binary64 (/ (+ x y) (+ y 1.0)))
double code(double x, double y) {
return (x + y) / (y + 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x + y) / (y + 1.0d0)
end function
public static double code(double x, double y) {
return (x + y) / (y + 1.0);
}
def code(x, y): return (x + y) / (y + 1.0)
function code(x, y) return Float64(Float64(x + y) / Float64(y + 1.0)) end
function tmp = code(x, y) tmp = (x + y) / (y + 1.0); end
code[x_, y_] := N[(N[(x + y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{y + 1}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y 1.0))))
(if (<= x -2.3e+45)
t_0
(if (<= x 3e-35)
(/ y (+ y 1.0))
(if (<= x 1.16e+24) x (if (<= x 3.6e+34) 1.0 t_0))))))
double code(double x, double y) {
double t_0 = x / (y + 1.0);
double tmp;
if (x <= -2.3e+45) {
tmp = t_0;
} else if (x <= 3e-35) {
tmp = y / (y + 1.0);
} else if (x <= 1.16e+24) {
tmp = x;
} else if (x <= 3.6e+34) {
tmp = 1.0;
} else {
tmp = t_0;
}
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 = x / (y + 1.0d0)
if (x <= (-2.3d+45)) then
tmp = t_0
else if (x <= 3d-35) then
tmp = y / (y + 1.0d0)
else if (x <= 1.16d+24) then
tmp = x
else if (x <= 3.6d+34) then
tmp = 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y + 1.0);
double tmp;
if (x <= -2.3e+45) {
tmp = t_0;
} else if (x <= 3e-35) {
tmp = y / (y + 1.0);
} else if (x <= 1.16e+24) {
tmp = x;
} else if (x <= 3.6e+34) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (y + 1.0) tmp = 0 if x <= -2.3e+45: tmp = t_0 elif x <= 3e-35: tmp = y / (y + 1.0) elif x <= 1.16e+24: tmp = x elif x <= 3.6e+34: tmp = 1.0 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x / Float64(y + 1.0)) tmp = 0.0 if (x <= -2.3e+45) tmp = t_0; elseif (x <= 3e-35) tmp = Float64(y / Float64(y + 1.0)); elseif (x <= 1.16e+24) tmp = x; elseif (x <= 3.6e+34) tmp = 1.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y + 1.0); tmp = 0.0; if (x <= -2.3e+45) tmp = t_0; elseif (x <= 3e-35) tmp = y / (y + 1.0); elseif (x <= 1.16e+24) tmp = x; elseif (x <= 3.6e+34) tmp = 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.3e+45], t$95$0, If[LessEqual[x, 3e-35], N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.16e+24], x, If[LessEqual[x, 3.6e+34], 1.0, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + 1}\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{+45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-35}:\\
\;\;\;\;\frac{y}{y + 1}\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{+24}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+34}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.30000000000000012e45 or 3.6e34 < x Initial program 100.0%
Taylor expanded in x around inf 81.2%
+-commutative81.2%
Simplified81.2%
if -2.30000000000000012e45 < x < 2.99999999999999989e-35Initial program 100.0%
Taylor expanded in x around 0 82.3%
+-commutative82.3%
Simplified82.3%
if 2.99999999999999989e-35 < x < 1.16000000000000005e24Initial program 100.0%
Taylor expanded in y around 0 72.7%
if 1.16000000000000005e24 < x < 3.6e34Initial program 100.0%
Taylor expanded in y around inf 100.0%
Final simplification81.7%
(FPCore (x y) :precision binary64 (if (<= y -1.0) 1.0 (if (<= y 3.7) x (if (<= y 5.7e+69) 1.0 (if (<= y 6.5e+96) (/ x y) 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = 1.0;
} else if (y <= 3.7) {
tmp = x;
} else if (y <= 5.7e+69) {
tmp = 1.0;
} else if (y <= 6.5e+96) {
tmp = x / y;
} else {
tmp = 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 <= (-1.0d0)) then
tmp = 1.0d0
else if (y <= 3.7d0) then
tmp = x
else if (y <= 5.7d+69) then
tmp = 1.0d0
else if (y <= 6.5d+96) then
tmp = x / y
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = 1.0;
} else if (y <= 3.7) {
tmp = x;
} else if (y <= 5.7e+69) {
tmp = 1.0;
} else if (y <= 6.5e+96) {
tmp = x / y;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = 1.0 elif y <= 3.7: tmp = x elif y <= 5.7e+69: tmp = 1.0 elif y <= 6.5e+96: tmp = x / y else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = 1.0; elseif (y <= 3.7) tmp = x; elseif (y <= 5.7e+69) tmp = 1.0; elseif (y <= 6.5e+96) tmp = Float64(x / y); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.0) tmp = 1.0; elseif (y <= 3.7) tmp = x; elseif (y <= 5.7e+69) tmp = 1.0; elseif (y <= 6.5e+96) tmp = x / y; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], 1.0, If[LessEqual[y, 3.7], x, If[LessEqual[y, 5.7e+69], 1.0, If[LessEqual[y, 6.5e+96], N[(x / y), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.7:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.7 \cdot 10^{+69}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+96}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1 or 3.7000000000000002 < y < 5.7e69 or 6.5e96 < y Initial program 100.0%
Taylor expanded in y around inf 79.6%
if -1 < y < 3.7000000000000002Initial program 100.0%
Taylor expanded in y around 0 73.9%
if 5.7e69 < y < 6.5e96Initial program 100.0%
Taylor expanded in x around inf 86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in y around inf 86.2%
Final simplification77.0%
(FPCore (x y)
:precision binary64
(if (<= y -1.0)
1.0
(if (<= y 0.068)
(- x (* x y))
(if (<= y 1.35e+69) 1.0 (if (<= y 2.7e+98) (/ x y) 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = 1.0;
} else if (y <= 0.068) {
tmp = x - (x * y);
} else if (y <= 1.35e+69) {
tmp = 1.0;
} else if (y <= 2.7e+98) {
tmp = x / y;
} else {
tmp = 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 <= (-1.0d0)) then
tmp = 1.0d0
else if (y <= 0.068d0) then
tmp = x - (x * y)
else if (y <= 1.35d+69) then
tmp = 1.0d0
else if (y <= 2.7d+98) then
tmp = x / y
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = 1.0;
} else if (y <= 0.068) {
tmp = x - (x * y);
} else if (y <= 1.35e+69) {
tmp = 1.0;
} else if (y <= 2.7e+98) {
tmp = x / y;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = 1.0 elif y <= 0.068: tmp = x - (x * y) elif y <= 1.35e+69: tmp = 1.0 elif y <= 2.7e+98: tmp = x / y else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = 1.0; elseif (y <= 0.068) tmp = Float64(x - Float64(x * y)); elseif (y <= 1.35e+69) tmp = 1.0; elseif (y <= 2.7e+98) tmp = Float64(x / y); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.0) tmp = 1.0; elseif (y <= 0.068) tmp = x - (x * y); elseif (y <= 1.35e+69) tmp = 1.0; elseif (y <= 2.7e+98) tmp = x / y; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], 1.0, If[LessEqual[y, 0.068], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+69], 1.0, If[LessEqual[y, 2.7e+98], N[(x / y), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 0.068:\\
\;\;\;\;x - x \cdot y\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+69}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+98}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1 or 0.068000000000000005 < y < 1.3499999999999999e69 or 2.7e98 < y Initial program 100.0%
Taylor expanded in y around inf 79.6%
if -1 < y < 0.068000000000000005Initial program 100.0%
Taylor expanded in x around inf 75.4%
+-commutative75.4%
Simplified75.4%
Taylor expanded in y around 0 74.8%
mul-1-neg74.8%
unsub-neg74.8%
*-commutative74.8%
Simplified74.8%
if 1.3499999999999999e69 < y < 2.7e98Initial program 100.0%
Taylor expanded in x around inf 86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in y around inf 86.2%
Final simplification77.4%
(FPCore (x y)
:precision binary64
(if (<= y -1.04e+18)
1.0
(if (<= y 3.8e+23)
(/ x (+ y 1.0))
(if (<= y 2.95e+69) 1.0 (if (<= y 5e+96) (/ x y) 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -1.04e+18) {
tmp = 1.0;
} else if (y <= 3.8e+23) {
tmp = x / (y + 1.0);
} else if (y <= 2.95e+69) {
tmp = 1.0;
} else if (y <= 5e+96) {
tmp = x / y;
} else {
tmp = 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 <= (-1.04d+18)) then
tmp = 1.0d0
else if (y <= 3.8d+23) then
tmp = x / (y + 1.0d0)
else if (y <= 2.95d+69) then
tmp = 1.0d0
else if (y <= 5d+96) then
tmp = x / y
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.04e+18) {
tmp = 1.0;
} else if (y <= 3.8e+23) {
tmp = x / (y + 1.0);
} else if (y <= 2.95e+69) {
tmp = 1.0;
} else if (y <= 5e+96) {
tmp = x / y;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.04e+18: tmp = 1.0 elif y <= 3.8e+23: tmp = x / (y + 1.0) elif y <= 2.95e+69: tmp = 1.0 elif y <= 5e+96: tmp = x / y else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -1.04e+18) tmp = 1.0; elseif (y <= 3.8e+23) tmp = Float64(x / Float64(y + 1.0)); elseif (y <= 2.95e+69) tmp = 1.0; elseif (y <= 5e+96) tmp = Float64(x / y); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.04e+18) tmp = 1.0; elseif (y <= 3.8e+23) tmp = x / (y + 1.0); elseif (y <= 2.95e+69) tmp = 1.0; elseif (y <= 5e+96) tmp = x / y; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.04e+18], 1.0, If[LessEqual[y, 3.8e+23], N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.95e+69], 1.0, If[LessEqual[y, 5e+96], N[(x / y), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.04 \cdot 10^{+18}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+23}:\\
\;\;\;\;\frac{x}{y + 1}\\
\mathbf{elif}\;y \leq 2.95 \cdot 10^{+69}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+96}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.04e18 or 3.79999999999999975e23 < y < 2.95000000000000002e69 or 5.0000000000000004e96 < y Initial program 100.0%
Taylor expanded in y around inf 83.7%
if -1.04e18 < y < 3.79999999999999975e23Initial program 100.0%
Taylor expanded in x around inf 74.9%
+-commutative74.9%
Simplified74.9%
if 2.95000000000000002e69 < y < 5.0000000000000004e96Initial program 100.0%
Taylor expanded in x around inf 86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in y around inf 86.2%
Final simplification79.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y 1.0))))
(if (<= y -0.05)
t_0
(if (<= y 0.00024)
(+ x (* y (- 1.0 x)))
(if (<= y 2.6e+69) t_0 (if (<= y 3.2e+105) (/ x y) 1.0))))))
double code(double x, double y) {
double t_0 = y / (y + 1.0);
double tmp;
if (y <= -0.05) {
tmp = t_0;
} else if (y <= 0.00024) {
tmp = x + (y * (1.0 - x));
} else if (y <= 2.6e+69) {
tmp = t_0;
} else if (y <= 3.2e+105) {
tmp = x / y;
} else {
tmp = 1.0;
}
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 / (y + 1.0d0)
if (y <= (-0.05d0)) then
tmp = t_0
else if (y <= 0.00024d0) then
tmp = x + (y * (1.0d0 - x))
else if (y <= 2.6d+69) then
tmp = t_0
else if (y <= 3.2d+105) then
tmp = x / y
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (y + 1.0);
double tmp;
if (y <= -0.05) {
tmp = t_0;
} else if (y <= 0.00024) {
tmp = x + (y * (1.0 - x));
} else if (y <= 2.6e+69) {
tmp = t_0;
} else if (y <= 3.2e+105) {
tmp = x / y;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): t_0 = y / (y + 1.0) tmp = 0 if y <= -0.05: tmp = t_0 elif y <= 0.00024: tmp = x + (y * (1.0 - x)) elif y <= 2.6e+69: tmp = t_0 elif y <= 3.2e+105: tmp = x / y else: tmp = 1.0 return tmp
function code(x, y) t_0 = Float64(y / Float64(y + 1.0)) tmp = 0.0 if (y <= -0.05) tmp = t_0; elseif (y <= 0.00024) tmp = Float64(x + Float64(y * Float64(1.0 - x))); elseif (y <= 2.6e+69) tmp = t_0; elseif (y <= 3.2e+105) tmp = Float64(x / y); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) t_0 = y / (y + 1.0); tmp = 0.0; if (y <= -0.05) tmp = t_0; elseif (y <= 0.00024) tmp = x + (y * (1.0 - x)); elseif (y <= 2.6e+69) tmp = t_0; elseif (y <= 3.2e+105) tmp = x / y; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.05], t$95$0, If[LessEqual[y, 0.00024], N[(x + N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+69], t$95$0, If[LessEqual[y, 3.2e+105], N[(x / y), $MachinePrecision], 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{y + 1}\\
\mathbf{if}\;y \leq -0.05:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 0.00024:\\
\;\;\;\;x + y \cdot \left(1 - x\right)\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+69}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+105}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -0.050000000000000003 or 2.40000000000000006e-4 < y < 2.6000000000000002e69Initial program 100.0%
Taylor expanded in x around 0 74.5%
+-commutative74.5%
Simplified74.5%
if -0.050000000000000003 < y < 2.40000000000000006e-4Initial program 100.0%
Taylor expanded in y around 0 98.8%
if 2.6000000000000002e69 < y < 3.2e105Initial program 100.0%
Taylor expanded in x around inf 86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in y around inf 86.2%
if 3.2e105 < y Initial program 100.0%
Taylor expanded in y around inf 92.8%
Final simplification89.3%
(FPCore (x y) :precision binary64 (if (<= y -1.0) 1.0 (if (<= y 2.5) x 1.0)))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = 1.0;
} else if (y <= 2.5) {
tmp = x;
} else {
tmp = 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 <= (-1.0d0)) then
tmp = 1.0d0
else if (y <= 2.5d0) then
tmp = x
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = 1.0;
} else if (y <= 2.5) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = 1.0 elif y <= 2.5: tmp = x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = 1.0; elseif (y <= 2.5) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.0) tmp = 1.0; elseif (y <= 2.5) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], 1.0, If[LessEqual[y, 2.5], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.5:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1 or 2.5 < y Initial program 100.0%
Taylor expanded in y around inf 76.3%
if -1 < y < 2.5Initial program 100.0%
Taylor expanded in y around 0 73.9%
Final simplification75.1%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
Taylor expanded in y around inf 41.6%
Final simplification41.6%
herbie shell --seed 2024046
(FPCore (x y)
:name "Data.Colour.SRGB:invTransferFunction from colour-2.3.3"
:precision binary64
(/ (+ x y) (+ y 1.0)))