
(FPCore (x y) :precision binary64 (+ x (* (- 1.0 x) (- 1.0 y))))
double code(double x, double y) {
return x + ((1.0 - x) * (1.0 - y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + ((1.0d0 - x) * (1.0d0 - y))
end function
public static double code(double x, double y) {
return x + ((1.0 - x) * (1.0 - y));
}
def code(x, y): return x + ((1.0 - x) * (1.0 - y))
function code(x, y) return Float64(x + Float64(Float64(1.0 - x) * Float64(1.0 - y))) end
function tmp = code(x, y) tmp = x + ((1.0 - x) * (1.0 - y)); end
code[x_, y_] := N[(x + N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(1 - x\right) \cdot \left(1 - y\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ x (* (- 1.0 x) (- 1.0 y))))
double code(double x, double y) {
return x + ((1.0 - x) * (1.0 - y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + ((1.0d0 - x) * (1.0d0 - y))
end function
public static double code(double x, double y) {
return x + ((1.0 - x) * (1.0 - y));
}
def code(x, y): return x + ((1.0 - x) * (1.0 - y))
function code(x, y) return Float64(x + Float64(Float64(1.0 - x) * Float64(1.0 - y))) end
function tmp = code(x, y) tmp = x + ((1.0 - x) * (1.0 - y)); end
code[x_, y_] := N[(x + N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(1 - x\right) \cdot \left(1 - y\right)
\end{array}
(FPCore (x y) :precision binary64 (+ 1.0 (* y (+ x -1.0))))
double code(double x, double y) {
return 1.0 + (y * (x + -1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + (y * (x + (-1.0d0)))
end function
public static double code(double x, double y) {
return 1.0 + (y * (x + -1.0));
}
def code(x, y): return 1.0 + (y * (x + -1.0))
function code(x, y) return Float64(1.0 + Float64(y * Float64(x + -1.0))) end
function tmp = code(x, y) tmp = 1.0 + (y * (x + -1.0)); end
code[x_, y_] := N[(1.0 + N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y \cdot \left(x + -1\right)
\end{array}
Initial program 74.3%
+-commutative74.3%
remove-double-neg74.3%
unsub-neg74.3%
sub-neg74.3%
+-commutative74.3%
distribute-rgt-in74.3%
*-lft-identity74.3%
associate--l+86.7%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
(FPCore (x y)
:precision binary64
(if (<= x -3.15e+125)
(* y x)
(if (or (<= x -2.5e+61) (and (not (<= x -15600.0)) (<= x 23500.0)))
(- 1.0 y)
(* y (+ x -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -3.15e+125) {
tmp = y * x;
} else if ((x <= -2.5e+61) || (!(x <= -15600.0) && (x <= 23500.0))) {
tmp = 1.0 - y;
} else {
tmp = y * (x + -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.15d+125)) then
tmp = y * x
else if ((x <= (-2.5d+61)) .or. (.not. (x <= (-15600.0d0))) .and. (x <= 23500.0d0)) then
tmp = 1.0d0 - y
else
tmp = y * (x + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.15e+125) {
tmp = y * x;
} else if ((x <= -2.5e+61) || (!(x <= -15600.0) && (x <= 23500.0))) {
tmp = 1.0 - y;
} else {
tmp = y * (x + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.15e+125: tmp = y * x elif (x <= -2.5e+61) or (not (x <= -15600.0) and (x <= 23500.0)): tmp = 1.0 - y else: tmp = y * (x + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.15e+125) tmp = Float64(y * x); elseif ((x <= -2.5e+61) || (!(x <= -15600.0) && (x <= 23500.0))) tmp = Float64(1.0 - y); else tmp = Float64(y * Float64(x + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.15e+125) tmp = y * x; elseif ((x <= -2.5e+61) || (~((x <= -15600.0)) && (x <= 23500.0))) tmp = 1.0 - y; else tmp = y * (x + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.15e+125], N[(y * x), $MachinePrecision], If[Or[LessEqual[x, -2.5e+61], And[N[Not[LessEqual[x, -15600.0]], $MachinePrecision], LessEqual[x, 23500.0]]], N[(1.0 - y), $MachinePrecision], N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.15 \cdot 10^{+125}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{+61} \lor \neg \left(x \leq -15600\right) \land x \leq 23500:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x + -1\right)\\
\end{array}
\end{array}
if x < -3.1500000000000001e125Initial program 45.9%
+-commutative45.9%
remove-double-neg45.9%
unsub-neg45.9%
sub-neg45.9%
+-commutative45.9%
distribute-rgt-in45.9%
*-lft-identity45.9%
associate--l+84.5%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
distribute-lft-in100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around inf 84.5%
*-commutative84.5%
Simplified84.5%
if -3.1500000000000001e125 < x < -2.50000000000000009e61 or -15600 < x < 23500Initial program 89.9%
+-commutative89.9%
remove-double-neg89.9%
unsub-neg89.9%
sub-neg89.9%
+-commutative89.9%
distribute-rgt-in89.9%
*-lft-identity89.9%
associate--l+89.8%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 96.6%
neg-mul-196.6%
unsub-neg96.6%
Simplified96.6%
if -2.50000000000000009e61 < x < -15600 or 23500 < x Initial program 62.1%
+-commutative62.1%
remove-double-neg62.1%
unsub-neg62.1%
sub-neg62.1%
+-commutative62.1%
distribute-rgt-in62.1%
*-lft-identity62.1%
associate--l+82.6%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
distribute-lft-in99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in y around inf 82.6%
Final simplification90.2%
(FPCore (x y)
:precision binary64
(if (or (<= x -3.3e+125)
(and (not (<= x -3.2e+59))
(or (<= x -98000000.0) (not (<= x 68000.0)))))
(* y x)
(- 1.0 y)))
double code(double x, double y) {
double tmp;
if ((x <= -3.3e+125) || (!(x <= -3.2e+59) && ((x <= -98000000.0) || !(x <= 68000.0)))) {
tmp = y * x;
} else {
tmp = 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 <= (-3.3d+125)) .or. (.not. (x <= (-3.2d+59))) .and. (x <= (-98000000.0d0)) .or. (.not. (x <= 68000.0d0))) then
tmp = y * x
else
tmp = 1.0d0 - y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -3.3e+125) || (!(x <= -3.2e+59) && ((x <= -98000000.0) || !(x <= 68000.0)))) {
tmp = y * x;
} else {
tmp = 1.0 - y;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -3.3e+125) or (not (x <= -3.2e+59) and ((x <= -98000000.0) or not (x <= 68000.0))): tmp = y * x else: tmp = 1.0 - y return tmp
function code(x, y) tmp = 0.0 if ((x <= -3.3e+125) || (!(x <= -3.2e+59) && ((x <= -98000000.0) || !(x <= 68000.0)))) tmp = Float64(y * x); else tmp = Float64(1.0 - y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -3.3e+125) || (~((x <= -3.2e+59)) && ((x <= -98000000.0) || ~((x <= 68000.0))))) tmp = y * x; else tmp = 1.0 - y; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -3.3e+125], And[N[Not[LessEqual[x, -3.2e+59]], $MachinePrecision], Or[LessEqual[x, -98000000.0], N[Not[LessEqual[x, 68000.0]], $MachinePrecision]]]], N[(y * x), $MachinePrecision], N[(1.0 - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{+125} \lor \neg \left(x \leq -3.2 \cdot 10^{+59}\right) \land \left(x \leq -98000000 \lor \neg \left(x \leq 68000\right)\right):\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 - y\\
\end{array}
\end{array}
if x < -3.30000000000000005e125 or -3.19999999999999982e59 < x < -9.8e7 or 68000 < x Initial program 57.3%
+-commutative57.3%
remove-double-neg57.3%
unsub-neg57.3%
sub-neg57.3%
+-commutative57.3%
distribute-rgt-in57.3%
*-lft-identity57.3%
associate--l+83.2%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
distribute-lft-in100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around inf 81.6%
*-commutative81.6%
Simplified81.6%
if -3.30000000000000005e125 < x < -3.19999999999999982e59 or -9.8e7 < x < 68000Initial program 89.9%
+-commutative89.9%
remove-double-neg89.9%
unsub-neg89.9%
sub-neg89.9%
+-commutative89.9%
distribute-rgt-in89.9%
*-lft-identity89.9%
associate--l+89.8%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 96.6%
neg-mul-196.6%
unsub-neg96.6%
Simplified96.6%
Final simplification89.5%
(FPCore (x y) :precision binary64 (if (or (<= x -900.0) (not (<= x 0.76))) (+ 1.0 (* y x)) (- 1.0 y)))
double code(double x, double y) {
double tmp;
if ((x <= -900.0) || !(x <= 0.76)) {
tmp = 1.0 + (y * x);
} else {
tmp = 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 <= (-900.0d0)) .or. (.not. (x <= 0.76d0))) then
tmp = 1.0d0 + (y * x)
else
tmp = 1.0d0 - y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -900.0) || !(x <= 0.76)) {
tmp = 1.0 + (y * x);
} else {
tmp = 1.0 - y;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -900.0) or not (x <= 0.76): tmp = 1.0 + (y * x) else: tmp = 1.0 - y return tmp
function code(x, y) tmp = 0.0 if ((x <= -900.0) || !(x <= 0.76)) tmp = Float64(1.0 + Float64(y * x)); else tmp = Float64(1.0 - y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -900.0) || ~((x <= 0.76))) tmp = 1.0 + (y * x); else tmp = 1.0 - y; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -900.0], N[Not[LessEqual[x, 0.76]], $MachinePrecision]], N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision], N[(1.0 - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -900 \lor \neg \left(x \leq 0.76\right):\\
\;\;\;\;1 + y \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 - y\\
\end{array}
\end{array}
if x < -900 or 0.76000000000000001 < x Initial program 53.4%
+-commutative53.4%
remove-double-neg53.4%
unsub-neg53.4%
sub-neg53.4%
+-commutative53.4%
distribute-rgt-in53.4%
*-lft-identity53.4%
associate--l+75.8%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 98.6%
*-commutative98.6%
Simplified98.6%
if -900 < x < 0.76000000000000001Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
*-lft-identity100.0%
associate--l+100.0%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 99.4%
neg-mul-199.4%
unsub-neg99.4%
Simplified99.4%
Final simplification99.0%
(FPCore (x y) :precision binary64 (if (or (<= y -5.2e-59) (not (<= y 1.95e-11))) (* y x) 1.0))
double code(double x, double y) {
double tmp;
if ((y <= -5.2e-59) || !(y <= 1.95e-11)) {
tmp = y * 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 <= (-5.2d-59)) .or. (.not. (y <= 1.95d-11))) then
tmp = y * x
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -5.2e-59) || !(y <= 1.95e-11)) {
tmp = y * x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -5.2e-59) or not (y <= 1.95e-11): tmp = y * x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if ((y <= -5.2e-59) || !(y <= 1.95e-11)) tmp = Float64(y * x); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -5.2e-59) || ~((y <= 1.95e-11))) tmp = y * x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -5.2e-59], N[Not[LessEqual[y, 1.95e-11]], $MachinePrecision]], N[(y * x), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-59} \lor \neg \left(y \leq 1.95 \cdot 10^{-11}\right):\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -5.19999999999999996e-59 or 1.95000000000000005e-11 < y Initial program 96.5%
+-commutative96.5%
remove-double-neg96.5%
unsub-neg96.5%
sub-neg96.5%
+-commutative96.5%
distribute-rgt-in96.5%
*-lft-identity96.5%
associate--l+100.0%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
distribute-lft-in100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around inf 59.8%
*-commutative59.8%
Simplified59.8%
if -5.19999999999999996e-59 < y < 1.95000000000000005e-11Initial program 52.2%
+-commutative52.2%
remove-double-neg52.2%
unsub-neg52.2%
sub-neg52.2%
+-commutative52.2%
distribute-rgt-in52.2%
*-lft-identity52.2%
associate--l+73.4%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 76.9%
Final simplification68.3%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 1.0))) (- y) 1.0))
double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 1.0)) {
tmp = -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)) .or. (.not. (y <= 1.0d0))) then
tmp = -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) || !(y <= 1.0)) {
tmp = -y;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.0) or not (y <= 1.0): tmp = -y else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.0) || !(y <= 1.0)) tmp = Float64(-y); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.0) || ~((y <= 1.0))) tmp = -y; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], (-y), 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
*-lft-identity100.0%
associate--l+100.0%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
distribute-lft-in100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in y around inf 97.3%
Taylor expanded in x around 0 38.4%
mul-1-neg38.4%
Simplified38.4%
if -1 < y < 1Initial program 52.4%
+-commutative52.4%
remove-double-neg52.4%
unsub-neg52.4%
sub-neg52.4%
+-commutative52.4%
distribute-rgt-in52.4%
*-lft-identity52.4%
associate--l+75.3%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 73.4%
Final simplification57.3%
(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 74.3%
+-commutative74.3%
remove-double-neg74.3%
unsub-neg74.3%
sub-neg74.3%
+-commutative74.3%
distribute-rgt-in74.3%
*-lft-identity74.3%
associate--l+86.7%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 40.9%
(FPCore (x y) :precision binary64 (- (* y x) (- y 1.0)))
double code(double x, double y) {
return (y * x) - (y - 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y * x) - (y - 1.0d0)
end function
public static double code(double x, double y) {
return (y * x) - (y - 1.0);
}
def code(x, y): return (y * x) - (y - 1.0)
function code(x, y) return Float64(Float64(y * x) - Float64(y - 1.0)) end
function tmp = code(x, y) tmp = (y * x) - (y - 1.0); end
code[x_, y_] := N[(N[(y * x), $MachinePrecision] - N[(y - 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot x - \left(y - 1\right)
\end{array}
herbie shell --seed 2024145
(FPCore (x y)
:name "Graphics.Rendering.Chart.Plot.Vectors:renderPlotVectors from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- (* y x) (- y 1)))
(+ x (* (- 1.0 x) (- 1.0 y))))