(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t) :precision binary64 (* x (- (/ y (- t z)) (/ z (- t z)))))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
double code(double x, double y, double z, double t) {
return x * ((y / (t - z)) - (z / (t - z)));
}
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)) / (t - z)
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
code = x * ((y / (t - z)) - (z / (t - z)))
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
public static double code(double x, double y, double z, double t) {
return x * ((y / (t - z)) - (z / (t - z)));
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
def code(x, y, z, t): return x * ((y / (t - z)) - (z / (t - z)))
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function code(x, y, z, t) return Float64(x * Float64(Float64(y / Float64(t - z)) - Float64(z / Float64(t - z)))) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
function tmp = code(x, y, z, t) tmp = x * ((y / (t - z)) - (z / (t - z))); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(x * N[(N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] - N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot \left(y - z\right)}{t - z}
x \cdot \left(\frac{y}{t - z} - \frac{z}{t - z}\right)




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.8 |
|---|---|
| Target | 2.2 |
| Herbie | 2.2 |
Initial program 11.8
Applied *-un-lft-identity_binary6411.8
Applied times-frac_binary642.2
Simplified2.2
Taylor expanded in y around 0 2.2
Final simplification2.2
herbie shell --seed 2022131
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))