(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (* -1.0 (/ (- z (+ 1.0 t)) a)))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (-1.0 * ((z - (1.0 + t)) / a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / ((-1.0d0) * ((z - (1.0d0 + t)) / a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (-1.0 * ((z - (1.0 + t)) / a)));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
def code(x, y, z, t, a): return x - ((y - z) / (-1.0 * ((z - (1.0 + t)) / a)))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(-1.0 * Float64(Float64(z - Float64(1.0 + t)) / a)))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (-1.0 * ((z - (1.0 + t)) / a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(-1.0 * N[(N[(z - N[(1.0 + t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
x - \frac{y - z}{-1 \cdot \frac{z - \left(1 + t\right)}{a}}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 1.8 |
|---|---|
| Target | 0.3 |
| Herbie | 1.8 |
Initial program 1.8
Taylor expanded in t around 0 3.1
Taylor expanded in a around -inf 1.8
Final simplification1.8
herbie shell --seed 2022152
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:herbie-target
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))