
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
Initial program 100.0%
(FPCore (x y)
:precision binary64
(if (<= y -2.05e+107)
1.0
(if (<= y -9e+83)
(+ -1.0 (/ y x))
(if (<= y -2.0)
1.0
(if (<= y -2.8e-132) (* y -0.5) (if (<= y 2.9e+31) -1.0 1.0))))))
double code(double x, double y) {
double tmp;
if (y <= -2.05e+107) {
tmp = 1.0;
} else if (y <= -9e+83) {
tmp = -1.0 + (y / x);
} else if (y <= -2.0) {
tmp = 1.0;
} else if (y <= -2.8e-132) {
tmp = y * -0.5;
} else if (y <= 2.9e+31) {
tmp = -1.0;
} 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 <= (-2.05d+107)) then
tmp = 1.0d0
else if (y <= (-9d+83)) then
tmp = (-1.0d0) + (y / x)
else if (y <= (-2.0d0)) then
tmp = 1.0d0
else if (y <= (-2.8d-132)) then
tmp = y * (-0.5d0)
else if (y <= 2.9d+31) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.05e+107) {
tmp = 1.0;
} else if (y <= -9e+83) {
tmp = -1.0 + (y / x);
} else if (y <= -2.0) {
tmp = 1.0;
} else if (y <= -2.8e-132) {
tmp = y * -0.5;
} else if (y <= 2.9e+31) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.05e+107: tmp = 1.0 elif y <= -9e+83: tmp = -1.0 + (y / x) elif y <= -2.0: tmp = 1.0 elif y <= -2.8e-132: tmp = y * -0.5 elif y <= 2.9e+31: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -2.05e+107) tmp = 1.0; elseif (y <= -9e+83) tmp = Float64(-1.0 + Float64(y / x)); elseif (y <= -2.0) tmp = 1.0; elseif (y <= -2.8e-132) tmp = Float64(y * -0.5); elseif (y <= 2.9e+31) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.05e+107) tmp = 1.0; elseif (y <= -9e+83) tmp = -1.0 + (y / x); elseif (y <= -2.0) tmp = 1.0; elseif (y <= -2.8e-132) tmp = y * -0.5; elseif (y <= 2.9e+31) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.05e+107], 1.0, If[LessEqual[y, -9e+83], N[(-1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.0], 1.0, If[LessEqual[y, -2.8e-132], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 2.9e+31], -1.0, 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+107}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -9 \cdot 10^{+83}:\\
\;\;\;\;-1 + \frac{y}{x}\\
\mathbf{elif}\;y \leq -2:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-132}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+31}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.05e107 or -8.9999999999999999e83 < y < -2 or 2.9e31 < y Initial program 99.9%
remove-double-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 81.3%
if -2.05e107 < y < -8.9999999999999999e83Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 92.8%
Taylor expanded in y around 0 92.8%
if -2 < y < -2.80000000000000002e-132Initial program 99.9%
remove-double-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 53.8%
Taylor expanded in y around 0 50.9%
*-commutative50.9%
Simplified50.9%
if -2.80000000000000002e-132 < y < 2.9e31Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 57.6%
Final simplification67.5%
(FPCore (x y)
:precision binary64
(if (<= y -3.15e+109)
1.0
(if (<= y -1.05e+84)
-1.0
(if (<= y -2.0)
1.0
(if (<= y -9.5e-135) (* y -0.5) (if (<= y 6e+34) -1.0 1.0))))))
double code(double x, double y) {
double tmp;
if (y <= -3.15e+109) {
tmp = 1.0;
} else if (y <= -1.05e+84) {
tmp = -1.0;
} else if (y <= -2.0) {
tmp = 1.0;
} else if (y <= -9.5e-135) {
tmp = y * -0.5;
} else if (y <= 6e+34) {
tmp = -1.0;
} 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 <= (-3.15d+109)) then
tmp = 1.0d0
else if (y <= (-1.05d+84)) then
tmp = -1.0d0
else if (y <= (-2.0d0)) then
tmp = 1.0d0
else if (y <= (-9.5d-135)) then
tmp = y * (-0.5d0)
else if (y <= 6d+34) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.15e+109) {
tmp = 1.0;
} else if (y <= -1.05e+84) {
tmp = -1.0;
} else if (y <= -2.0) {
tmp = 1.0;
} else if (y <= -9.5e-135) {
tmp = y * -0.5;
} else if (y <= 6e+34) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.15e+109: tmp = 1.0 elif y <= -1.05e+84: tmp = -1.0 elif y <= -2.0: tmp = 1.0 elif y <= -9.5e-135: tmp = y * -0.5 elif y <= 6e+34: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -3.15e+109) tmp = 1.0; elseif (y <= -1.05e+84) tmp = -1.0; elseif (y <= -2.0) tmp = 1.0; elseif (y <= -9.5e-135) tmp = Float64(y * -0.5); elseif (y <= 6e+34) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.15e+109) tmp = 1.0; elseif (y <= -1.05e+84) tmp = -1.0; elseif (y <= -2.0) tmp = 1.0; elseif (y <= -9.5e-135) tmp = y * -0.5; elseif (y <= 6e+34) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.15e+109], 1.0, If[LessEqual[y, -1.05e+84], -1.0, If[LessEqual[y, -2.0], 1.0, If[LessEqual[y, -9.5e-135], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 6e+34], -1.0, 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.15 \cdot 10^{+109}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{+84}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -2:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{-135}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+34}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.14999999999999981e109 or -1.05000000000000009e84 < y < -2 or 6.00000000000000037e34 < y Initial program 99.9%
remove-double-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 81.3%
if -3.14999999999999981e109 < y < -1.05000000000000009e84 or -9.50000000000000007e-135 < y < 6.00000000000000037e34Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 59.5%
if -2 < y < -9.50000000000000007e-135Initial program 99.9%
remove-double-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 53.8%
Taylor expanded in y around 0 50.9%
*-commutative50.9%
Simplified50.9%
(FPCore (x y)
:precision binary64
(if (<= y -3e+106)
1.0
(if (<= y -1e+84)
(+ -1.0 (/ y x))
(if (<= y -9e-12) 1.0 (if (<= y 1.25e+33) (/ x (- 2.0 x)) 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -3e+106) {
tmp = 1.0;
} else if (y <= -1e+84) {
tmp = -1.0 + (y / x);
} else if (y <= -9e-12) {
tmp = 1.0;
} else if (y <= 1.25e+33) {
tmp = x / (2.0 - 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 <= (-3d+106)) then
tmp = 1.0d0
else if (y <= (-1d+84)) then
tmp = (-1.0d0) + (y / x)
else if (y <= (-9d-12)) then
tmp = 1.0d0
else if (y <= 1.25d+33) then
tmp = x / (2.0d0 - x)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3e+106) {
tmp = 1.0;
} else if (y <= -1e+84) {
tmp = -1.0 + (y / x);
} else if (y <= -9e-12) {
tmp = 1.0;
} else if (y <= 1.25e+33) {
tmp = x / (2.0 - x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3e+106: tmp = 1.0 elif y <= -1e+84: tmp = -1.0 + (y / x) elif y <= -9e-12: tmp = 1.0 elif y <= 1.25e+33: tmp = x / (2.0 - x) else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -3e+106) tmp = 1.0; elseif (y <= -1e+84) tmp = Float64(-1.0 + Float64(y / x)); elseif (y <= -9e-12) tmp = 1.0; elseif (y <= 1.25e+33) tmp = Float64(x / Float64(2.0 - x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3e+106) tmp = 1.0; elseif (y <= -1e+84) tmp = -1.0 + (y / x); elseif (y <= -9e-12) tmp = 1.0; elseif (y <= 1.25e+33) tmp = x / (2.0 - x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3e+106], 1.0, If[LessEqual[y, -1e+84], N[(-1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9e-12], 1.0, If[LessEqual[y, 1.25e+33], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+106}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -1 \cdot 10^{+84}:\\
\;\;\;\;-1 + \frac{y}{x}\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-12}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+33}:\\
\;\;\;\;\frac{x}{2 - x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.0000000000000001e106 or -1.00000000000000006e84 < y < -8.99999999999999962e-12 or 1.24999999999999993e33 < y Initial program 99.9%
remove-double-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 79.4%
if -3.0000000000000001e106 < y < -1.00000000000000006e84Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 92.8%
Taylor expanded in y around 0 92.8%
if -8.99999999999999962e-12 < y < 1.24999999999999993e33Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 74.0%
mul-1-neg74.0%
distribute-neg-frac274.0%
neg-sub074.0%
associate-+l-74.0%
neg-sub074.0%
+-commutative74.0%
unsub-neg74.0%
Simplified74.0%
Final simplification76.8%
(FPCore (x y)
:precision binary64
(if (<= y -3e+106)
1.0
(if (<= y -1.05e+84)
-1.0
(if (<= y -9e-12) 1.0 (if (<= y 5e+26) -1.0 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -3e+106) {
tmp = 1.0;
} else if (y <= -1.05e+84) {
tmp = -1.0;
} else if (y <= -9e-12) {
tmp = 1.0;
} else if (y <= 5e+26) {
tmp = -1.0;
} 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 <= (-3d+106)) then
tmp = 1.0d0
else if (y <= (-1.05d+84)) then
tmp = -1.0d0
else if (y <= (-9d-12)) then
tmp = 1.0d0
else if (y <= 5d+26) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3e+106) {
tmp = 1.0;
} else if (y <= -1.05e+84) {
tmp = -1.0;
} else if (y <= -9e-12) {
tmp = 1.0;
} else if (y <= 5e+26) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3e+106: tmp = 1.0 elif y <= -1.05e+84: tmp = -1.0 elif y <= -9e-12: tmp = 1.0 elif y <= 5e+26: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -3e+106) tmp = 1.0; elseif (y <= -1.05e+84) tmp = -1.0; elseif (y <= -9e-12) tmp = 1.0; elseif (y <= 5e+26) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3e+106) tmp = 1.0; elseif (y <= -1.05e+84) tmp = -1.0; elseif (y <= -9e-12) tmp = 1.0; elseif (y <= 5e+26) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3e+106], 1.0, If[LessEqual[y, -1.05e+84], -1.0, If[LessEqual[y, -9e-12], 1.0, If[LessEqual[y, 5e+26], -1.0, 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+106}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{+84}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-12}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+26}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.0000000000000001e106 or -1.05000000000000009e84 < y < -8.99999999999999962e-12 or 5.0000000000000001e26 < y Initial program 99.9%
remove-double-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 79.4%
if -3.0000000000000001e106 < y < -1.05000000000000009e84 or -8.99999999999999962e-12 < y < 5.0000000000000001e26Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 54.3%
(FPCore (x y) :precision binary64 (if (or (<= x -2.0) (not (<= x 0.125))) (/ 1.0 (/ (+ x y) (- y x))) (/ (- y x) (- y 2.0))))
double code(double x, double y) {
double tmp;
if ((x <= -2.0) || !(x <= 0.125)) {
tmp = 1.0 / ((x + y) / (y - x));
} else {
tmp = (y - x) / (y - 2.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-2.0d0)) .or. (.not. (x <= 0.125d0))) then
tmp = 1.0d0 / ((x + y) / (y - x))
else
tmp = (y - x) / (y - 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -2.0) || !(x <= 0.125)) {
tmp = 1.0 / ((x + y) / (y - x));
} else {
tmp = (y - x) / (y - 2.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -2.0) or not (x <= 0.125): tmp = 1.0 / ((x + y) / (y - x)) else: tmp = (y - x) / (y - 2.0) return tmp
function code(x, y) tmp = 0.0 if ((x <= -2.0) || !(x <= 0.125)) tmp = Float64(1.0 / Float64(Float64(x + y) / Float64(y - x))); else tmp = Float64(Float64(y - x) / Float64(y - 2.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -2.0) || ~((x <= 0.125))) tmp = 1.0 / ((x + y) / (y - x)); else tmp = (y - x) / (y - 2.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -2.0], N[Not[LessEqual[x, 0.125]], $MachinePrecision]], N[(1.0 / N[(N[(x + y), $MachinePrecision] / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] / N[(y - 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \lor \neg \left(x \leq 0.125\right):\\
\;\;\;\;\frac{1}{\frac{x + y}{y - x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{y - 2}\\
\end{array}
\end{array}
if x < -2 or 0.125 < x Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
clear-num99.9%
inv-pow99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
unpow-199.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 97.3%
if -2 < x < 0.125Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 99.6%
Final simplification98.4%
(FPCore (x y) :precision binary64 (if (or (<= x -1.55e+28) (not (<= x 600.0))) (/ x (- (- x) (+ y -2.0))) (/ (- y x) (- y 2.0))))
double code(double x, double y) {
double tmp;
if ((x <= -1.55e+28) || !(x <= 600.0)) {
tmp = x / (-x - (y + -2.0));
} else {
tmp = (y - x) / (y - 2.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-1.55d+28)) .or. (.not. (x <= 600.0d0))) then
tmp = x / (-x - (y + (-2.0d0)))
else
tmp = (y - x) / (y - 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -1.55e+28) || !(x <= 600.0)) {
tmp = x / (-x - (y + -2.0));
} else {
tmp = (y - x) / (y - 2.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -1.55e+28) or not (x <= 600.0): tmp = x / (-x - (y + -2.0)) else: tmp = (y - x) / (y - 2.0) return tmp
function code(x, y) tmp = 0.0 if ((x <= -1.55e+28) || !(x <= 600.0)) tmp = Float64(x / Float64(Float64(-x) - Float64(y + -2.0))); else tmp = Float64(Float64(y - x) / Float64(y - 2.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -1.55e+28) || ~((x <= 600.0))) tmp = x / (-x - (y + -2.0)); else tmp = (y - x) / (y - 2.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -1.55e+28], N[Not[LessEqual[x, 600.0]], $MachinePrecision]], N[(x / N[((-x) - N[(y + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] / N[(y - 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+28} \lor \neg \left(x \leq 600\right):\\
\;\;\;\;\frac{x}{\left(-x\right) - \left(y + -2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{y - 2}\\
\end{array}
\end{array}
if x < -1.55e28 or 600 < x Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 77.2%
neg-mul-177.2%
Simplified77.2%
if -1.55e28 < x < 600Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 96.5%
Final simplification87.6%
(FPCore (x y) :precision binary64 (if (<= x -7.5e+29) (/ 1.0 (- -1.0 (/ y x))) (if (<= x 330.0) (/ (- y x) (- y 2.0)) (/ x (- 2.0 x)))))
double code(double x, double y) {
double tmp;
if (x <= -7.5e+29) {
tmp = 1.0 / (-1.0 - (y / x));
} else if (x <= 330.0) {
tmp = (y - x) / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-7.5d+29)) then
tmp = 1.0d0 / ((-1.0d0) - (y / x))
else if (x <= 330.0d0) then
tmp = (y - x) / (y - 2.0d0)
else
tmp = x / (2.0d0 - x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -7.5e+29) {
tmp = 1.0 / (-1.0 - (y / x));
} else if (x <= 330.0) {
tmp = (y - x) / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -7.5e+29: tmp = 1.0 / (-1.0 - (y / x)) elif x <= 330.0: tmp = (y - x) / (y - 2.0) else: tmp = x / (2.0 - x) return tmp
function code(x, y) tmp = 0.0 if (x <= -7.5e+29) tmp = Float64(1.0 / Float64(-1.0 - Float64(y / x))); elseif (x <= 330.0) tmp = Float64(Float64(y - x) / Float64(y - 2.0)); else tmp = Float64(x / Float64(2.0 - x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -7.5e+29) tmp = 1.0 / (-1.0 - (y / x)); elseif (x <= 330.0) tmp = (y - x) / (y - 2.0); else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -7.5e+29], N[(1.0 / N[(-1.0 - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 330.0], N[(N[(y - x), $MachinePrecision] / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+29}:\\
\;\;\;\;\frac{1}{-1 - \frac{y}{x}}\\
\mathbf{elif}\;x \leq 330:\\
\;\;\;\;\frac{y - x}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if x < -7.49999999999999945e29Initial program 99.9%
remove-double-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 79.1%
clear-num79.1%
inv-pow79.1%
Applied egg-rr79.1%
unpow-179.1%
Simplified79.1%
Taylor expanded in x around inf 80.0%
sub-neg80.0%
metadata-eval80.0%
+-commutative80.0%
mul-1-neg80.0%
unsub-neg80.0%
Simplified80.0%
if -7.49999999999999945e29 < x < 330Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 96.5%
if 330 < x Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 73.8%
mul-1-neg73.8%
distribute-neg-frac273.8%
neg-sub073.8%
associate-+l-73.8%
neg-sub073.8%
+-commutative73.8%
unsub-neg73.8%
Simplified73.8%
(FPCore (x y) :precision binary64 (if (<= x -1.25e+30) (/ 1.0 (- -1.0 (/ y x))) (if (<= x 340.0) (/ y (- y 2.0)) (/ x (- 2.0 x)))))
double code(double x, double y) {
double tmp;
if (x <= -1.25e+30) {
tmp = 1.0 / (-1.0 - (y / x));
} else if (x <= 340.0) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.25d+30)) then
tmp = 1.0d0 / ((-1.0d0) - (y / x))
else if (x <= 340.0d0) then
tmp = y / (y - 2.0d0)
else
tmp = x / (2.0d0 - x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.25e+30) {
tmp = 1.0 / (-1.0 - (y / x));
} else if (x <= 340.0) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.25e+30: tmp = 1.0 / (-1.0 - (y / x)) elif x <= 340.0: tmp = y / (y - 2.0) else: tmp = x / (2.0 - x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.25e+30) tmp = Float64(1.0 / Float64(-1.0 - Float64(y / x))); elseif (x <= 340.0) tmp = Float64(y / Float64(y - 2.0)); else tmp = Float64(x / Float64(2.0 - x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.25e+30) tmp = 1.0 / (-1.0 - (y / x)); elseif (x <= 340.0) tmp = y / (y - 2.0); else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.25e+30], N[(1.0 / N[(-1.0 - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 340.0], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+30}:\\
\;\;\;\;\frac{1}{-1 - \frac{y}{x}}\\
\mathbf{elif}\;x \leq 340:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if x < -1.25e30Initial program 99.9%
remove-double-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 79.1%
clear-num79.1%
inv-pow79.1%
Applied egg-rr79.1%
unpow-179.1%
Simplified79.1%
Taylor expanded in x around inf 80.0%
sub-neg80.0%
metadata-eval80.0%
+-commutative80.0%
mul-1-neg80.0%
unsub-neg80.0%
Simplified80.0%
if -1.25e30 < x < 340Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 76.8%
if 340 < x Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 73.8%
mul-1-neg73.8%
distribute-neg-frac273.8%
neg-sub073.8%
associate-+l-73.8%
neg-sub073.8%
+-commutative73.8%
unsub-neg73.8%
Simplified73.8%
(FPCore (x y) :precision binary64 (if (<= x -2.1e+32) (+ -1.0 (/ y x)) (if (<= x 550.0) (/ y (- y 2.0)) (/ x (- 2.0 x)))))
double code(double x, double y) {
double tmp;
if (x <= -2.1e+32) {
tmp = -1.0 + (y / x);
} else if (x <= 550.0) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.1d+32)) then
tmp = (-1.0d0) + (y / x)
else if (x <= 550.0d0) then
tmp = y / (y - 2.0d0)
else
tmp = x / (2.0d0 - x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.1e+32) {
tmp = -1.0 + (y / x);
} else if (x <= 550.0) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.1e+32: tmp = -1.0 + (y / x) elif x <= 550.0: tmp = y / (y - 2.0) else: tmp = x / (2.0 - x) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.1e+32) tmp = Float64(-1.0 + Float64(y / x)); elseif (x <= 550.0) tmp = Float64(y / Float64(y - 2.0)); else tmp = Float64(x / Float64(2.0 - x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.1e+32) tmp = -1.0 + (y / x); elseif (x <= 550.0) tmp = y / (y - 2.0); else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.1e+32], N[(-1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 550.0], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+32}:\\
\;\;\;\;-1 + \frac{y}{x}\\
\mathbf{elif}\;x \leq 550:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if x < -2.1000000000000001e32Initial program 99.9%
remove-double-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 79.1%
Taylor expanded in y around 0 79.1%
if -2.1000000000000001e32 < x < 550Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 76.8%
if 550 < x Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 73.8%
mul-1-neg73.8%
distribute-neg-frac273.8%
neg-sub073.8%
associate-+l-73.8%
neg-sub073.8%
+-commutative73.8%
unsub-neg73.8%
Simplified73.8%
Final simplification76.7%
(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%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 37.0%
(FPCore (x y) :precision binary64 (let* ((t_0 (- 2.0 (+ x y)))) (- (/ x t_0) (/ y t_0))))
double code(double x, double y) {
double t_0 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = 2.0d0 - (x + y)
code = (x / t_0) - (y / t_0)
end function
public static double code(double x, double y) {
double t_0 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
def code(x, y): t_0 = 2.0 - (x + y) return (x / t_0) - (y / t_0)
function code(x, y) t_0 = Float64(2.0 - Float64(x + y)) return Float64(Float64(x / t_0) - Float64(y / t_0)) end
function tmp = code(x, y) t_0 = 2.0 - (x + y); tmp = (x / t_0) - (y / t_0); end
code[x_, y_] := Block[{t$95$0 = N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]}, N[(N[(x / t$95$0), $MachinePrecision] - N[(y / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 - \left(x + y\right)\\
\frac{x}{t\_0} - \frac{y}{t\_0}
\end{array}
\end{array}
herbie shell --seed 2024110
(FPCore (x y)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, C"
:precision binary64
:alt
(- (/ x (- 2.0 (+ x y))) (/ y (- 2.0 (+ x y))))
(/ (- x y) (- 2.0 (+ x y))))