
(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);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
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 8 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);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
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 (if (<= x -9600000000000.0) (fma (- x) y (* z x)) (if (<= x 4.5e-5) (fma z x y) (* (- z y) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -9600000000000.0) {
tmp = fma(-x, y, (z * x));
} else if (x <= 4.5e-5) {
tmp = fma(z, x, y);
} else {
tmp = (z - y) * x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= -9600000000000.0) tmp = fma(Float64(-x), y, Float64(z * x)); elseif (x <= 4.5e-5) tmp = fma(z, x, y); else tmp = Float64(Float64(z - y) * x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, -9600000000000.0], N[((-x) * y + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e-5], N[(z * x + y), $MachinePrecision], N[(N[(z - y), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9600000000000:\\
\;\;\;\;\mathsf{fma}\left(-x, y, z \cdot x\right)\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(z, x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z - y\right) \cdot x\\
\end{array}
\end{array}
if x < -9.6e12Initial program 98.1%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64100.0
Applied rewrites100.0%
if -9.6e12 < x < 4.50000000000000028e-5Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites99.9%
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
if 4.50000000000000028e-5 < x Initial program 95.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-subN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6498.3
Applied rewrites98.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -9600000000000.0) (not (<= x 4.5e-5))) (* (- z y) x) (fma z x y)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -9600000000000.0) || !(x <= 4.5e-5)) {
tmp = (z - y) * x;
} else {
tmp = fma(z, x, y);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if ((x <= -9600000000000.0) || !(x <= 4.5e-5)) tmp = Float64(Float64(z - y) * x); else tmp = fma(z, x, y); end return tmp end
code[x_, y_, z_] := If[Or[LessEqual[x, -9600000000000.0], N[Not[LessEqual[x, 4.5e-5]], $MachinePrecision]], N[(N[(z - y), $MachinePrecision] * x), $MachinePrecision], N[(z * x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9600000000000 \lor \neg \left(x \leq 4.5 \cdot 10^{-5}\right):\\
\;\;\;\;\left(z - y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, x, y\right)\\
\end{array}
\end{array}
if x < -9.6e12 or 4.50000000000000028e-5 < x Initial program 96.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-subN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6499.0
Applied rewrites99.0%
if -9.6e12 < x < 4.50000000000000028e-5Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites99.9%
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.6e-75) (not (<= z 2e-60))) (fma z x y) (* (- 1.0 x) y)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.6e-75) || !(z <= 2e-60)) {
tmp = fma(z, x, y);
} else {
tmp = (1.0 - x) * y;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if ((z <= -2.6e-75) || !(z <= 2e-60)) tmp = fma(z, x, y); else tmp = Float64(Float64(1.0 - x) * y); end return tmp end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.6e-75], N[Not[LessEqual[z, 2e-60]], $MachinePrecision]], N[(z * x + y), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-75} \lor \neg \left(z \leq 2 \cdot 10^{-60}\right):\\
\;\;\;\;\mathsf{fma}\left(z, x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - x\right) \cdot y\\
\end{array}
\end{array}
if z < -2.6e-75 or 1.9999999999999999e-60 < z Initial program 97.6%
Taylor expanded in x around 0
Applied rewrites90.0%
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6490.0
Applied rewrites90.0%
if -2.6e-75 < z < 1.9999999999999999e-60Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f64N/A
lift--.f6489.7
Applied rewrites89.7%
Final simplification89.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -3.5e+192) (not (<= x -2.6e+83))) (fma z x y) (* (- y) x)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.5e+192) || !(x <= -2.6e+83)) {
tmp = fma(z, x, y);
} else {
tmp = -y * x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if ((x <= -3.5e+192) || !(x <= -2.6e+83)) tmp = fma(z, x, y); else tmp = Float64(Float64(-y) * x); end return tmp end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.5e+192], N[Not[LessEqual[x, -2.6e+83]], $MachinePrecision]], N[(z * x + y), $MachinePrecision], N[((-y) * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+192} \lor \neg \left(x \leq -2.6 \cdot 10^{+83}\right):\\
\;\;\;\;\mathsf{fma}\left(z, x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot x\\
\end{array}
\end{array}
if x < -3.49999999999999983e192 or -2.6000000000000001e83 < x Initial program 98.3%
Taylor expanded in x around 0
Applied rewrites84.9%
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6484.9
Applied rewrites84.9%
if -3.49999999999999983e192 < x < -2.6000000000000001e83Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
cancel-sign-subN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6482.5
Applied rewrites82.5%
Final simplification84.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -6.1e-89) (not (<= x 5.8e-14))) (* z x) y))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6.1e-89) || !(x <= 5.8e-14)) {
tmp = z * x;
} else {
tmp = y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-6.1d-89)) .or. (.not. (x <= 5.8d-14))) then
tmp = z * x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -6.1e-89) || !(x <= 5.8e-14)) {
tmp = z * x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6.1e-89) or not (x <= 5.8e-14): tmp = z * x else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6.1e-89) || !(x <= 5.8e-14)) tmp = Float64(z * x); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -6.1e-89) || ~((x <= 5.8e-14))) tmp = z * x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6.1e-89], N[Not[LessEqual[x, 5.8e-14]], $MachinePrecision]], N[(z * x), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.1 \cdot 10^{-89} \lor \neg \left(x \leq 5.8 \cdot 10^{-14}\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -6.1000000000000003e-89 or 5.8000000000000005e-14 < x Initial program 97.3%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6461.7
Applied rewrites61.7%
if -6.1000000000000003e-89 < x < 5.8000000000000005e-14Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites77.4%
Final simplification68.2%
(FPCore (x y z) :precision binary64 (fma (- 1.0 x) y (* z x)))
double code(double x, double y, double z) {
return fma((1.0 - x), y, (z * x));
}
function code(x, y, z) return fma(Float64(1.0 - x), y, Float64(z * x)) end
code[x_, y_, z_] := N[(N[(1.0 - x), $MachinePrecision] * y + N[(z * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1 - x, y, z \cdot x\right)
\end{array}
Initial program 98.4%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6499.2
Applied rewrites99.2%
(FPCore (x y z) :precision binary64 (fma z x y))
double code(double x, double y, double z) {
return fma(z, x, y);
}
function code(x, y, z) return fma(z, x, y) end
code[x_, y_, z_] := N[(z * x + y), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, x, y\right)
\end{array}
Initial program 98.4%
Taylor expanded in x around 0
Applied rewrites79.9%
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6479.9
Applied rewrites79.9%
(FPCore (x y z) :precision binary64 y)
double code(double x, double y, double z) {
return y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
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.4%
Taylor expanded in x around 0
Applied rewrites35.9%
(FPCore (x y z) :precision binary64 (- y (* x (- y z))))
double code(double x, double y, double z) {
return y - (x * (y - z));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
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 2025057
(FPCore (x y z)
:name "Diagrams.Color.HSV:lerp from diagrams-contrib-1.3.0.5"
:precision binary64
:alt
(! :herbie-platform default (- y (* x (- y z))))
(+ (* (- 1.0 x) y) (* x z)))