Average Error: 1.8 → 1.8
Time: 8.7s
Precision: binary64
\[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
\[x - \frac{y - z}{-1 \cdot \frac{z - \left(1 + t\right)}{a}} \]
(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}}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.8
Target0.3
Herbie1.8
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a \]

Derivation

  1. Initial program 1.8

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
  2. Taylor expanded in t around 0 3.1

    \[\leadsto x - \frac{y - z}{\color{blue}{\left(\frac{t}{a} + \frac{1}{a}\right) - \frac{z}{a}}} \]
  3. Taylor expanded in a around -inf 1.8

    \[\leadsto x - \frac{y - z}{\color{blue}{-1 \cdot \frac{z - \left(1 + t\right)}{a}}} \]
  4. Final simplification1.8

    \[\leadsto x - \frac{y - z}{-1 \cdot \frac{z - \left(1 + t\right)}{a}} \]

Reproduce

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))))