
(FPCore (x y z) :precision binary64 (+ (* (- 1.0 x) y) (* x z)))
double code(double x, double y, double z) {
return ((1.0 - x) * y) + (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 = ((1.0d0 - x) * y) + (x * z)
end function
public static double code(double x, double y, double z) {
return ((1.0 - x) * y) + (x * z);
}
def code(x, y, z): return ((1.0 - x) * y) + (x * z)
function code(x, y, z) return Float64(Float64(Float64(1.0 - x) * y) + Float64(x * z)) end
function tmp = code(x, y, z) tmp = ((1.0 - x) * y) + (x * z); end
code[x_, y_, z_] := N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) \cdot y + x \cdot z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (* (- 1.0 x) y) (* x z)))
double code(double x, double y, double z) {
return ((1.0 - x) * y) + (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 = ((1.0d0 - x) * y) + (x * z)
end function
public static double code(double x, double y, double z) {
return ((1.0 - x) * y) + (x * z);
}
def code(x, y, z): return ((1.0 - x) * y) + (x * z)
function code(x, y, z) return Float64(Float64(Float64(1.0 - x) * y) + Float64(x * z)) end
function tmp = code(x, y, z) tmp = ((1.0 - x) * y) + (x * z); end
code[x_, y_, z_] := N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) \cdot y + x \cdot z
\end{array}
(FPCore (x y z) :precision binary64 (fma x (- z y) y))
double code(double x, double y, double z) {
return fma(x, (z - y), y);
}
function code(x, y, z) return fma(x, Float64(z - y), y) end
code[x_, y_, z_] := N[(x * N[(z - y), $MachinePrecision] + y), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, z - y, y\right)
\end{array}
Initial program 98.8%
*-commutative98.8%
distribute-lft-out--98.8%
*-rgt-identity98.8%
cancel-sign-sub-inv98.8%
associate-+l+98.8%
+-commutative98.8%
*-commutative98.8%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- y))))
(if (<= z -3.3e-64)
(* x z)
(if (<= z -1e-196)
y
(if (<= z -1.1e-237)
t_0
(if (<= z -1.9e-289)
y
(if (<= z 5e-259)
t_0
(if (<= z 2.7e-184)
y
(if (<= z 7.4e-83) t_0 (if (<= z 70000.0) y (* x z)))))))))))
double code(double x, double y, double z) {
double t_0 = x * -y;
double tmp;
if (z <= -3.3e-64) {
tmp = x * z;
} else if (z <= -1e-196) {
tmp = y;
} else if (z <= -1.1e-237) {
tmp = t_0;
} else if (z <= -1.9e-289) {
tmp = y;
} else if (z <= 5e-259) {
tmp = t_0;
} else if (z <= 2.7e-184) {
tmp = y;
} else if (z <= 7.4e-83) {
tmp = t_0;
} else if (z <= 70000.0) {
tmp = y;
} else {
tmp = x * z;
}
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
if (z <= (-3.3d-64)) then
tmp = x * z
else if (z <= (-1d-196)) then
tmp = y
else if (z <= (-1.1d-237)) then
tmp = t_0
else if (z <= (-1.9d-289)) then
tmp = y
else if (z <= 5d-259) then
tmp = t_0
else if (z <= 2.7d-184) then
tmp = y
else if (z <= 7.4d-83) then
tmp = t_0
else if (z <= 70000.0d0) then
tmp = y
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * -y;
double tmp;
if (z <= -3.3e-64) {
tmp = x * z;
} else if (z <= -1e-196) {
tmp = y;
} else if (z <= -1.1e-237) {
tmp = t_0;
} else if (z <= -1.9e-289) {
tmp = y;
} else if (z <= 5e-259) {
tmp = t_0;
} else if (z <= 2.7e-184) {
tmp = y;
} else if (z <= 7.4e-83) {
tmp = t_0;
} else if (z <= 70000.0) {
tmp = y;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z): t_0 = x * -y tmp = 0 if z <= -3.3e-64: tmp = x * z elif z <= -1e-196: tmp = y elif z <= -1.1e-237: tmp = t_0 elif z <= -1.9e-289: tmp = y elif z <= 5e-259: tmp = t_0 elif z <= 2.7e-184: tmp = y elif z <= 7.4e-83: tmp = t_0 elif z <= 70000.0: tmp = y else: tmp = x * z return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-y)) tmp = 0.0 if (z <= -3.3e-64) tmp = Float64(x * z); elseif (z <= -1e-196) tmp = y; elseif (z <= -1.1e-237) tmp = t_0; elseif (z <= -1.9e-289) tmp = y; elseif (z <= 5e-259) tmp = t_0; elseif (z <= 2.7e-184) tmp = y; elseif (z <= 7.4e-83) tmp = t_0; elseif (z <= 70000.0) tmp = y; else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * -y; tmp = 0.0; if (z <= -3.3e-64) tmp = x * z; elseif (z <= -1e-196) tmp = y; elseif (z <= -1.1e-237) tmp = t_0; elseif (z <= -1.9e-289) tmp = y; elseif (z <= 5e-259) tmp = t_0; elseif (z <= 2.7e-184) tmp = y; elseif (z <= 7.4e-83) tmp = t_0; elseif (z <= 70000.0) tmp = y; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[z, -3.3e-64], N[(x * z), $MachinePrecision], If[LessEqual[z, -1e-196], y, If[LessEqual[z, -1.1e-237], t$95$0, If[LessEqual[z, -1.9e-289], y, If[LessEqual[z, 5e-259], t$95$0, If[LessEqual[z, 2.7e-184], y, If[LessEqual[z, 7.4e-83], t$95$0, If[LessEqual[z, 70000.0], y, N[(x * z), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{-64}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-196}:\\
\;\;\;\;y\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-237}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-289}:\\
\;\;\;\;y\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-259}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-184}:\\
\;\;\;\;y\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-83}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 70000:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -3.2999999999999999e-64 or 7e4 < z Initial program 97.6%
remove-double-neg97.6%
distribute-rgt-neg-out97.6%
neg-sub097.6%
neg-sub097.6%
*-commutative97.6%
distribute-lft-neg-in97.6%
remove-double-neg97.6%
distribute-rgt-out--97.6%
*-lft-identity97.6%
associate-+l-97.6%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in y around 0 72.5%
if -3.2999999999999999e-64 < z < -1e-196 or -1.09999999999999999e-237 < z < -1.90000000000000005e-289 or 4.99999999999999977e-259 < z < 2.7000000000000001e-184 or 7.39999999999999989e-83 < z < 7e4Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
neg-sub099.9%
neg-sub099.9%
*-commutative99.9%
distribute-lft-neg-in99.9%
remove-double-neg99.9%
distribute-rgt-out--100.0%
*-lft-identity100.0%
associate-+l-100.0%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in x around 0 61.0%
if -1e-196 < z < -1.09999999999999999e-237 or -1.90000000000000005e-289 < z < 4.99999999999999977e-259 or 2.7000000000000001e-184 < z < 7.39999999999999989e-83Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
neg-sub099.9%
neg-sub099.9%
*-commutative99.9%
distribute-lft-neg-in99.9%
remove-double-neg99.9%
distribute-rgt-out--99.9%
*-lft-identity99.9%
associate-+l-99.9%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in x around inf 77.1%
Taylor expanded in z around 0 68.2%
mul-1-neg68.2%
*-commutative68.2%
distribute-rgt-neg-in68.2%
Simplified68.2%
Final simplification68.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- z y))))
(if (<= x -4.6e-92)
t_0
(if (<= x 9.4e-176)
y
(if (<= x 6.4e-153) (* x z) (if (<= x 9.5e-85) y t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (z - y);
double tmp;
if (x <= -4.6e-92) {
tmp = t_0;
} else if (x <= 9.4e-176) {
tmp = y;
} else if (x <= 6.4e-153) {
tmp = x * z;
} else if (x <= 9.5e-85) {
tmp = 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 = x * (z - y)
if (x <= (-4.6d-92)) then
tmp = t_0
else if (x <= 9.4d-176) then
tmp = y
else if (x <= 6.4d-153) then
tmp = x * z
else if (x <= 9.5d-85) then
tmp = y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (z - y);
double tmp;
if (x <= -4.6e-92) {
tmp = t_0;
} else if (x <= 9.4e-176) {
tmp = y;
} else if (x <= 6.4e-153) {
tmp = x * z;
} else if (x <= 9.5e-85) {
tmp = y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z - y) tmp = 0 if x <= -4.6e-92: tmp = t_0 elif x <= 9.4e-176: tmp = y elif x <= 6.4e-153: tmp = x * z elif x <= 9.5e-85: tmp = y else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z - y)) tmp = 0.0 if (x <= -4.6e-92) tmp = t_0; elseif (x <= 9.4e-176) tmp = y; elseif (x <= 6.4e-153) tmp = Float64(x * z); elseif (x <= 9.5e-85) tmp = y; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z - y); tmp = 0.0; if (x <= -4.6e-92) tmp = t_0; elseif (x <= 9.4e-176) tmp = y; elseif (x <= 6.4e-153) tmp = x * z; elseif (x <= 9.5e-85) tmp = y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.6e-92], t$95$0, If[LessEqual[x, 9.4e-176], y, If[LessEqual[x, 6.4e-153], N[(x * z), $MachinePrecision], If[LessEqual[x, 9.5e-85], y, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z - y\right)\\
\mathbf{if}\;x \leq -4.6 \cdot 10^{-92}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 9.4 \cdot 10^{-176}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 6.4 \cdot 10^{-153}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-85}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -4.60000000000000032e-92 or 9.49999999999999964e-85 < x Initial program 98.2%
remove-double-neg98.2%
distribute-rgt-neg-out98.2%
neg-sub098.2%
neg-sub098.2%
*-commutative98.2%
distribute-lft-neg-in98.2%
remove-double-neg98.2%
distribute-rgt-out--98.2%
*-lft-identity98.2%
associate-+l-98.2%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in x around inf 91.4%
if -4.60000000000000032e-92 < x < 9.39999999999999968e-176 or 6.3999999999999998e-153 < x < 9.49999999999999964e-85Initial program 100.0%
remove-double-neg100.0%
distribute-rgt-neg-out100.0%
neg-sub0100.0%
neg-sub0100.0%
*-commutative100.0%
distribute-lft-neg-in100.0%
remove-double-neg100.0%
distribute-rgt-out--100.0%
*-lft-identity100.0%
associate-+l-100.0%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in x around 0 79.9%
if 9.39999999999999968e-176 < x < 6.3999999999999998e-153Initial program 99.7%
remove-double-neg99.7%
distribute-rgt-neg-out99.7%
neg-sub099.7%
neg-sub099.7%
*-commutative99.7%
distribute-lft-neg-in99.7%
remove-double-neg99.7%
distribute-rgt-out--99.7%
*-lft-identity99.7%
associate-+l-99.7%
distribute-lft-out--99.7%
Simplified99.7%
Taylor expanded in y around 0 98.7%
Final simplification87.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -7e+14) (not (<= x 1.0))) (* x (- z y)) (+ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -7e+14) || !(x <= 1.0)) {
tmp = x * (z - y);
} else {
tmp = y + (x * z);
}
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 <= (-7d+14)) .or. (.not. (x <= 1.0d0))) then
tmp = x * (z - y)
else
tmp = y + (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -7e+14) || !(x <= 1.0)) {
tmp = x * (z - y);
} else {
tmp = y + (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -7e+14) or not (x <= 1.0): tmp = x * (z - y) else: tmp = y + (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -7e+14) || !(x <= 1.0)) tmp = Float64(x * Float64(z - y)); else tmp = Float64(y + Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -7e+14) || ~((x <= 1.0))) tmp = x * (z - y); else tmp = y + (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -7e+14], N[Not[LessEqual[x, 1.0]], $MachinePrecision]], N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision], N[(y + N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+14} \lor \neg \left(x \leq 1\right):\\
\;\;\;\;x \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;y + x \cdot z\\
\end{array}
\end{array}
if x < -7e14 or 1 < x Initial program 97.7%
remove-double-neg97.7%
distribute-rgt-neg-out97.7%
neg-sub097.7%
neg-sub097.7%
*-commutative97.7%
distribute-lft-neg-in97.7%
remove-double-neg97.7%
distribute-rgt-out--97.7%
*-lft-identity97.7%
associate-+l-97.7%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in x around inf 99.2%
if -7e14 < x < 1Initial program 100.0%
remove-double-neg100.0%
distribute-rgt-neg-out100.0%
neg-sub0100.0%
neg-sub0100.0%
*-commutative100.0%
distribute-lft-neg-in100.0%
remove-double-neg100.0%
distribute-rgt-out--100.0%
*-lft-identity100.0%
associate-+l-100.0%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in y around 0 98.8%
mul-1-neg98.8%
distribute-rgt-neg-out98.8%
Simplified98.8%
sub-neg98.8%
+-commutative98.8%
distribute-rgt-neg-out98.8%
remove-double-neg98.8%
Applied egg-rr98.8%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -3.3e-64) (not (<= z 57000.0))) (* x z) y))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.3e-64) || !(z <= 57000.0)) {
tmp = x * z;
} else {
tmp = 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 <= (-3.3d-64)) .or. (.not. (z <= 57000.0d0))) then
tmp = x * z
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3.3e-64) || !(z <= 57000.0)) {
tmp = x * z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.3e-64) or not (z <= 57000.0): tmp = x * z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.3e-64) || !(z <= 57000.0)) tmp = Float64(x * z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.3e-64) || ~((z <= 57000.0))) tmp = x * z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.3e-64], N[Not[LessEqual[z, 57000.0]], $MachinePrecision]], N[(x * z), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-64} \lor \neg \left(z \leq 57000\right):\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if z < -3.2999999999999999e-64 or 57000 < z Initial program 97.6%
remove-double-neg97.6%
distribute-rgt-neg-out97.6%
neg-sub097.6%
neg-sub097.6%
*-commutative97.6%
distribute-lft-neg-in97.6%
remove-double-neg97.6%
distribute-rgt-out--97.6%
*-lft-identity97.6%
associate-+l-97.6%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in y around 0 72.5%
if -3.2999999999999999e-64 < z < 57000Initial program 99.9%
remove-double-neg99.9%
distribute-rgt-neg-out99.9%
neg-sub099.9%
neg-sub099.9%
*-commutative99.9%
distribute-lft-neg-in99.9%
remove-double-neg99.9%
distribute-rgt-out--100.0%
*-lft-identity100.0%
associate-+l-100.0%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in x around 0 44.7%
Final simplification58.6%
(FPCore (x y z) :precision binary64 (+ y (* x (- z y))))
double code(double x, double y, double z) {
return y + (x * (z - y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y + (x * (z - y))
end function
public static double code(double x, double y, double z) {
return y + (x * (z - y));
}
def code(x, y, z): return y + (x * (z - y))
function code(x, y, z) return Float64(y + Float64(x * Float64(z - y))) end
function tmp = code(x, y, z) tmp = y + (x * (z - y)); end
code[x_, y_, z_] := N[(y + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + x \cdot \left(z - y\right)
\end{array}
Initial program 98.8%
remove-double-neg98.8%
distribute-rgt-neg-out98.8%
neg-sub098.8%
neg-sub098.8%
*-commutative98.8%
distribute-lft-neg-in98.8%
remove-double-neg98.8%
distribute-rgt-out--98.8%
*-lft-identity98.8%
associate-+l-98.8%
distribute-lft-out--100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 y)
double code(double x, double y, double z) {
return y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y
end function
public static double code(double x, double y, double z) {
return y;
}
def code(x, y, z): return y
function code(x, y, z) return y end
function tmp = code(x, y, z) tmp = y; end
code[x_, y_, z_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 98.8%
remove-double-neg98.8%
distribute-rgt-neg-out98.8%
neg-sub098.8%
neg-sub098.8%
*-commutative98.8%
distribute-lft-neg-in98.8%
remove-double-neg98.8%
distribute-rgt-out--98.8%
*-lft-identity98.8%
associate-+l-98.8%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in x around 0 32.9%
Final simplification32.9%
(FPCore (x y z) :precision binary64 (- y (* x (- y z))))
double code(double x, double y, double z) {
return y - (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 = y - (x * (y - z))
end function
public static double code(double x, double y, double z) {
return y - (x * (y - z));
}
def code(x, y, z): return y - (x * (y - z))
function code(x, y, z) return Float64(y - Float64(x * Float64(y - z))) end
function tmp = code(x, y, z) tmp = y - (x * (y - z)); end
code[x_, y_, z_] := N[(y - N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y - x \cdot \left(y - z\right)
\end{array}
herbie shell --seed 2024019
(FPCore (x y z)
:name "Diagrams.Color.HSV:lerp from diagrams-contrib-1.3.0.5"
:precision binary64
:herbie-target
(- y (* x (- y z)))
(+ (* (- 1.0 x) y) (* x z)))