?

Average Error: 2.0 → 0.2
Time: 15.7s
Precision: binary64
Cost: 1216

?

\[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
\[\begin{array}{l} t_1 := \left(1 + t\right) - z\\ a \cdot \left(\frac{z}{t_1} - \frac{y}{t_1}\right) + x \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (+ 1.0 t) z))) (+ (* a (- (/ z t_1) (/ y t_1))) x)))
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) {
	double t_1 = (1.0 + t) - z;
	return (a * ((z / t_1) - (y / t_1))) + x;
}
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
    real(8) :: t_1
    t_1 = (1.0d0 + t) - z
    code = (a * ((z / t_1) - (y / t_1))) + x
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) {
	double t_1 = (1.0 + t) - z;
	return (a * ((z / t_1) - (y / t_1))) + x;
}
def code(x, y, z, t, a):
	return x - ((y - z) / (((t - z) + 1.0) / a))
def code(x, y, z, t, a):
	t_1 = (1.0 + t) - z
	return (a * ((z / t_1) - (y / t_1))) + x
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)
	t_1 = Float64(Float64(1.0 + t) - z)
	return Float64(Float64(a * Float64(Float64(z / t_1) - Float64(y / t_1))) + x)
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)
	t_1 = (1.0 + t) - z;
	tmp = (a * ((z / t_1) - (y / t_1))) + x;
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_] := Block[{t$95$1 = N[(N[(1.0 + t), $MachinePrecision] - z), $MachinePrecision]}, N[(N[(a * N[(N[(z / t$95$1), $MachinePrecision] - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\begin{array}{l}
t_1 := \left(1 + t\right) - z\\
a \cdot \left(\frac{z}{t_1} - \frac{y}{t_1}\right) + x
\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation?

  1. Initial program 2.0

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

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

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

Alternatives

Alternative 1
Error1.0
Cost2376
\[\begin{array}{l} t_1 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\ t_2 := x - t_1\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{-170}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;a \cdot \frac{z}{\left(1 + t\right) - z} + x\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error13.9
Cost1500
\[\begin{array}{l} t_1 := a \cdot \frac{z}{1 - z} + x\\ t_2 := a \cdot \frac{z - y}{t} + x\\ \mathbf{if}\;t \leq -92000000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-122}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-42}:\\ \;\;\;\;x - \frac{y \cdot a}{1 - z}\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{+171}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+184}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 10^{+270}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y - z}{\frac{t}{a}}\\ \end{array} \]
Alternative 3
Error13.9
Cost1368
\[\begin{array}{l} t_1 := a \cdot \frac{z}{1 - z} + x\\ t_2 := a \cdot \frac{z - y}{t} + x\\ \mathbf{if}\;t \leq -2.6 \cdot 10^{+15}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-122}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-42}:\\ \;\;\;\;x - \frac{y \cdot a}{1 - z}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+170}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+184}:\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error18.4
Cost1304
\[\begin{array}{l} t_1 := x - y \cdot a\\ t_2 := a \cdot \left(-\frac{y}{t}\right) + x\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{+35}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-134}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-180}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-190}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+19}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 5
Error18.5
Cost1304
\[\begin{array}{l} t_1 := a \cdot \left(-\frac{y}{t}\right) + x\\ \mathbf{if}\;z \leq -5.7 \cdot 10^{+32}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-134}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-177}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;z \leq 3.35 \cdot 10^{-190}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-170}:\\ \;\;\;\;x + y \cdot \left(a \cdot t - a\right)\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+19}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 6
Error7.1
Cost1232
\[\begin{array}{l} t_1 := a \cdot \frac{z}{\left(1 + t\right) - z} + x\\ t_2 := x - a \cdot \frac{y}{1 + \left(t - z\right)}\\ \mathbf{if}\;y \leq -3.9 \cdot 10^{-54}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-10}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+79}:\\ \;\;\;\;x - \frac{y - z}{\frac{1 + t}{a}}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+108}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error7.0
Cost1232
\[\begin{array}{l} t_1 := x - a \cdot \frac{y}{1 + \left(t - z\right)}\\ \mathbf{if}\;y \leq -1.62 \cdot 10^{-52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-8}:\\ \;\;\;\;a \cdot \frac{z}{\left(1 + t\right) - z} + x\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+79}:\\ \;\;\;\;x - \frac{y - z}{\frac{1 + t}{a}}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{+107}:\\ \;\;\;\;x - \frac{y - z}{\frac{1 - z}{a}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error13.7
Cost1104
\[\begin{array}{l} t_1 := a \cdot \frac{z - y}{t} + x\\ \mathbf{if}\;t \leq -4.8 \cdot 10^{+15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+90}:\\ \;\;\;\;a \cdot \frac{z}{1 - z} + x\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+170}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+184}:\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error19.0
Cost976
\[\begin{array}{l} t_1 := x - \frac{y \cdot a}{t}\\ \mathbf{if}\;z \leq -7.8 \cdot 10^{+32}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-134}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-182}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+18}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 10
Error9.4
Cost968
\[\begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+14}:\\ \;\;\;\;x - \frac{y - z}{-\frac{z}{a}}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-60}:\\ \;\;\;\;x - \frac{y \cdot a}{1 + t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{z}{\left(1 + t\right) - z} + x\\ \end{array} \]
Alternative 11
Error6.6
Cost968
\[\begin{array}{l} t_1 := x - a \cdot \frac{y}{1 + \left(t - z\right)}\\ \mathbf{if}\;y \leq -7.9 \cdot 10^{-53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 0.00047:\\ \;\;\;\;a \cdot \frac{z}{\left(1 + t\right) - z} + x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error10.2
Cost904
\[\begin{array}{l} t_1 := x - \frac{y - z}{-\frac{z}{a}}\\ \mathbf{if}\;z \leq -2.6 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{+17}:\\ \;\;\;\;x - \frac{y \cdot a}{1 + t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error17.2
Cost844
\[\begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{-13}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-60}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+17}:\\ \;\;\;\;a \cdot \frac{z}{t} + x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 14
Error17.2
Cost844
\[\begin{array}{l} \mathbf{if}\;z \leq -3.45 \cdot 10^{-7}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-61}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+18}:\\ \;\;\;\;\frac{a \cdot z}{t} + x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 15
Error14.9
Cost840
\[\begin{array}{l} t_1 := a \cdot \left(-\frac{y}{t}\right) + x\\ \mathbf{if}\;t \leq -9.2 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{+88}:\\ \;\;\;\;a \cdot \frac{z}{1 - z} + x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error11.4
Cost840
\[\begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+33}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-47}:\\ \;\;\;\;x - \frac{y \cdot a}{1 + t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{z}{1 - z} + x\\ \end{array} \]
Alternative 17
Error17.2
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{-7}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-12}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 18
Error19.6
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -150000:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 4800000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
Alternative 19
Error27.1
Cost392
\[\begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-272}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-253}:\\ \;\;\;\;-a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 20
Error27.9
Cost64
\[x \]

Error

Reproduce?

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