
(FPCore (x y z) :precision binary64 (+ (* x y) (* (- 1.0 x) z)))
double code(double x, double y, double z) {
return (x * y) + ((1.0 - x) * z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) + ((1.0d0 - x) * z)
end function
public static double code(double x, double y, double z) {
return (x * y) + ((1.0 - x) * z);
}
def code(x, y, z): return (x * y) + ((1.0 - x) * z)
function code(x, y, z) return Float64(Float64(x * y) + Float64(Float64(1.0 - x) * z)) end
function tmp = code(x, y, z) tmp = (x * y) + ((1.0 - x) * z); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot y + \left(1 - x\right) \cdot z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (* x y) (* (- 1.0 x) z)))
double code(double x, double y, double z) {
return (x * y) + ((1.0 - x) * z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) + ((1.0d0 - x) * z)
end function
public static double code(double x, double y, double z) {
return (x * y) + ((1.0 - x) * z);
}
def code(x, y, z): return (x * y) + ((1.0 - x) * z)
function code(x, y, z) return Float64(Float64(x * y) + Float64(Float64(1.0 - x) * z)) end
function tmp = code(x, y, z) tmp = (x * y) + ((1.0 - x) * z); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot y + \left(1 - x\right) \cdot z
\end{array}
(FPCore (x y z) :precision binary64 (fma x (- y z) z))
double code(double x, double y, double z) {
return fma(x, (y - z), z);
}
function code(x, y, z) return fma(x, Float64(y - z), z) end
code[x_, y_, z_] := N[(x * N[(y - z), $MachinePrecision] + z), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y - z, z\right)
\end{array}
Initial program 98.8%
sub-neg98.8%
+-commutative98.8%
distribute-lft1-in98.8%
associate-+r+98.8%
+-commutative98.8%
*-commutative98.8%
neg-mul-198.8%
associate-*r*98.8%
*-commutative98.8%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
*-commutative100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- x))))
(if (<= x -2.1e+113)
t_0
(if (<= x -1.15e+69)
(* x y)
(if (<= x -780.0)
t_0
(if (<= x 6.3e-58)
z
(if (<= x 1.65e-25)
(* x y)
(if (<= x 2e-8) z (if (<= x 9.5e+232) (* x y) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = z * -x;
double tmp;
if (x <= -2.1e+113) {
tmp = t_0;
} else if (x <= -1.15e+69) {
tmp = x * y;
} else if (x <= -780.0) {
tmp = t_0;
} else if (x <= 6.3e-58) {
tmp = z;
} else if (x <= 1.65e-25) {
tmp = x * y;
} else if (x <= 2e-8) {
tmp = z;
} else if (x <= 9.5e+232) {
tmp = x * y;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * -x
if (x <= (-2.1d+113)) then
tmp = t_0
else if (x <= (-1.15d+69)) then
tmp = x * y
else if (x <= (-780.0d0)) then
tmp = t_0
else if (x <= 6.3d-58) then
tmp = z
else if (x <= 1.65d-25) then
tmp = x * y
else if (x <= 2d-8) then
tmp = z
else if (x <= 9.5d+232) then
tmp = x * y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * -x;
double tmp;
if (x <= -2.1e+113) {
tmp = t_0;
} else if (x <= -1.15e+69) {
tmp = x * y;
} else if (x <= -780.0) {
tmp = t_0;
} else if (x <= 6.3e-58) {
tmp = z;
} else if (x <= 1.65e-25) {
tmp = x * y;
} else if (x <= 2e-8) {
tmp = z;
} else if (x <= 9.5e+232) {
tmp = x * y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * -x tmp = 0 if x <= -2.1e+113: tmp = t_0 elif x <= -1.15e+69: tmp = x * y elif x <= -780.0: tmp = t_0 elif x <= 6.3e-58: tmp = z elif x <= 1.65e-25: tmp = x * y elif x <= 2e-8: tmp = z elif x <= 9.5e+232: tmp = x * y else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-x)) tmp = 0.0 if (x <= -2.1e+113) tmp = t_0; elseif (x <= -1.15e+69) tmp = Float64(x * y); elseif (x <= -780.0) tmp = t_0; elseif (x <= 6.3e-58) tmp = z; elseif (x <= 1.65e-25) tmp = Float64(x * y); elseif (x <= 2e-8) tmp = z; elseif (x <= 9.5e+232) tmp = Float64(x * y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * -x; tmp = 0.0; if (x <= -2.1e+113) tmp = t_0; elseif (x <= -1.15e+69) tmp = x * y; elseif (x <= -780.0) tmp = t_0; elseif (x <= 6.3e-58) tmp = z; elseif (x <= 1.65e-25) tmp = x * y; elseif (x <= 2e-8) tmp = z; elseif (x <= 9.5e+232) tmp = x * y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-x)), $MachinePrecision]}, If[LessEqual[x, -2.1e+113], t$95$0, If[LessEqual[x, -1.15e+69], N[(x * y), $MachinePrecision], If[LessEqual[x, -780.0], t$95$0, If[LessEqual[x, 6.3e-58], z, If[LessEqual[x, 1.65e-25], N[(x * y), $MachinePrecision], If[LessEqual[x, 2e-8], z, If[LessEqual[x, 9.5e+232], N[(x * y), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-x\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+113}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{+69}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -780:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 6.3 \cdot 10^{-58}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-25}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-8}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+232}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -2.0999999999999999e113 or -1.15000000000000008e69 < x < -780 or 9.4999999999999996e232 < x Initial program 97.1%
sub-neg97.1%
+-commutative97.1%
distribute-lft1-in97.0%
associate-+r+97.0%
+-commutative97.0%
*-commutative97.0%
neg-mul-197.0%
associate-*r*97.0%
*-commutative97.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
*-commutative100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around inf 98.9%
Taylor expanded in y around 0 71.6%
mul-1-neg71.6%
distribute-rgt-neg-in71.6%
Simplified71.6%
if -2.0999999999999999e113 < x < -1.15000000000000008e69 or 6.29999999999999999e-58 < x < 1.6499999999999999e-25 or 2e-8 < x < 9.4999999999999996e232Initial program 98.6%
Taylor expanded in y around inf 67.7%
if -780 < x < 6.29999999999999999e-58 or 1.6499999999999999e-25 < x < 2e-8Initial program 100.0%
Taylor expanded in x around 0 76.0%
Final simplification72.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- y z))))
(if (<= x -1.16e-40)
t_0
(if (<= x 3.3e-63)
z
(if (<= x 1.52e-25) (* x y) (if (<= x 0.00039) (* z (- 1.0 x)) t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (y - z);
double tmp;
if (x <= -1.16e-40) {
tmp = t_0;
} else if (x <= 3.3e-63) {
tmp = z;
} else if (x <= 1.52e-25) {
tmp = x * y;
} else if (x <= 0.00039) {
tmp = z * (1.0 - x);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (y - z)
if (x <= (-1.16d-40)) then
tmp = t_0
else if (x <= 3.3d-63) then
tmp = z
else if (x <= 1.52d-25) then
tmp = x * y
else if (x <= 0.00039d0) then
tmp = z * (1.0d0 - x)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y - z);
double tmp;
if (x <= -1.16e-40) {
tmp = t_0;
} else if (x <= 3.3e-63) {
tmp = z;
} else if (x <= 1.52e-25) {
tmp = x * y;
} else if (x <= 0.00039) {
tmp = z * (1.0 - x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y - z) tmp = 0 if x <= -1.16e-40: tmp = t_0 elif x <= 3.3e-63: tmp = z elif x <= 1.52e-25: tmp = x * y elif x <= 0.00039: tmp = z * (1.0 - x) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y - z)) tmp = 0.0 if (x <= -1.16e-40) tmp = t_0; elseif (x <= 3.3e-63) tmp = z; elseif (x <= 1.52e-25) tmp = Float64(x * y); elseif (x <= 0.00039) tmp = Float64(z * Float64(1.0 - x)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y - z); tmp = 0.0; if (x <= -1.16e-40) tmp = t_0; elseif (x <= 3.3e-63) tmp = z; elseif (x <= 1.52e-25) tmp = x * y; elseif (x <= 0.00039) tmp = z * (1.0 - x); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.16e-40], t$95$0, If[LessEqual[x, 3.3e-63], z, If[LessEqual[x, 1.52e-25], N[(x * y), $MachinePrecision], If[LessEqual[x, 0.00039], N[(z * N[(1.0 - x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y - z\right)\\
\mathbf{if}\;x \leq -1.16 \cdot 10^{-40}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-63}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.52 \cdot 10^{-25}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 0.00039:\\
\;\;\;\;z \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.15999999999999991e-40 or 3.89999999999999993e-4 < x Initial program 97.9%
sub-neg97.9%
+-commutative97.9%
distribute-lft1-in97.9%
associate-+r+97.9%
+-commutative97.9%
*-commutative97.9%
neg-mul-197.9%
associate-*r*97.9%
*-commutative97.9%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
*-commutative100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around inf 97.0%
if -1.15999999999999991e-40 < x < 3.29999999999999994e-63Initial program 100.0%
Taylor expanded in x around 0 79.9%
if 3.29999999999999994e-63 < x < 1.52000000000000006e-25Initial program 99.8%
Taylor expanded in y around inf 84.0%
if 1.52000000000000006e-25 < x < 3.89999999999999993e-4Initial program 99.8%
Taylor expanded in y around 0 86.2%
Final simplification89.7%
(FPCore (x y z)
:precision binary64
(if (<= x -2e-37)
(* x y)
(if (<= x 1.22e-57)
z
(if (<= x 1.5e-25) (* x y) (if (<= x 1.06e-6) z (* x y))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2e-37) {
tmp = x * y;
} else if (x <= 1.22e-57) {
tmp = z;
} else if (x <= 1.5e-25) {
tmp = x * y;
} else if (x <= 1.06e-6) {
tmp = z;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2d-37)) then
tmp = x * y
else if (x <= 1.22d-57) then
tmp = z
else if (x <= 1.5d-25) then
tmp = x * y
else if (x <= 1.06d-6) then
tmp = z
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2e-37) {
tmp = x * y;
} else if (x <= 1.22e-57) {
tmp = z;
} else if (x <= 1.5e-25) {
tmp = x * y;
} else if (x <= 1.06e-6) {
tmp = z;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2e-37: tmp = x * y elif x <= 1.22e-57: tmp = z elif x <= 1.5e-25: tmp = x * y elif x <= 1.06e-6: tmp = z else: tmp = x * y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2e-37) tmp = Float64(x * y); elseif (x <= 1.22e-57) tmp = z; elseif (x <= 1.5e-25) tmp = Float64(x * y); elseif (x <= 1.06e-6) tmp = z; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2e-37) tmp = x * y; elseif (x <= 1.22e-57) tmp = z; elseif (x <= 1.5e-25) tmp = x * y; elseif (x <= 1.06e-6) tmp = z; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2e-37], N[(x * y), $MachinePrecision], If[LessEqual[x, 1.22e-57], z, If[LessEqual[x, 1.5e-25], N[(x * y), $MachinePrecision], If[LessEqual[x, 1.06e-6], z, N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-37}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-57}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-25}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{-6}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -2.00000000000000013e-37 or 1.2200000000000001e-57 < x < 1.4999999999999999e-25 or 1.06e-6 < x Initial program 98.0%
Taylor expanded in y around inf 52.8%
if -2.00000000000000013e-37 < x < 1.2200000000000001e-57 or 1.4999999999999999e-25 < x < 1.06e-6Initial program 100.0%
Taylor expanded in x around 0 79.7%
Final simplification64.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -1e-107) (not (<= z 5.2e-6))) (* z (- 1.0 x)) (* x y)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1e-107) || !(z <= 5.2e-6)) {
tmp = z * (1.0 - x);
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1d-107)) .or. (.not. (z <= 5.2d-6))) then
tmp = z * (1.0d0 - x)
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1e-107) || !(z <= 5.2e-6)) {
tmp = z * (1.0 - x);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1e-107) or not (z <= 5.2e-6): tmp = z * (1.0 - x) else: tmp = x * y return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1e-107) || !(z <= 5.2e-6)) tmp = Float64(z * Float64(1.0 - x)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1e-107) || ~((z <= 5.2e-6))) tmp = z * (1.0 - x); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1e-107], N[Not[LessEqual[z, 5.2e-6]], $MachinePrecision]], N[(z * N[(1.0 - x), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-107} \lor \neg \left(z \leq 5.2 \cdot 10^{-6}\right):\\
\;\;\;\;z \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1e-107 or 5.20000000000000019e-6 < z Initial program 98.1%
Taylor expanded in y around 0 87.5%
if -1e-107 < z < 5.20000000000000019e-6Initial program 100.0%
Taylor expanded in y around inf 75.9%
Final simplification83.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -780.0) (not (<= x 0.038))) (* x (- y z)) (+ z (* x y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -780.0) || !(x <= 0.038)) {
tmp = x * (y - z);
} else {
tmp = z + (x * y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-780.0d0)) .or. (.not. (x <= 0.038d0))) then
tmp = x * (y - z)
else
tmp = z + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -780.0) || !(x <= 0.038)) {
tmp = x * (y - z);
} else {
tmp = z + (x * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -780.0) or not (x <= 0.038): tmp = x * (y - z) else: tmp = z + (x * y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -780.0) || !(x <= 0.038)) tmp = Float64(x * Float64(y - z)); else tmp = Float64(z + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -780.0) || ~((x <= 0.038))) tmp = x * (y - z); else tmp = z + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -780.0], N[Not[LessEqual[x, 0.038]], $MachinePrecision]], N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision], N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -780 \lor \neg \left(x \leq 0.038\right):\\
\;\;\;\;x \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;z + x \cdot y\\
\end{array}
\end{array}
if x < -780 or 0.0379999999999999991 < x Initial program 97.7%
sub-neg97.7%
+-commutative97.7%
distribute-lft1-in97.7%
associate-+r+97.7%
+-commutative97.7%
*-commutative97.7%
neg-mul-197.7%
associate-*r*97.7%
*-commutative97.7%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
*-commutative100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around inf 98.8%
if -780 < x < 0.0379999999999999991Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
distribute-lft1-in100.0%
associate-+r+100.0%
+-commutative100.0%
*-commutative100.0%
neg-mul-1100.0%
associate-*r*100.0%
*-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
*-commutative100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
*-commutative100.0%
flip--53.9%
associate-*r/53.8%
Applied egg-rr53.8%
*-commutative53.8%
associate-/l*51.9%
+-commutative51.9%
Simplified51.9%
Taylor expanded in y around inf 98.4%
Final simplification98.6%
(FPCore (x y z) :precision binary64 (+ z (* x (- y z))))
double code(double x, double y, double z) {
return z + (x * (y - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z + (x * (y - z))
end function
public static double code(double x, double y, double z) {
return z + (x * (y - z));
}
def code(x, y, z): return z + (x * (y - z))
function code(x, y, z) return Float64(z + Float64(x * Float64(y - z))) end
function tmp = code(x, y, z) tmp = z + (x * (y - z)); end
code[x_, y_, z_] := N[(z + N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z + x \cdot \left(y - z\right)
\end{array}
Initial program 98.8%
sub-neg98.8%
+-commutative98.8%
distribute-lft1-in98.8%
associate-+r+98.8%
+-commutative98.8%
*-commutative98.8%
neg-mul-198.8%
associate-*r*98.8%
*-commutative98.8%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
*-commutative100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 z)
double code(double x, double y, double z) {
return z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z
end function
public static double code(double x, double y, double z) {
return z;
}
def code(x, y, z): return z
function code(x, y, z) return z end
function tmp = code(x, y, z) tmp = z; end
code[x_, y_, z_] := z
\begin{array}{l}
\\
z
\end{array}
Initial program 98.8%
Taylor expanded in x around 0 36.2%
Final simplification36.2%
herbie shell --seed 2023252
(FPCore (x y z)
:name "Diagrams.Backend.Rasterific:$crender from diagrams-rasterific-1.3.1.3"
:precision binary64
(+ (* x y) (* (- 1.0 x) z)))