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

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.1
Target0.2
Herbie0.2
\[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. Simplified0.2

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

    [Start]2.1

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

    associate-/r/ [=>]0.2

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

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

Alternatives

Alternative 1
Error5.8
Cost1234
\[\begin{array}{l} \mathbf{if}\;t \leq -6.6 \cdot 10^{+100} \lor \neg \left(t \leq -1.5 \cdot 10^{+68} \lor \neg \left(t \leq -1.96 \cdot 10^{+31}\right) \land t \leq 4.5 \cdot 10^{+17}\right):\\ \;\;\;\;x - a \cdot \frac{y - z}{t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{a}{\frac{1 - z}{y - z}}\\ \end{array} \]
Alternative 2
Error18.1
Cost976
\[\begin{array}{l} t_1 := x - y \cdot \frac{a}{t}\\ \mathbf{if}\;t \leq -7.8 \cdot 10^{+102}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1.75 \cdot 10^{-34}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 8.6 \cdot 10^{-247}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{+99}:\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error17.9
Cost976
\[\begin{array}{l} \mathbf{if}\;t \leq -2.15 \cdot 10^{+99}:\\ \;\;\;\;x - y \cdot \frac{a}{t}\\ \mathbf{elif}\;t \leq -2.3 \cdot 10^{-36}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-244}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{+101}:\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \end{array} \]
Alternative 4
Error6.1
Cost969
\[\begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{-16} \lor \neg \left(z \leq 7.5 \cdot 10^{-7}\right):\\ \;\;\;\;x + a \cdot \frac{z}{\left(t - z\right) + 1}\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \frac{y}{t + 1}\\ \end{array} \]
Alternative 5
Error9.2
Cost841
\[\begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+23} \lor \neg \left(z \leq 5.4 \cdot 10^{+15}\right):\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{a}{t + 1}\\ \end{array} \]
Alternative 6
Error9.0
Cost841
\[\begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+25} \lor \neg \left(z \leq 8200000000000\right):\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \frac{y}{t + 1}\\ \end{array} \]
Alternative 7
Error7.2
Cost841
\[\begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{+19} \lor \neg \left(z \leq 4.2 \cdot 10^{+31}\right):\\ \;\;\;\;x + \left(y \cdot \frac{a}{z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \frac{y}{t + 1}\\ \end{array} \]
Alternative 8
Error16.2
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+19}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{+14}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 9
Error18.6
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+66}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 5500000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 10
Error27.0
Cost64
\[x \]

Error

Reproduce

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