
(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 6 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 (+ 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 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%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (- x))))
(if (<= x -1.52e+60)
t_0
(if (<= x -1.25e-46)
(* x z)
(if (<= x 9.6e-95)
y
(if (or (<= x 1.2e+24) (and (not (<= x 3.1e+68)) (<= x 2.1e+150)))
(* x z)
t_0))))))
double code(double x, double y, double z) {
double t_0 = y * -x;
double tmp;
if (x <= -1.52e+60) {
tmp = t_0;
} else if (x <= -1.25e-46) {
tmp = x * z;
} else if (x <= 9.6e-95) {
tmp = y;
} else if ((x <= 1.2e+24) || (!(x <= 3.1e+68) && (x <= 2.1e+150))) {
tmp = x * z;
} 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 = y * -x
if (x <= (-1.52d+60)) then
tmp = t_0
else if (x <= (-1.25d-46)) then
tmp = x * z
else if (x <= 9.6d-95) then
tmp = y
else if ((x <= 1.2d+24) .or. (.not. (x <= 3.1d+68)) .and. (x <= 2.1d+150)) then
tmp = x * z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * -x;
double tmp;
if (x <= -1.52e+60) {
tmp = t_0;
} else if (x <= -1.25e-46) {
tmp = x * z;
} else if (x <= 9.6e-95) {
tmp = y;
} else if ((x <= 1.2e+24) || (!(x <= 3.1e+68) && (x <= 2.1e+150))) {
tmp = x * z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * -x tmp = 0 if x <= -1.52e+60: tmp = t_0 elif x <= -1.25e-46: tmp = x * z elif x <= 9.6e-95: tmp = y elif (x <= 1.2e+24) or (not (x <= 3.1e+68) and (x <= 2.1e+150)): tmp = x * z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(-x)) tmp = 0.0 if (x <= -1.52e+60) tmp = t_0; elseif (x <= -1.25e-46) tmp = Float64(x * z); elseif (x <= 9.6e-95) tmp = y; elseif ((x <= 1.2e+24) || (!(x <= 3.1e+68) && (x <= 2.1e+150))) tmp = Float64(x * z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * -x; tmp = 0.0; if (x <= -1.52e+60) tmp = t_0; elseif (x <= -1.25e-46) tmp = x * z; elseif (x <= 9.6e-95) tmp = y; elseif ((x <= 1.2e+24) || (~((x <= 3.1e+68)) && (x <= 2.1e+150))) tmp = x * z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[x, -1.52e+60], t$95$0, If[LessEqual[x, -1.25e-46], N[(x * z), $MachinePrecision], If[LessEqual[x, 9.6e-95], y, If[Or[LessEqual[x, 1.2e+24], And[N[Not[LessEqual[x, 3.1e+68]], $MachinePrecision], LessEqual[x, 2.1e+150]]], N[(x * z), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(-x\right)\\
\mathbf{if}\;x \leq -1.52 \cdot 10^{+60}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-46}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{-95}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+24} \lor \neg \left(x \leq 3.1 \cdot 10^{+68}\right) \land x \leq 2.1 \cdot 10^{+150}:\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.52e60 or 1.2e24 < x < 3.0999999999999998e68 or 2.09999999999999998e150 < x Initial program 93.5%
remove-double-neg93.5%
distribute-rgt-neg-out93.5%
neg-sub093.5%
neg-sub093.5%
*-commutative93.5%
distribute-lft-neg-in93.5%
remove-double-neg93.5%
distribute-rgt-out--93.5%
*-lft-identity93.5%
associate-+l-93.5%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in y around inf 68.3%
Taylor expanded in x around inf 68.3%
associate-*r*68.3%
neg-mul-168.3%
*-commutative68.3%
Simplified68.3%
if -1.52e60 < x < -1.24999999999999998e-46 or 9.6e-95 < x < 1.2e24 or 3.0999999999999998e68 < x < 2.09999999999999998e150Initial 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 85.7%
mul-1-neg85.7%
distribute-rgt-neg-out85.7%
Simplified85.7%
Taylor expanded in y around 0 70.8%
if -1.24999999999999998e-46 < x < 9.6e-95Initial 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 inf 83.2%
Taylor expanded in x around 0 83.2%
Final simplification74.8%
(FPCore (x y z)
:precision binary64
(if (or (<= z -8e+35)
(and (not (<= z -3.3e-59)) (or (<= z -3.2e-122) (not (<= z 4e+47)))))
(+ y (* x z))
(- y (* y x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -8e+35) || (!(z <= -3.3e-59) && ((z <= -3.2e-122) || !(z <= 4e+47)))) {
tmp = y + (x * z);
} else {
tmp = y - (y * x);
}
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 <= (-8d+35)) .or. (.not. (z <= (-3.3d-59))) .and. (z <= (-3.2d-122)) .or. (.not. (z <= 4d+47))) then
tmp = y + (x * z)
else
tmp = y - (y * x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -8e+35) || (!(z <= -3.3e-59) && ((z <= -3.2e-122) || !(z <= 4e+47)))) {
tmp = y + (x * z);
} else {
tmp = y - (y * x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -8e+35) or (not (z <= -3.3e-59) and ((z <= -3.2e-122) or not (z <= 4e+47))): tmp = y + (x * z) else: tmp = y - (y * x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -8e+35) || (!(z <= -3.3e-59) && ((z <= -3.2e-122) || !(z <= 4e+47)))) tmp = Float64(y + Float64(x * z)); else tmp = Float64(y - Float64(y * x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -8e+35) || (~((z <= -3.3e-59)) && ((z <= -3.2e-122) || ~((z <= 4e+47))))) tmp = y + (x * z); else tmp = y - (y * x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -8e+35], And[N[Not[LessEqual[z, -3.3e-59]], $MachinePrecision], Or[LessEqual[z, -3.2e-122], N[Not[LessEqual[z, 4e+47]], $MachinePrecision]]]], N[(y + N[(x * z), $MachinePrecision]), $MachinePrecision], N[(y - N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+35} \lor \neg \left(z \leq -3.3 \cdot 10^{-59}\right) \land \left(z \leq -3.2 \cdot 10^{-122} \lor \neg \left(z \leq 4 \cdot 10^{+47}\right)\right):\\
\;\;\;\;y + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;y - y \cdot x\\
\end{array}
\end{array}
if z < -7.9999999999999997e35 or -3.29999999999999982e-59 < z < -3.2000000000000002e-122 or 4.0000000000000002e47 < z Initial program 94.9%
remove-double-neg94.9%
distribute-rgt-neg-out94.9%
neg-sub094.9%
neg-sub094.9%
*-commutative94.9%
distribute-lft-neg-in94.9%
remove-double-neg94.9%
distribute-rgt-out--94.9%
*-lft-identity94.9%
associate-+l-94.9%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in y around 0 93.5%
mul-1-neg93.5%
distribute-rgt-neg-out93.5%
Simplified93.5%
sub-neg93.5%
+-commutative93.5%
distribute-rgt-neg-out93.5%
remove-double-neg93.5%
Applied egg-rr93.5%
if -7.9999999999999997e35 < z < -3.29999999999999982e-59 or -3.2000000000000002e-122 < z < 4.0000000000000002e47Initial 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 inf 91.7%
Final simplification92.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (- x))))
(if (<= x -6e+56)
t_0
(if (<= x 1.05e+25)
(+ y (* x z))
(if (or (<= x 3.4e+68) (not (<= x 2.7e+150))) t_0 (* x z))))))
double code(double x, double y, double z) {
double t_0 = y * -x;
double tmp;
if (x <= -6e+56) {
tmp = t_0;
} else if (x <= 1.05e+25) {
tmp = y + (x * z);
} else if ((x <= 3.4e+68) || !(x <= 2.7e+150)) {
tmp = t_0;
} 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 = y * -x
if (x <= (-6d+56)) then
tmp = t_0
else if (x <= 1.05d+25) then
tmp = y + (x * z)
else if ((x <= 3.4d+68) .or. (.not. (x <= 2.7d+150))) then
tmp = t_0
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * -x;
double tmp;
if (x <= -6e+56) {
tmp = t_0;
} else if (x <= 1.05e+25) {
tmp = y + (x * z);
} else if ((x <= 3.4e+68) || !(x <= 2.7e+150)) {
tmp = t_0;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z): t_0 = y * -x tmp = 0 if x <= -6e+56: tmp = t_0 elif x <= 1.05e+25: tmp = y + (x * z) elif (x <= 3.4e+68) or not (x <= 2.7e+150): tmp = t_0 else: tmp = x * z return tmp
function code(x, y, z) t_0 = Float64(y * Float64(-x)) tmp = 0.0 if (x <= -6e+56) tmp = t_0; elseif (x <= 1.05e+25) tmp = Float64(y + Float64(x * z)); elseif ((x <= 3.4e+68) || !(x <= 2.7e+150)) tmp = t_0; else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * -x; tmp = 0.0; if (x <= -6e+56) tmp = t_0; elseif (x <= 1.05e+25) tmp = y + (x * z); elseif ((x <= 3.4e+68) || ~((x <= 2.7e+150))) tmp = t_0; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[x, -6e+56], t$95$0, If[LessEqual[x, 1.05e+25], N[(y + N[(x * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 3.4e+68], N[Not[LessEqual[x, 2.7e+150]], $MachinePrecision]], t$95$0, N[(x * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(-x\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{+56}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+25}:\\
\;\;\;\;y + x \cdot z\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+68} \lor \neg \left(x \leq 2.7 \cdot 10^{+150}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if x < -6.00000000000000012e56 or 1.05e25 < x < 3.40000000000000015e68 or 2.70000000000000008e150 < x Initial program 93.5%
remove-double-neg93.5%
distribute-rgt-neg-out93.5%
neg-sub093.5%
neg-sub093.5%
*-commutative93.5%
distribute-lft-neg-in93.5%
remove-double-neg93.5%
distribute-rgt-out--93.5%
*-lft-identity93.5%
associate-+l-93.5%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in y around inf 68.3%
Taylor expanded in x around inf 68.3%
associate-*r*68.3%
neg-mul-168.3%
*-commutative68.3%
Simplified68.3%
if -6.00000000000000012e56 < x < 1.05e25Initial 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 96.8%
mul-1-neg96.8%
distribute-rgt-neg-out96.8%
Simplified96.8%
sub-neg96.8%
+-commutative96.8%
distribute-rgt-neg-out96.8%
remove-double-neg96.8%
Applied egg-rr96.8%
if 3.40000000000000015e68 < x < 2.70000000000000008e150Initial 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 y around 0 75.5%
mul-1-neg75.5%
distribute-rgt-neg-out75.5%
Simplified75.5%
Taylor expanded in y around 0 75.7%
Final simplification85.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.6e-41) (not (<= x 9.6e-95))) (* x z) y))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.6e-41) || !(x <= 9.6e-95)) {
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 ((x <= (-1.6d-41)) .or. (.not. (x <= 9.6d-95))) 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 ((x <= -1.6e-41) || !(x <= 9.6e-95)) {
tmp = x * z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.6e-41) or not (x <= 9.6e-95): tmp = x * z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.6e-41) || !(x <= 9.6e-95)) tmp = Float64(x * z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.6e-41) || ~((x <= 9.6e-95))) tmp = x * z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.6e-41], N[Not[LessEqual[x, 9.6e-95]], $MachinePrecision]], N[(x * z), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{-41} \lor \neg \left(x \leq 9.6 \cdot 10^{-95}\right):\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.60000000000000006e-41 or 9.6e-95 < x Initial program 96.1%
remove-double-neg96.1%
distribute-rgt-neg-out96.1%
neg-sub096.1%
neg-sub096.1%
*-commutative96.1%
distribute-lft-neg-in96.1%
remove-double-neg96.1%
distribute-rgt-out--96.1%
*-lft-identity96.1%
associate-+l-96.1%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in y around 0 57.3%
mul-1-neg57.3%
distribute-rgt-neg-out57.3%
Simplified57.3%
Taylor expanded in y around 0 51.2%
if -1.60000000000000006e-41 < x < 9.6e-95Initial 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 inf 83.2%
Taylor expanded in x around 0 83.2%
Final simplification64.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 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 y around inf 65.1%
Taylor expanded in x around 0 38.4%
(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 2024089
(FPCore (x y z)
:name "Diagrams.Color.HSV:lerp from diagrams-contrib-1.3.0.5"
:precision binary64
:alt
(- y (* x (- y z)))
(+ (* (- 1.0 x) y) (* x z)))