Average Error: 2.1 → 0.3
Time: 7.5s
Precision: binary64
Cost: 832
\[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
\[x - \frac{a}{\frac{1 + \left(t - z\right)}{y - z}} \]
(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 (/ a (/ (+ 1.0 (- t z)) (- y z)))))
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 - (a / ((1.0 + (t - z)) / (y - z)));
}
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 - (a / ((1.0d0 + (t - z)) / (y - z)))
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 - (a / ((1.0 + (t - z)) / (y - z)));
}
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 - (a / ((1.0 + (t - z)) / (y - z)))
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(a / Float64(Float64(1.0 + Float64(t - z)) / Float64(y - z))))
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 - (a / ((1.0 + (t - z)) / (y - z)));
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[(a / N[(N[(1.0 + N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
x - \frac{a}{\frac{1 + \left(t - z\right)}{y - z}}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 2.1

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
  2. Applied egg-rr2.5

    \[\leadsto x - \color{blue}{\frac{{\left(\sqrt[3]{y - z}\right)}^{2}}{1} \cdot \frac{\sqrt[3]{y - z}}{\frac{\left(t - z\right) + 1}{a}}} \]
  3. Taylor expanded in y around 0 10.8

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

    \[\leadsto x - \color{blue}{\frac{a}{\frac{1 + \left(t - z\right)}{y - z}}} \]
  5. Final simplification0.3

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

Alternatives

Alternative 1
Error7.5
Cost968
\[\begin{array}{l} t_1 := x - \frac{a}{\frac{1 - z}{y - z}}\\ \mathbf{if}\;z \leq -6.842394765670034 \cdot 10^{-9}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1344.008526924736:\\ \;\;\;\;x - y \cdot \frac{a}{1 + t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error9.6
Cost840
\[\begin{array}{l} \mathbf{if}\;z \leq -2.521498684723088 \cdot 10^{+41}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 4.884971311286993 \cdot 10^{+41}:\\ \;\;\;\;x - y \cdot \frac{a}{1 + t}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 3
Error17.2
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -2.521498684723088 \cdot 10^{+41}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 0.00033140956475038834:\\ \;\;\;\;x - a \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 4
Error18.8
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -2.521498684723088 \cdot 10^{+41}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 0.00033140956475038834:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 5
Error27.0
Cost392
\[\begin{array}{l} \mathbf{if}\;x \leq -1.8381227717605826 \cdot 10^{-100}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 9.048415105908475 \cdot 10^{-253}:\\ \;\;\;\;-a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 6
Error27.7
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2022225 
(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))))