Average Error: 2.1 → 2.1
Time: 11.7s
Precision: binary64
Cost: 576
\[\frac{x - y}{z - y} \cdot t \]
\[\frac{t}{\frac{z - y}{x - y}} \]
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
double code(double x, double y, double z, double t) {
	return t / ((z - y) / (x - y));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x - y) / (z - y)) * t
end function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
public static double code(double x, double y, double z, double t) {
	return t / ((z - y) / (x - y));
}
def code(x, y, z, t):
	return ((x - y) / (z - y)) * t
def code(x, y, z, t):
	return t / ((z - y) / (x - y))
function code(x, y, z, t)
	return Float64(Float64(Float64(x - y) / Float64(z - y)) * t)
end
function code(x, y, z, t)
	return Float64(t / Float64(Float64(z - y) / Float64(x - y)))
end
function tmp = code(x, y, z, t)
	tmp = ((x - y) / (z - y)) * t;
end
function tmp = code(x, y, z, t)
	tmp = t / ((z - y) / (x - y));
end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x - y}{z - y} \cdot t
\frac{t}{\frac{z - y}{x - y}}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.1
Target2.1
Herbie2.1
\[\frac{t}{\frac{z - y}{x - y}} \]

Derivation

  1. Initial program 2.1

    \[\frac{x - y}{z - y} \cdot t \]
  2. Simplified10.7

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

    [Start]2.1

    \[ \frac{x - y}{z - y} \cdot t \]

    associate-*l/ [=>]11.9

    \[ \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}} \]

    associate-*r/ [<=]10.7

    \[ \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}} \]
  3. Applied egg-rr2.1

    \[\leadsto \color{blue}{\frac{t}{\frac{z - y}{x - y}}} \]
  4. Final simplification2.1

    \[\leadsto \frac{t}{\frac{z - y}{x - y}} \]

Alternatives

Alternative 1
Error15.9
Cost1109
\[\begin{array}{l} t_1 := \frac{t}{\frac{y - z}{y}}\\ \mathbf{if}\;y \leq -2.6 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{-169}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-66}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+135} \lor \neg \left(y \leq 1.8 \cdot 10^{+203}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \end{array} \]
Alternative 2
Error17.9
Cost1108
\[\begin{array}{l} t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\ t_2 := \left(x - y\right) \cdot \frac{t}{z}\\ \mathbf{if}\;y \leq -1.55 \cdot 10^{+32}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-166}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-66}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-33}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{+27}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error22.1
Cost977
\[\begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{+32}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-66} \lor \neg \left(y \leq 3 \cdot 10^{-33}\right) \land y \leq 1.4 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 4
Error16.2
Cost977
\[\begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+33}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-66}:\\ \;\;\;\;\frac{t}{\frac{z}{x - y}}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+135} \lor \neg \left(y \leq 1.52 \cdot 10^{+203}\right):\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \end{array} \]
Alternative 5
Error7.0
Cost840
\[\begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+181}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \mathbf{elif}\;y \leq 1.36 \cdot 10^{+203}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{y - z}{y}}\\ \end{array} \]
Alternative 6
Error17.7
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -9.4 \cdot 10^{+30} \lor \neg \left(y \leq 2.5 \cdot 10^{-66}\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{t}{z - y}\\ \end{array} \]
Alternative 7
Error16.6
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{+31} \lor \neg \left(y \leq 7.2 \cdot 10^{+27}\right):\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \end{array} \]
Alternative 8
Error16.6
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{+30}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+27}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \end{array} \]
Alternative 9
Error16.6
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{+31}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+27}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \end{array} \]
Alternative 10
Error16.6
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+32}:\\ \;\;\;\;\frac{t}{\frac{y}{y - x}}\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+27}:\\ \;\;\;\;\frac{t}{\frac{z}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;t - t \cdot \frac{x}{y}\\ \end{array} \]
Alternative 11
Error37.4
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-20}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{-113}:\\ \;\;\;\;y \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 12
Error25.7
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -2.35 \cdot 10^{+33}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-67}:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 13
Error24.6
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+30}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{+27}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 14
Error24.6
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -8.8 \cdot 10^{+30}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+26}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 15
Error2.1
Cost576
\[t \cdot \frac{x - y}{z - y} \]
Alternative 16
Error39.6
Cost64
\[t \]

Error

Reproduce

herbie shell --seed 2023010 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
  :precision binary64

  :herbie-target
  (/ t (/ (- z y) (- x y)))

  (* (/ (- x y) (- z y)) t))