(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (- x y) (- z y)))) (if (<= t_1 1e+219) (* t_1 t) (/ (* (- x y) t) (- z y)))))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= 1e+219) {
tmp = t_1 * t;
} else {
tmp = ((x - y) * t) / (z - y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x - y) / (z - y)) * t
end function
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x - y) / (z - y)
if (t_1 <= 1d+219) then
tmp = t_1 * t
else
tmp = ((x - y) * t) / (z - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= 1e+219) {
tmp = t_1 * t;
} else {
tmp = ((x - y) * t) / (z - y);
}
return tmp;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
def code(x, y, z, t): t_1 = (x - y) / (z - y) tmp = 0 if t_1 <= 1e+219: tmp = t_1 * t else: tmp = ((x - y) * t) / (z - y) return tmp
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) tmp = 0.0 if (t_1 <= 1e+219) tmp = Float64(t_1 * t); else tmp = Float64(Float64(Float64(x - y) * t) / Float64(z - y)); end return tmp end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) / (z - y); tmp = 0.0; if (t_1 <= 1e+219) tmp = t_1 * t; else tmp = ((x - y) * t) / (z - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+219], N[(t$95$1 * t), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] * t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
\mathbf{if}\;t_1 \leq 10^{+219}:\\
\;\;\;\;t_1 \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.1 |
|---|---|
| Target | 2.2 |
| Herbie | 1.6 |
if (/.f64 (-.f64 x y) (-.f64 z y)) < 9.99999999999999965e218Initial program 1.6
if 9.99999999999999965e218 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 24.0
Taylor expanded in t around 0 0.2
Final simplification1.6
herbie shell --seed 2022162
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))