
(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 99.2%
sub-neg99.2%
+-commutative99.2%
distribute-rgt1-in99.2%
associate-+l+99.2%
+-commutative99.2%
*-commutative99.2%
neg-mul-199.2%
associate-*r*99.2%
*-commutative99.2%
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 (* y (- x))))
(if (<= x -5.9e+174)
t_0
(if (<= x -5.8e+140)
(* x z)
(if (<= x -2.2e+50)
t_0
(if (<= x -1.3e-31)
(* x z)
(if (<= x 1.4e-128)
y
(if (<= x 6.5e-109)
(* x z)
(if (<= x 4.9e-22)
y
(if (<= x 2.2e+69)
(* x z)
(if (<= x 2.4e+101) t_0 (* x z))))))))))))
double code(double x, double y, double z) {
double t_0 = y * -x;
double tmp;
if (x <= -5.9e+174) {
tmp = t_0;
} else if (x <= -5.8e+140) {
tmp = x * z;
} else if (x <= -2.2e+50) {
tmp = t_0;
} else if (x <= -1.3e-31) {
tmp = x * z;
} else if (x <= 1.4e-128) {
tmp = y;
} else if (x <= 6.5e-109) {
tmp = x * z;
} else if (x <= 4.9e-22) {
tmp = y;
} else if (x <= 2.2e+69) {
tmp = x * z;
} else if (x <= 2.4e+101) {
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 <= (-5.9d+174)) then
tmp = t_0
else if (x <= (-5.8d+140)) then
tmp = x * z
else if (x <= (-2.2d+50)) then
tmp = t_0
else if (x <= (-1.3d-31)) then
tmp = x * z
else if (x <= 1.4d-128) then
tmp = y
else if (x <= 6.5d-109) then
tmp = x * z
else if (x <= 4.9d-22) then
tmp = y
else if (x <= 2.2d+69) then
tmp = x * z
else if (x <= 2.4d+101) 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 <= -5.9e+174) {
tmp = t_0;
} else if (x <= -5.8e+140) {
tmp = x * z;
} else if (x <= -2.2e+50) {
tmp = t_0;
} else if (x <= -1.3e-31) {
tmp = x * z;
} else if (x <= 1.4e-128) {
tmp = y;
} else if (x <= 6.5e-109) {
tmp = x * z;
} else if (x <= 4.9e-22) {
tmp = y;
} else if (x <= 2.2e+69) {
tmp = x * z;
} else if (x <= 2.4e+101) {
tmp = t_0;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z): t_0 = y * -x tmp = 0 if x <= -5.9e+174: tmp = t_0 elif x <= -5.8e+140: tmp = x * z elif x <= -2.2e+50: tmp = t_0 elif x <= -1.3e-31: tmp = x * z elif x <= 1.4e-128: tmp = y elif x <= 6.5e-109: tmp = x * z elif x <= 4.9e-22: tmp = y elif x <= 2.2e+69: tmp = x * z elif x <= 2.4e+101: 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 <= -5.9e+174) tmp = t_0; elseif (x <= -5.8e+140) tmp = Float64(x * z); elseif (x <= -2.2e+50) tmp = t_0; elseif (x <= -1.3e-31) tmp = Float64(x * z); elseif (x <= 1.4e-128) tmp = y; elseif (x <= 6.5e-109) tmp = Float64(x * z); elseif (x <= 4.9e-22) tmp = y; elseif (x <= 2.2e+69) tmp = Float64(x * z); elseif (x <= 2.4e+101) 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 <= -5.9e+174) tmp = t_0; elseif (x <= -5.8e+140) tmp = x * z; elseif (x <= -2.2e+50) tmp = t_0; elseif (x <= -1.3e-31) tmp = x * z; elseif (x <= 1.4e-128) tmp = y; elseif (x <= 6.5e-109) tmp = x * z; elseif (x <= 4.9e-22) tmp = y; elseif (x <= 2.2e+69) tmp = x * z; elseif (x <= 2.4e+101) 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, -5.9e+174], t$95$0, If[LessEqual[x, -5.8e+140], N[(x * z), $MachinePrecision], If[LessEqual[x, -2.2e+50], t$95$0, If[LessEqual[x, -1.3e-31], N[(x * z), $MachinePrecision], If[LessEqual[x, 1.4e-128], y, If[LessEqual[x, 6.5e-109], N[(x * z), $MachinePrecision], If[LessEqual[x, 4.9e-22], y, If[LessEqual[x, 2.2e+69], N[(x * z), $MachinePrecision], If[LessEqual[x, 2.4e+101], t$95$0, N[(x * z), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(-x\right)\\
\mathbf{if}\;x \leq -5.9 \cdot 10^{+174}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{+140}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{+50}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-31}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-128}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-109}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-22}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+69}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+101}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if x < -5.8999999999999999e174 or -5.7999999999999998e140 < x < -2.20000000000000017e50 or 2.2000000000000002e69 < x < 2.39999999999999988e101Initial program 97.7%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 74.4%
mul-1-neg74.4%
distribute-rgt-neg-out74.4%
Simplified74.4%
if -5.8999999999999999e174 < x < -5.7999999999999998e140 or -2.20000000000000017e50 < x < -1.29999999999999998e-31 or 1.3999999999999999e-128 < x < 6.49999999999999959e-109 or 4.8999999999999998e-22 < x < 2.2000000000000002e69 or 2.39999999999999988e101 < x Initial program 99.0%
Taylor expanded in y around 0 72.8%
if -1.29999999999999998e-31 < x < 1.3999999999999999e-128 or 6.49999999999999959e-109 < x < 4.8999999999999998e-22Initial program 100.0%
Taylor expanded in x around 0 72.5%
Final simplification72.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- z y))))
(if (<= x -7.8e-32)
t_0
(if (<= x 3.4e-128)
y
(if (<= x 1.8e-105) (* x z) (if (<= x 4.7e-23) y t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (z - y);
double tmp;
if (x <= -7.8e-32) {
tmp = t_0;
} else if (x <= 3.4e-128) {
tmp = y;
} else if (x <= 1.8e-105) {
tmp = x * z;
} else if (x <= 4.7e-23) {
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 <= (-7.8d-32)) then
tmp = t_0
else if (x <= 3.4d-128) then
tmp = y
else if (x <= 1.8d-105) then
tmp = x * z
else if (x <= 4.7d-23) 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 <= -7.8e-32) {
tmp = t_0;
} else if (x <= 3.4e-128) {
tmp = y;
} else if (x <= 1.8e-105) {
tmp = x * z;
} else if (x <= 4.7e-23) {
tmp = y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z - y) tmp = 0 if x <= -7.8e-32: tmp = t_0 elif x <= 3.4e-128: tmp = y elif x <= 1.8e-105: tmp = x * z elif x <= 4.7e-23: 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 <= -7.8e-32) tmp = t_0; elseif (x <= 3.4e-128) tmp = y; elseif (x <= 1.8e-105) tmp = Float64(x * z); elseif (x <= 4.7e-23) 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 <= -7.8e-32) tmp = t_0; elseif (x <= 3.4e-128) tmp = y; elseif (x <= 1.8e-105) tmp = x * z; elseif (x <= 4.7e-23) 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, -7.8e-32], t$95$0, If[LessEqual[x, 3.4e-128], y, If[LessEqual[x, 1.8e-105], N[(x * z), $MachinePrecision], If[LessEqual[x, 4.7e-23], y, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z - y\right)\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{-32}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-128}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-105}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{-23}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -7.8000000000000003e-32 or 4.7000000000000001e-23 < x Initial program 98.5%
Taylor expanded in x around inf 98.1%
mul-1-neg98.1%
unsub-neg98.1%
Simplified98.1%
if -7.8000000000000003e-32 < x < 3.39999999999999975e-128 or 1.79999999999999982e-105 < x < 4.7000000000000001e-23Initial program 100.0%
Taylor expanded in x around 0 72.5%
if 3.39999999999999975e-128 < x < 1.79999999999999982e-105Initial program 100.0%
Taylor expanded in y around 0 100.0%
Final simplification87.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- z y))))
(if (<= x -7.5e-32)
t_0
(if (<= x 3.3e-128)
y
(if (<= x 4.1e-100) (* x z) (if (<= x 4.8e-24) (- y (* x y)) t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (z - y);
double tmp;
if (x <= -7.5e-32) {
tmp = t_0;
} else if (x <= 3.3e-128) {
tmp = y;
} else if (x <= 4.1e-100) {
tmp = x * z;
} else if (x <= 4.8e-24) {
tmp = y - (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 = x * (z - y)
if (x <= (-7.5d-32)) then
tmp = t_0
else if (x <= 3.3d-128) then
tmp = y
else if (x <= 4.1d-100) then
tmp = x * z
else if (x <= 4.8d-24) then
tmp = y - (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 = x * (z - y);
double tmp;
if (x <= -7.5e-32) {
tmp = t_0;
} else if (x <= 3.3e-128) {
tmp = y;
} else if (x <= 4.1e-100) {
tmp = x * z;
} else if (x <= 4.8e-24) {
tmp = y - (x * y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z - y) tmp = 0 if x <= -7.5e-32: tmp = t_0 elif x <= 3.3e-128: tmp = y elif x <= 4.1e-100: tmp = x * z elif x <= 4.8e-24: tmp = y - (x * y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z - y)) tmp = 0.0 if (x <= -7.5e-32) tmp = t_0; elseif (x <= 3.3e-128) tmp = y; elseif (x <= 4.1e-100) tmp = Float64(x * z); elseif (x <= 4.8e-24) tmp = Float64(y - Float64(x * 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 <= -7.5e-32) tmp = t_0; elseif (x <= 3.3e-128) tmp = y; elseif (x <= 4.1e-100) tmp = x * z; elseif (x <= 4.8e-24) tmp = y - (x * 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, -7.5e-32], t$95$0, If[LessEqual[x, 3.3e-128], y, If[LessEqual[x, 4.1e-100], N[(x * z), $MachinePrecision], If[LessEqual[x, 4.8e-24], N[(y - N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z - y\right)\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{-32}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-128}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-100}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-24}:\\
\;\;\;\;y - x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -7.49999999999999953e-32 or 4.7999999999999996e-24 < x Initial program 98.5%
Taylor expanded in x around inf 98.1%
mul-1-neg98.1%
unsub-neg98.1%
Simplified98.1%
if -7.49999999999999953e-32 < x < 3.3e-128Initial program 100.0%
Taylor expanded in x around 0 72.4%
if 3.3e-128 < x < 4.0999999999999999e-100Initial program 100.0%
Taylor expanded in y around 0 100.0%
if 4.0999999999999999e-100 < x < 4.7999999999999996e-24Initial program 100.0%
Taylor expanded in y around inf 73.2%
sub-neg73.2%
distribute-lft-in73.2%
*-rgt-identity73.2%
distribute-rgt-neg-out73.2%
sub-neg73.2%
Simplified73.2%
Final simplification87.0%
(FPCore (x y z)
:precision binary64
(if (<= x -2e-32)
(* x z)
(if (<= x 2.7e-128)
y
(if (<= x 1.55e-104) (* x z) (if (<= x 3.2e-23) y (* x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2e-32) {
tmp = x * z;
} else if (x <= 2.7e-128) {
tmp = y;
} else if (x <= 1.55e-104) {
tmp = x * z;
} else if (x <= 3.2e-23) {
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) :: tmp
if (x <= (-2d-32)) then
tmp = x * z
else if (x <= 2.7d-128) then
tmp = y
else if (x <= 1.55d-104) then
tmp = x * z
else if (x <= 3.2d-23) then
tmp = y
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2e-32) {
tmp = x * z;
} else if (x <= 2.7e-128) {
tmp = y;
} else if (x <= 1.55e-104) {
tmp = x * z;
} else if (x <= 3.2e-23) {
tmp = y;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2e-32: tmp = x * z elif x <= 2.7e-128: tmp = y elif x <= 1.55e-104: tmp = x * z elif x <= 3.2e-23: tmp = y else: tmp = x * z return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2e-32) tmp = Float64(x * z); elseif (x <= 2.7e-128) tmp = y; elseif (x <= 1.55e-104) tmp = Float64(x * z); elseif (x <= 3.2e-23) tmp = y; else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2e-32) tmp = x * z; elseif (x <= 2.7e-128) tmp = y; elseif (x <= 1.55e-104) tmp = x * z; elseif (x <= 3.2e-23) tmp = y; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2e-32], N[(x * z), $MachinePrecision], If[LessEqual[x, 2.7e-128], y, If[LessEqual[x, 1.55e-104], N[(x * z), $MachinePrecision], If[LessEqual[x, 3.2e-23], y, N[(x * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-32}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-128}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-104}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-23}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if x < -2.00000000000000011e-32 or 2.70000000000000006e-128 < x < 1.54999999999999988e-104 or 3.19999999999999976e-23 < x Initial program 98.6%
Taylor expanded in y around 0 59.5%
if -2.00000000000000011e-32 < x < 2.70000000000000006e-128 or 1.54999999999999988e-104 < x < 3.19999999999999976e-23Initial program 100.0%
Taylor expanded in x around 0 72.5%
Final simplification65.1%
(FPCore (x y z) :precision binary64 (+ (* y (- 1.0 x)) (* x z)))
double code(double x, double y, double z) {
return (y * (1.0 - x)) + (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 = (y * (1.0d0 - x)) + (x * z)
end function
public static double code(double x, double y, double z) {
return (y * (1.0 - x)) + (x * z);
}
def code(x, y, z): return (y * (1.0 - x)) + (x * z)
function code(x, y, z) return Float64(Float64(y * Float64(1.0 - x)) + Float64(x * z)) end
function tmp = code(x, y, z) tmp = (y * (1.0 - x)) + (x * z); end
code[x_, y_, z_] := N[(N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(1 - x\right) + x \cdot z
\end{array}
Initial program 99.2%
Final simplification99.2%
(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 99.2%
Taylor expanded in x around 0 33.9%
Final simplification33.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 2023171
(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)))