?

Average Accuracy: 96.6% → 99.5%
Time: 15.1s
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

Original96.6%
Target99.5%
Herbie99.5%
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a \]

Derivation?

  1. Initial program 96.6%

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

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

    [Start]96.6

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

    associate-/r/ [=>]99.5

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

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

Alternatives

Alternative 1
Accuracy74.2%
Cost1372
\[\begin{array}{l} t_1 := x - y \cdot \frac{a}{1 - z}\\ t_2 := x - \frac{a}{\frac{t}{y}}\\ \mathbf{if}\;t \leq -9.2 \cdot 10^{+80}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-89}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-277}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-69}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 390000000000:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 420000000000:\\ \;\;\;\;x + \frac{a}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Accuracy76.3%
Cost1368
\[\begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{a}{z}\\ t_2 := x - y \cdot \frac{a}{1 - z}\\ \mathbf{if}\;t \leq -1.8 \cdot 10^{+81}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{-55}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-276}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-115}:\\ \;\;\;\;x - z \cdot \frac{a}{z + -1}\\ \mathbf{elif}\;t \leq 1.04 \cdot 10^{-35}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + \frac{a}{t} \cdot \left(z - y\right)\\ \end{array} \]
Alternative 3
Accuracy76.6%
Cost1368
\[\begin{array}{l} t_1 := x + \left(y \cdot \frac{a}{z} - a\right)\\ t_2 := x - y \cdot \frac{a}{1 - z}\\ \mathbf{if}\;t \leq -9.5 \cdot 10^{+80}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq -1.75 \cdot 10^{-56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{-275}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-116}:\\ \;\;\;\;x - z \cdot \frac{a}{z + -1}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-31}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + \frac{a}{t} \cdot \left(z - y\right)\\ \end{array} \]
Alternative 4
Accuracy76.2%
Cost1104
\[\begin{array}{l} t_1 := x - z \cdot \frac{a}{z + -1}\\ t_2 := x - \frac{a}{\frac{t}{y}}\\ \mathbf{if}\;t \leq -1.12 \cdot 10^{+82}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-275}:\\ \;\;\;\;x - y \cdot \frac{a}{1 - z}\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{+22}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Accuracy77.6%
Cost1104
\[\begin{array}{l} t_1 := x - z \cdot \frac{a}{z + -1}\\ \mathbf{if}\;t \leq -8.6 \cdot 10^{+80}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{-275}:\\ \;\;\;\;x - y \cdot \frac{a}{1 - z}\\ \mathbf{elif}\;t \leq 1.42 \cdot 10^{+22}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + \frac{a}{t} \cdot \left(z - y\right)\\ \end{array} \]
Alternative 6
Accuracy71.3%
Cost976
\[\begin{array}{l} t_1 := x - y \cdot \frac{a}{t}\\ \mathbf{if}\;t \leq -6.1 \cdot 10^{+81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -3.2 \cdot 10^{-94}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-268}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;t \leq 7.4 \cdot 10^{+21}:\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Accuracy71.8%
Cost976
\[\begin{array}{l} t_1 := x - \frac{a}{\frac{t}{y}}\\ \mathbf{if}\;t \leq -3.8 \cdot 10^{+81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -9.2 \cdot 10^{-92}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 10^{-268}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;t \leq 1.12 \cdot 10^{+22}:\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Accuracy88.3%
Cost968
\[\begin{array}{l} \mathbf{if}\;t \leq -1.1 \cdot 10^{+82}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+41}:\\ \;\;\;\;x + \frac{a}{1 - z} \cdot \left(z - y\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y - z}}\\ \end{array} \]
Alternative 9
Accuracy89.6%
Cost968
\[\begin{array}{l} \mathbf{if}\;t \leq -1.16 \cdot 10^{+82}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+41}:\\ \;\;\;\;x - \frac{a}{\frac{1 - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y - z}}\\ \end{array} \]
Alternative 10
Accuracy87.2%
Cost841
\[\begin{array}{l} \mathbf{if}\;z \leq -120 \lor \neg \left(z \leq 1100000000\right):\\ \;\;\;\;x + \left(a \cdot \frac{y}{z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t + 1}{a}}\\ \end{array} \]
Alternative 11
Accuracy72.3%
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+21}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 5200:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 12
Accuracy69.3%
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -0.00145:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-9}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 13
Accuracy56.8%
Cost64
\[x \]

Error

Reproduce?

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