Rosa's DopplerBench

Percentage Accurate: 72.3% → 97.8%
Time: 7.9s
Alternatives: 10
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 10 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 72.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Alternative 1: 97.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (* (/ (- t1) (+ t1 u)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 / (t1 + u)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (t1 + u));
}
def code(u, v, t1):
	return (-t1 / (t1 + u)) * (v / (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 / (t1 + u)) * (v / (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
\end{array}
Derivation
  1. Initial program 78.2%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac97.7%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  3. Simplified97.7%

    \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  4. Final simplification97.7%

    \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u} \]

Alternative 2: 77.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{v}{u \cdot -2 - t1}\\ t_2 := \frac{-t1}{u}\\ t_3 := \frac{v}{t1 + u} \cdot t_2\\ \mathbf{if}\;u \leq -8.8 \cdot 10^{-24}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;u \leq 3 \cdot 10^{-57}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;u \leq 1.25 \cdot 10^{-17}:\\ \;\;\;\;t_2 \cdot \frac{v}{u}\\ \mathbf{elif}\;u \leq 4.4 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ v (- (* u -2.0) t1)))
        (t_2 (/ (- t1) u))
        (t_3 (* (/ v (+ t1 u)) t_2)))
   (if (<= u -8.8e-24)
     t_3
     (if (<= u 3e-57)
       t_1
       (if (<= u 1.25e-17) (* t_2 (/ v u)) (if (<= u 4.4e+17) t_1 t_3))))))
double code(double u, double v, double t1) {
	double t_1 = v / ((u * -2.0) - t1);
	double t_2 = -t1 / u;
	double t_3 = (v / (t1 + u)) * t_2;
	double tmp;
	if (u <= -8.8e-24) {
		tmp = t_3;
	} else if (u <= 3e-57) {
		tmp = t_1;
	} else if (u <= 1.25e-17) {
		tmp = t_2 * (v / u);
	} else if (u <= 4.4e+17) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = v / ((u * (-2.0d0)) - t1)
    t_2 = -t1 / u
    t_3 = (v / (t1 + u)) * t_2
    if (u <= (-8.8d-24)) then
        tmp = t_3
    else if (u <= 3d-57) then
        tmp = t_1
    else if (u <= 1.25d-17) then
        tmp = t_2 * (v / u)
    else if (u <= 4.4d+17) then
        tmp = t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = v / ((u * -2.0) - t1);
	double t_2 = -t1 / u;
	double t_3 = (v / (t1 + u)) * t_2;
	double tmp;
	if (u <= -8.8e-24) {
		tmp = t_3;
	} else if (u <= 3e-57) {
		tmp = t_1;
	} else if (u <= 1.25e-17) {
		tmp = t_2 * (v / u);
	} else if (u <= 4.4e+17) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = v / ((u * -2.0) - t1)
	t_2 = -t1 / u
	t_3 = (v / (t1 + u)) * t_2
	tmp = 0
	if u <= -8.8e-24:
		tmp = t_3
	elif u <= 3e-57:
		tmp = t_1
	elif u <= 1.25e-17:
		tmp = t_2 * (v / u)
	elif u <= 4.4e+17:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(u, v, t1)
	t_1 = Float64(v / Float64(Float64(u * -2.0) - t1))
	t_2 = Float64(Float64(-t1) / u)
	t_3 = Float64(Float64(v / Float64(t1 + u)) * t_2)
	tmp = 0.0
	if (u <= -8.8e-24)
		tmp = t_3;
	elseif (u <= 3e-57)
		tmp = t_1;
	elseif (u <= 1.25e-17)
		tmp = Float64(t_2 * Float64(v / u));
	elseif (u <= 4.4e+17)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = v / ((u * -2.0) - t1);
	t_2 = -t1 / u;
	t_3 = (v / (t1 + u)) * t_2;
	tmp = 0.0;
	if (u <= -8.8e-24)
		tmp = t_3;
	elseif (u <= 3e-57)
		tmp = t_1;
	elseif (u <= 1.25e-17)
		tmp = t_2 * (v / u);
	elseif (u <= 4.4e+17)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-t1) / u), $MachinePrecision]}, Block[{t$95$3 = N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[u, -8.8e-24], t$95$3, If[LessEqual[u, 3e-57], t$95$1, If[LessEqual[u, 1.25e-17], N[(t$95$2 * N[(v / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 4.4e+17], t$95$1, t$95$3]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{v}{u \cdot -2 - t1}\\
t_2 := \frac{-t1}{u}\\
t_3 := \frac{v}{t1 + u} \cdot t_2\\
\mathbf{if}\;u \leq -8.8 \cdot 10^{-24}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;u \leq 3 \cdot 10^{-57}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;u \leq 1.25 \cdot 10^{-17}:\\
\;\;\;\;t_2 \cdot \frac{v}{u}\\

\mathbf{elif}\;u \leq 4.4 \cdot 10^{+17}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -8.80000000000000006e-24 or 4.4e17 < u

    1. Initial program 79.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.3%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified98.3%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 83.9%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. associate-*r/83.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg83.9%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    6. Simplified83.9%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]

    if -8.80000000000000006e-24 < u < 3.00000000000000001e-57 or 1.25e-17 < u < 4.4e17

    1. Initial program 77.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*83.7%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. *-commutative83.7%

        \[\leadsto \frac{\frac{\color{blue}{v \cdot \left(-t1\right)}}{t1 + u}}{t1 + u} \]
      3. associate-/l*97.8%

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/99.9%

        \[\leadsto \color{blue}{\frac{v}{\left(t1 + u\right) \cdot \frac{t1 + u}{-t1}}} \]
      5. +-commutative99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{\color{blue}{u + t1}}{-t1}} \]
      6. remove-double-neg99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{u + \color{blue}{\left(-\left(-t1\right)\right)}}{-t1}} \]
      7. unsub-neg99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{\color{blue}{u - \left(-t1\right)}}{-t1}} \]
      8. div-sub99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \color{blue}{\left(\frac{u}{-t1} - \frac{-t1}{-t1}\right)}} \]
      9. sub-neg99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \color{blue}{\left(\frac{u}{-t1} + \left(-\frac{-t1}{-t1}\right)\right)}} \]
      10. *-inverses99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \color{blue}{-1}\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + -1\right)}} \]
    4. Taylor expanded in t1 around inf 86.3%

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    5. Step-by-step derivation
      1. mul-1-neg86.3%

        \[\leadsto \frac{v}{-2 \cdot u + \color{blue}{\left(-t1\right)}} \]
      2. unsub-neg86.3%

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative86.3%

        \[\leadsto \frac{v}{\color{blue}{u \cdot -2} - t1} \]
    6. Simplified86.3%

      \[\leadsto \frac{v}{\color{blue}{u \cdot -2 - t1}} \]

    if 3.00000000000000001e-57 < u < 1.25e-17

    1. Initial program 78.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac100.0%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 78.5%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. associate-*r/78.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg78.5%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    6. Simplified78.5%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    7. Taylor expanded in t1 around 0 78.8%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -8.8 \cdot 10^{-24}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\ \mathbf{elif}\;u \leq 3 \cdot 10^{-57}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;u \leq 1.25 \cdot 10^{-17}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \mathbf{elif}\;u \leq 4.4 \cdot 10^{+17}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\ \end{array} \]

Alternative 3: 79.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -2.65 \cdot 10^{-107} \lor \neg \left(t1 \leq 3.6 \cdot 10^{-50}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -2.65e-107) (not (<= t1 3.6e-50)))
   (/ v (- (* u -2.0) t1))
   (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.65e-107) || !(t1 <= 3.6e-50)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = (-t1 / u) * (v / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-2.65d-107)) .or. (.not. (t1 <= 3.6d-50))) then
        tmp = v / ((u * (-2.0d0)) - t1)
    else
        tmp = (-t1 / u) * (v / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.65e-107) || !(t1 <= 3.6e-50)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = (-t1 / u) * (v / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -2.65e-107) or not (t1 <= 3.6e-50):
		tmp = v / ((u * -2.0) - t1)
	else:
		tmp = (-t1 / u) * (v / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -2.65e-107) || !(t1 <= 3.6e-50))
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	else
		tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -2.65e-107) || ~((t1 <= 3.6e-50)))
		tmp = v / ((u * -2.0) - t1);
	else
		tmp = (-t1 / u) * (v / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.65e-107], N[Not[LessEqual[t1, 3.6e-50]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.65 \cdot 10^{-107} \lor \neg \left(t1 \leq 3.6 \cdot 10^{-50}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -2.65e-107 or 3.59999999999999979e-50 < t1

    1. Initial program 76.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*85.0%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. *-commutative85.0%

        \[\leadsto \frac{\frac{\color{blue}{v \cdot \left(-t1\right)}}{t1 + u}}{t1 + u} \]
      3. associate-/l*99.9%

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/95.4%

        \[\leadsto \color{blue}{\frac{v}{\left(t1 + u\right) \cdot \frac{t1 + u}{-t1}}} \]
      5. +-commutative95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{\color{blue}{u + t1}}{-t1}} \]
      6. remove-double-neg95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{u + \color{blue}{\left(-\left(-t1\right)\right)}}{-t1}} \]
      7. unsub-neg95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{\color{blue}{u - \left(-t1\right)}}{-t1}} \]
      8. div-sub95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \color{blue}{\left(\frac{u}{-t1} - \frac{-t1}{-t1}\right)}} \]
      9. sub-neg95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \color{blue}{\left(\frac{u}{-t1} + \left(-\frac{-t1}{-t1}\right)\right)}} \]
      10. *-inverses95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \color{blue}{-1}\right)} \]
    3. Simplified95.4%

      \[\leadsto \color{blue}{\frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + -1\right)}} \]
    4. Taylor expanded in t1 around inf 81.0%

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    5. Step-by-step derivation
      1. mul-1-neg81.0%

        \[\leadsto \frac{v}{-2 \cdot u + \color{blue}{\left(-t1\right)}} \]
      2. unsub-neg81.0%

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative81.0%

        \[\leadsto \frac{v}{\color{blue}{u \cdot -2} - t1} \]
    6. Simplified81.0%

      \[\leadsto \frac{v}{\color{blue}{u \cdot -2 - t1}} \]

    if -2.65e-107 < t1 < 3.59999999999999979e-50

    1. Initial program 82.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac93.5%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified93.5%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 80.5%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. associate-*r/80.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg80.5%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    6. Simplified80.5%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    7. Taylor expanded in t1 around 0 81.0%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -2.65 \cdot 10^{-107} \lor \neg \left(t1 \leq 3.6 \cdot 10^{-50}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \]

Alternative 4: 79.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -5.8 \cdot 10^{-108} \lor \neg \left(t1 \leq 3.5 \cdot 10^{-50}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t1}{u} \cdot \left(-v\right)}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -5.8e-108) (not (<= t1 3.5e-50)))
   (/ v (- (* u -2.0) t1))
   (/ (* (/ t1 u) (- v)) u)))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -5.8e-108) || !(t1 <= 3.5e-50)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = ((t1 / u) * -v) / u;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-5.8d-108)) .or. (.not. (t1 <= 3.5d-50))) then
        tmp = v / ((u * (-2.0d0)) - t1)
    else
        tmp = ((t1 / u) * -v) / u
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -5.8e-108) || !(t1 <= 3.5e-50)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = ((t1 / u) * -v) / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -5.8e-108) or not (t1 <= 3.5e-50):
		tmp = v / ((u * -2.0) - t1)
	else:
		tmp = ((t1 / u) * -v) / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -5.8e-108) || !(t1 <= 3.5e-50))
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	else
		tmp = Float64(Float64(Float64(t1 / u) * Float64(-v)) / u);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -5.8e-108) || ~((t1 <= 3.5e-50)))
		tmp = v / ((u * -2.0) - t1);
	else
		tmp = ((t1 / u) * -v) / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.8e-108], N[Not[LessEqual[t1, 3.5e-50]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t1 / u), $MachinePrecision] * (-v)), $MachinePrecision] / u), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.8 \cdot 10^{-108} \lor \neg \left(t1 \leq 3.5 \cdot 10^{-50}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{t1}{u} \cdot \left(-v\right)}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -5.8000000000000002e-108 or 3.49999999999999997e-50 < t1

    1. Initial program 76.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*85.0%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. *-commutative85.0%

        \[\leadsto \frac{\frac{\color{blue}{v \cdot \left(-t1\right)}}{t1 + u}}{t1 + u} \]
      3. associate-/l*99.9%

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/95.4%

        \[\leadsto \color{blue}{\frac{v}{\left(t1 + u\right) \cdot \frac{t1 + u}{-t1}}} \]
      5. +-commutative95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{\color{blue}{u + t1}}{-t1}} \]
      6. remove-double-neg95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{u + \color{blue}{\left(-\left(-t1\right)\right)}}{-t1}} \]
      7. unsub-neg95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{\color{blue}{u - \left(-t1\right)}}{-t1}} \]
      8. div-sub95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \color{blue}{\left(\frac{u}{-t1} - \frac{-t1}{-t1}\right)}} \]
      9. sub-neg95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \color{blue}{\left(\frac{u}{-t1} + \left(-\frac{-t1}{-t1}\right)\right)}} \]
      10. *-inverses95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval95.4%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \color{blue}{-1}\right)} \]
    3. Simplified95.4%

      \[\leadsto \color{blue}{\frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + -1\right)}} \]
    4. Taylor expanded in t1 around inf 81.0%

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    5. Step-by-step derivation
      1. mul-1-neg81.0%

        \[\leadsto \frac{v}{-2 \cdot u + \color{blue}{\left(-t1\right)}} \]
      2. unsub-neg81.0%

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative81.0%

        \[\leadsto \frac{v}{\color{blue}{u \cdot -2} - t1} \]
    6. Simplified81.0%

      \[\leadsto \frac{v}{\color{blue}{u \cdot -2 - t1}} \]

    if -5.8000000000000002e-108 < t1 < 3.49999999999999997e-50

    1. Initial program 82.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac93.5%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified93.5%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 80.5%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. associate-*r/80.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg80.5%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    6. Simplified80.5%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    7. Taylor expanded in t1 around 0 81.0%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]
    8. Step-by-step derivation
      1. frac-2neg81.0%

        \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{-v}{-u}} \]
      2. associate-*r/81.7%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{u} \cdot \left(-v\right)}{-u}} \]
      3. add-sqr-sqrt36.1%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{u} \cdot \left(-v\right)}{-u} \]
      4. sqrt-unprod47.1%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{u} \cdot \left(-v\right)}{-u} \]
      5. sqr-neg47.1%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{u} \cdot \left(-v\right)}{-u} \]
      6. sqrt-unprod21.4%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{u} \cdot \left(-v\right)}{-u} \]
      7. add-sqr-sqrt44.3%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{u} \cdot \left(-v\right)}{-u} \]
      8. add-sqr-sqrt27.0%

        \[\leadsto \frac{\frac{t1}{u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      9. sqrt-unprod61.2%

        \[\leadsto \frac{\frac{t1}{u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      10. sqr-neg61.2%

        \[\leadsto \frac{\frac{t1}{u} \cdot \left(-v\right)}{\sqrt{\color{blue}{u \cdot u}}} \]
      11. sqrt-unprod38.5%

        \[\leadsto \frac{\frac{t1}{u} \cdot \left(-v\right)}{\color{blue}{\sqrt{u} \cdot \sqrt{u}}} \]
      12. add-sqr-sqrt81.7%

        \[\leadsto \frac{\frac{t1}{u} \cdot \left(-v\right)}{\color{blue}{u}} \]
    9. Applied egg-rr81.7%

      \[\leadsto \color{blue}{\frac{\frac{t1}{u} \cdot \left(-v\right)}{u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -5.8 \cdot 10^{-108} \lor \neg \left(t1 \leq 3.5 \cdot 10^{-50}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t1}{u} \cdot \left(-v\right)}{u}\\ \end{array} \]

Alternative 5: 67.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -4.3 \cdot 10^{+27} \lor \neg \left(u \leq 3.5 \cdot 10^{+91}\right):\\ \;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -4.3e+27) (not (<= u 3.5e+91)))
   (/ t1 (/ u (/ v u)))
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -4.3e+27) || !(u <= 3.5e+91)) {
		tmp = t1 / (u / (v / u));
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-4.3d+27)) .or. (.not. (u <= 3.5d+91))) then
        tmp = t1 / (u / (v / u))
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -4.3e+27) || !(u <= 3.5e+91)) {
		tmp = t1 / (u / (v / u));
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -4.3e+27) or not (u <= 3.5e+91):
		tmp = t1 / (u / (v / u))
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -4.3e+27) || !(u <= 3.5e+91))
		tmp = Float64(t1 / Float64(u / Float64(v / u)));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -4.3e+27) || ~((u <= 3.5e+91)))
		tmp = t1 / (u / (v / u));
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.3e+27], N[Not[LessEqual[u, 3.5e+91]], $MachinePrecision]], N[(t1 / N[(u / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.3 \cdot 10^{+27} \lor \neg \left(u \leq 3.5 \cdot 10^{+91}\right):\\
\;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -4.30000000000000008e27 or 3.50000000000000001e91 < u

    1. Initial program 80.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified97.9%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 89.1%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. associate-*r/89.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg89.1%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    6. Simplified89.1%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    7. Taylor expanded in t1 around 0 86.3%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]
    8. Step-by-step derivation
      1. associate-*l/88.2%

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot \frac{v}{u}}{u}} \]
      2. associate-/l*87.3%

        \[\leadsto \color{blue}{\frac{-t1}{\frac{u}{\frac{v}{u}}}} \]
      3. add-sqr-sqrt48.2%

        \[\leadsto \frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{\frac{u}{\frac{v}{u}}} \]
      4. sqrt-unprod57.3%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{\frac{u}{\frac{v}{u}}} \]
      5. sqr-neg57.3%

        \[\leadsto \frac{\sqrt{\color{blue}{t1 \cdot t1}}}{\frac{u}{\frac{v}{u}}} \]
      6. sqrt-unprod25.9%

        \[\leadsto \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{\frac{u}{\frac{v}{u}}} \]
      7. add-sqr-sqrt65.9%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{u}{\frac{v}{u}}} \]
    9. Applied egg-rr65.9%

      \[\leadsto \color{blue}{\frac{t1}{\frac{u}{\frac{v}{u}}}} \]

    if -4.30000000000000008e27 < u < 3.50000000000000001e91

    1. Initial program 76.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.6%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified97.6%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around inf 75.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    5. Step-by-step derivation
      1. associate-*r/75.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-175.3%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    6. Simplified75.3%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification71.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -4.3 \cdot 10^{+27} \lor \neg \left(u \leq 3.5 \cdot 10^{+91}\right):\\ \;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 6: 67.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -4.3 \cdot 10^{+27} \lor \neg \left(u \leq 4.2 \cdot 10^{+93}\right):\\ \;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -4.3e+27) (not (<= u 4.2e+93)))
   (/ t1 (/ u (/ v u)))
   (/ v (- (* u -2.0) t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -4.3e+27) || !(u <= 4.2e+93)) {
		tmp = t1 / (u / (v / u));
	} else {
		tmp = v / ((u * -2.0) - t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-4.3d+27)) .or. (.not. (u <= 4.2d+93))) then
        tmp = t1 / (u / (v / u))
    else
        tmp = v / ((u * (-2.0d0)) - t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -4.3e+27) || !(u <= 4.2e+93)) {
		tmp = t1 / (u / (v / u));
	} else {
		tmp = v / ((u * -2.0) - t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -4.3e+27) or not (u <= 4.2e+93):
		tmp = t1 / (u / (v / u))
	else:
		tmp = v / ((u * -2.0) - t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -4.3e+27) || !(u <= 4.2e+93))
		tmp = Float64(t1 / Float64(u / Float64(v / u)));
	else
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -4.3e+27) || ~((u <= 4.2e+93)))
		tmp = t1 / (u / (v / u));
	else
		tmp = v / ((u * -2.0) - t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.3e+27], N[Not[LessEqual[u, 4.2e+93]], $MachinePrecision]], N[(t1 / N[(u / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.3 \cdot 10^{+27} \lor \neg \left(u \leq 4.2 \cdot 10^{+93}\right):\\
\;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -4.30000000000000008e27 or 4.1999999999999996e93 < u

    1. Initial program 80.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.8%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified97.8%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 89.8%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. associate-*r/89.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg89.8%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    6. Simplified89.8%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    7. Taylor expanded in t1 around 0 87.0%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]
    8. Step-by-step derivation
      1. associate-*l/89.0%

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot \frac{v}{u}}{u}} \]
      2. associate-/l*88.0%

        \[\leadsto \color{blue}{\frac{-t1}{\frac{u}{\frac{v}{u}}}} \]
      3. add-sqr-sqrt49.2%

        \[\leadsto \frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{\frac{u}{\frac{v}{u}}} \]
      4. sqrt-unprod57.4%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{\frac{u}{\frac{v}{u}}} \]
      5. sqr-neg57.4%

        \[\leadsto \frac{\sqrt{\color{blue}{t1 \cdot t1}}}{\frac{u}{\frac{v}{u}}} \]
      6. sqrt-unprod25.3%

        \[\leadsto \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{\frac{u}{\frac{v}{u}}} \]
      7. add-sqr-sqrt66.1%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{u}{\frac{v}{u}}} \]
    9. Applied egg-rr66.1%

      \[\leadsto \color{blue}{\frac{t1}{\frac{u}{\frac{v}{u}}}} \]

    if -4.30000000000000008e27 < u < 4.1999999999999996e93

    1. Initial program 77.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*84.3%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. *-commutative84.3%

        \[\leadsto \frac{\frac{\color{blue}{v \cdot \left(-t1\right)}}{t1 + u}}{t1 + u} \]
      3. associate-/l*98.0%

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/99.9%

        \[\leadsto \color{blue}{\frac{v}{\left(t1 + u\right) \cdot \frac{t1 + u}{-t1}}} \]
      5. +-commutative99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{\color{blue}{u + t1}}{-t1}} \]
      6. remove-double-neg99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{u + \color{blue}{\left(-\left(-t1\right)\right)}}{-t1}} \]
      7. unsub-neg99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{\color{blue}{u - \left(-t1\right)}}{-t1}} \]
      8. div-sub99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \color{blue}{\left(\frac{u}{-t1} - \frac{-t1}{-t1}\right)}} \]
      9. sub-neg99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \color{blue}{\left(\frac{u}{-t1} + \left(-\frac{-t1}{-t1}\right)\right)}} \]
      10. *-inverses99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval99.9%

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \color{blue}{-1}\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + -1\right)}} \]
    4. Taylor expanded in t1 around inf 76.7%

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    5. Step-by-step derivation
      1. mul-1-neg76.7%

        \[\leadsto \frac{v}{-2 \cdot u + \color{blue}{\left(-t1\right)}} \]
      2. unsub-neg76.7%

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative76.7%

        \[\leadsto \frac{v}{\color{blue}{u \cdot -2} - t1} \]
    6. Simplified76.7%

      \[\leadsto \frac{v}{\color{blue}{u \cdot -2 - t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -4.3 \cdot 10^{+27} \lor \neg \left(u \leq 4.2 \cdot 10^{+93}\right):\\ \;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \]

Alternative 7: 22.2% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.5 \cdot 10^{+199} \lor \neg \left(t1 \leq 2.3 \cdot 10^{+57}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -1.5e+199) (not (<= t1 2.3e+57))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.5e+199) || !(t1 <= 2.3e+57)) {
		tmp = v / t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-1.5d+199)) .or. (.not. (t1 <= 2.3d+57))) then
        tmp = v / t1
    else
        tmp = v / u
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.5e+199) || !(t1 <= 2.3e+57)) {
		tmp = v / t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -1.5e+199) or not (t1 <= 2.3e+57):
		tmp = v / t1
	else:
		tmp = v / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -1.5e+199) || !(t1 <= 2.3e+57))
		tmp = Float64(v / t1);
	else
		tmp = Float64(v / u);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -1.5e+199) || ~((t1 <= 2.3e+57)))
		tmp = v / t1;
	else
		tmp = v / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.5e+199], N[Not[LessEqual[t1, 2.3e+57]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.5 \cdot 10^{+199} \lor \neg \left(t1 \leq 2.3 \cdot 10^{+57}\right):\\
\;\;\;\;\frac{v}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.5e199 or 2.2999999999999999e57 < t1

    1. Initial program 63.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      2. clear-num98.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \cdot \frac{-t1}{t1 + u} \]
      3. frac-2neg98.6%

        \[\leadsto \frac{1}{\frac{t1 + u}{v}} \cdot \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \]
      4. frac-times77.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-\left(-t1\right)\right)}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)}} \]
      5. *-un-lft-identity77.3%

        \[\leadsto \frac{\color{blue}{-\left(-t1\right)}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      6. remove-double-neg77.3%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      7. distribute-neg-in77.3%

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      8. add-sqr-sqrt24.1%

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      9. sqrt-unprod48.9%

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      10. sqr-neg48.9%

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      11. sqrt-unprod31.1%

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      12. add-sqr-sqrt51.3%

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
      13. sub-neg51.3%

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \color{blue}{\left(t1 - u\right)}} \]
    5. Applied egg-rr51.3%

      \[\leadsto \color{blue}{\frac{t1}{\frac{t1 + u}{v} \cdot \left(t1 - u\right)}} \]
    6. Taylor expanded in t1 around inf 44.4%

      \[\leadsto \color{blue}{\frac{v}{t1}} \]

    if -1.5e199 < t1 < 2.2999999999999999e57

    1. Initial program 84.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac96.7%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified96.7%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Step-by-step derivation
      1. clear-num96.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{t1 + u}{-t1}}} \cdot \frac{v}{t1 + u} \]
      2. frac-times94.6%

        \[\leadsto \color{blue}{\frac{1 \cdot v}{\frac{t1 + u}{-t1} \cdot \left(t1 + u\right)}} \]
      3. *-un-lft-identity94.6%

        \[\leadsto \frac{\color{blue}{v}}{\frac{t1 + u}{-t1} \cdot \left(t1 + u\right)} \]
      4. frac-2neg94.6%

        \[\leadsto \frac{v}{\color{blue}{\frac{-\left(t1 + u\right)}{-\left(-t1\right)}} \cdot \left(t1 + u\right)} \]
      5. distribute-neg-in94.6%

        \[\leadsto \frac{v}{\frac{\color{blue}{\left(-t1\right) + \left(-u\right)}}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      6. add-sqr-sqrt53.0%

        \[\leadsto \frac{v}{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      7. sqrt-unprod76.4%

        \[\leadsto \frac{v}{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      8. sqr-neg76.4%

        \[\leadsto \frac{v}{\frac{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      9. sqrt-unprod26.3%

        \[\leadsto \frac{v}{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      10. add-sqr-sqrt57.9%

        \[\leadsto \frac{v}{\frac{\color{blue}{t1} + \left(-u\right)}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      11. sub-neg57.9%

        \[\leadsto \frac{v}{\frac{\color{blue}{t1 - u}}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      12. remove-double-neg57.9%

        \[\leadsto \frac{v}{\frac{t1 - u}{\color{blue}{t1}} \cdot \left(t1 + u\right)} \]
    5. Applied egg-rr57.9%

      \[\leadsto \color{blue}{\frac{v}{\frac{t1 - u}{t1} \cdot \left(t1 + u\right)}} \]
    6. Step-by-step derivation
      1. associate-/l/59.5%

        \[\leadsto \color{blue}{\frac{\frac{v}{t1 + u}}{\frac{t1 - u}{t1}}} \]
    7. Simplified59.5%

      \[\leadsto \color{blue}{\frac{\frac{v}{t1 + u}}{\frac{t1 - u}{t1}}} \]
    8. Taylor expanded in t1 around 0 60.0%

      \[\leadsto \frac{\color{blue}{\frac{v}{u}}}{\frac{t1 - u}{t1}} \]
    9. Taylor expanded in u around 0 17.8%

      \[\leadsto \color{blue}{\frac{v}{u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification25.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.5 \cdot 10^{+199} \lor \neg \left(t1 \leq 2.3 \cdot 10^{+57}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]

Alternative 8: 61.3% accurate, 1.7× speedup?

\[\begin{array}{l} \\ v \cdot \frac{-1}{t1 - u} \end{array} \]
(FPCore (u v t1) :precision binary64 (* v (/ -1.0 (- t1 u))))
double code(double u, double v, double t1) {
	return v * (-1.0 / (t1 - u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = v * ((-1.0d0) / (t1 - u))
end function
public static double code(double u, double v, double t1) {
	return v * (-1.0 / (t1 - u));
}
def code(u, v, t1):
	return v * (-1.0 / (t1 - u))
function code(u, v, t1)
	return Float64(v * Float64(-1.0 / Float64(t1 - u)))
end
function tmp = code(u, v, t1)
	tmp = v * (-1.0 / (t1 - u));
end
code[u_, v_, t1_] := N[(v * N[(-1.0 / N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
v \cdot \frac{-1}{t1 - u}
\end{array}
Derivation
  1. Initial program 78.2%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. frac-times97.7%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    2. associate-*r/98.0%

      \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot v}{t1 + u}} \]
    3. div-inv97.8%

      \[\leadsto \color{blue}{\left(\frac{-t1}{t1 + u} \cdot v\right) \cdot \frac{1}{t1 + u}} \]
    4. clear-num97.5%

      \[\leadsto \left(\color{blue}{\frac{1}{\frac{t1 + u}{-t1}}} \cdot v\right) \cdot \frac{1}{t1 + u} \]
    5. associate-*l/97.4%

      \[\leadsto \color{blue}{\frac{1 \cdot v}{\frac{t1 + u}{-t1}}} \cdot \frac{1}{t1 + u} \]
    6. *-un-lft-identity97.4%

      \[\leadsto \frac{\color{blue}{v}}{\frac{t1 + u}{-t1}} \cdot \frac{1}{t1 + u} \]
    7. frac-2neg97.4%

      \[\leadsto \frac{v}{\color{blue}{\frac{-\left(t1 + u\right)}{-\left(-t1\right)}}} \cdot \frac{1}{t1 + u} \]
    8. distribute-neg-in97.4%

      \[\leadsto \frac{v}{\frac{\color{blue}{\left(-t1\right) + \left(-u\right)}}{-\left(-t1\right)}} \cdot \frac{1}{t1 + u} \]
    9. add-sqr-sqrt46.1%

      \[\leadsto \frac{v}{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)}{-\left(-t1\right)}} \cdot \frac{1}{t1 + u} \]
    10. sqrt-unprod69.6%

      \[\leadsto \frac{v}{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)}{-\left(-t1\right)}} \cdot \frac{1}{t1 + u} \]
    11. sqr-neg69.6%

      \[\leadsto \frac{v}{\frac{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)}{-\left(-t1\right)}} \cdot \frac{1}{t1 + u} \]
    12. sqrt-unprod28.6%

      \[\leadsto \frac{v}{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)}{-\left(-t1\right)}} \cdot \frac{1}{t1 + u} \]
    13. add-sqr-sqrt57.7%

      \[\leadsto \frac{v}{\frac{\color{blue}{t1} + \left(-u\right)}{-\left(-t1\right)}} \cdot \frac{1}{t1 + u} \]
    14. sub-neg57.7%

      \[\leadsto \frac{v}{\frac{\color{blue}{t1 - u}}{-\left(-t1\right)}} \cdot \frac{1}{t1 + u} \]
    15. remove-double-neg57.7%

      \[\leadsto \frac{v}{\frac{t1 - u}{\color{blue}{t1}}} \cdot \frac{1}{t1 + u} \]
    16. frac-2neg57.7%

      \[\leadsto \frac{v}{\frac{t1 - u}{t1}} \cdot \color{blue}{\frac{-1}{-\left(t1 + u\right)}} \]
    17. metadata-eval57.7%

      \[\leadsto \frac{v}{\frac{t1 - u}{t1}} \cdot \frac{\color{blue}{-1}}{-\left(t1 + u\right)} \]
    18. distribute-neg-in57.7%

      \[\leadsto \frac{v}{\frac{t1 - u}{t1}} \cdot \frac{-1}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
    19. add-sqr-sqrt29.1%

      \[\leadsto \frac{v}{\frac{t1 - u}{t1}} \cdot \frac{-1}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
    20. sqrt-unprod72.0%

      \[\leadsto \frac{v}{\frac{t1 - u}{t1}} \cdot \frac{-1}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
    21. sqr-neg72.0%

      \[\leadsto \frac{v}{\frac{t1 - u}{t1}} \cdot \frac{-1}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
    22. sqrt-unprod50.2%

      \[\leadsto \frac{v}{\frac{t1 - u}{t1}} \cdot \frac{-1}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
    23. add-sqr-sqrt95.7%

      \[\leadsto \frac{v}{\frac{t1 - u}{t1}} \cdot \frac{-1}{\color{blue}{t1} + \left(-u\right)} \]
  3. Applied egg-rr95.7%

    \[\leadsto \color{blue}{\frac{v}{\frac{t1 - u}{t1}} \cdot \frac{-1}{t1 - u}} \]
  4. Taylor expanded in t1 around inf 63.4%

    \[\leadsto \color{blue}{v} \cdot \frac{-1}{t1 - u} \]
  5. Final simplification63.4%

    \[\leadsto v \cdot \frac{-1}{t1 - u} \]

Alternative 9: 55.3% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -3.4 \cdot 10^{+91}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1) :precision binary64 (if (<= u -3.4e+91) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -3.4e+91) {
		tmp = v / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-3.4d+91)) then
        tmp = v / u
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -3.4e+91) {
		tmp = v / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -3.4e+91:
		tmp = v / u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -3.4e+91)
		tmp = Float64(v / u);
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -3.4e+91)
		tmp = v / u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -3.4e+91], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.4 \cdot 10^{+91}:\\
\;\;\;\;\frac{v}{u}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.4000000000000001e91

    1. Initial program 82.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.6%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified97.6%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Step-by-step derivation
      1. clear-num95.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{t1 + u}{-t1}}} \cdot \frac{v}{t1 + u} \]
      2. frac-times84.9%

        \[\leadsto \color{blue}{\frac{1 \cdot v}{\frac{t1 + u}{-t1} \cdot \left(t1 + u\right)}} \]
      3. *-un-lft-identity84.9%

        \[\leadsto \frac{\color{blue}{v}}{\frac{t1 + u}{-t1} \cdot \left(t1 + u\right)} \]
      4. frac-2neg84.9%

        \[\leadsto \frac{v}{\color{blue}{\frac{-\left(t1 + u\right)}{-\left(-t1\right)}} \cdot \left(t1 + u\right)} \]
      5. distribute-neg-in84.9%

        \[\leadsto \frac{v}{\frac{\color{blue}{\left(-t1\right) + \left(-u\right)}}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      6. add-sqr-sqrt47.9%

        \[\leadsto \frac{v}{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      7. sqrt-unprod82.8%

        \[\leadsto \frac{v}{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      8. sqr-neg82.8%

        \[\leadsto \frac{v}{\frac{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      9. sqrt-unprod37.0%

        \[\leadsto \frac{v}{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      10. add-sqr-sqrt84.9%

        \[\leadsto \frac{v}{\frac{\color{blue}{t1} + \left(-u\right)}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      11. sub-neg84.9%

        \[\leadsto \frac{v}{\frac{\color{blue}{t1 - u}}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
      12. remove-double-neg84.9%

        \[\leadsto \frac{v}{\frac{t1 - u}{\color{blue}{t1}} \cdot \left(t1 + u\right)} \]
    5. Applied egg-rr84.9%

      \[\leadsto \color{blue}{\frac{v}{\frac{t1 - u}{t1} \cdot \left(t1 + u\right)}} \]
    6. Step-by-step derivation
      1. associate-/l/95.5%

        \[\leadsto \color{blue}{\frac{\frac{v}{t1 + u}}{\frac{t1 - u}{t1}}} \]
    7. Simplified95.5%

      \[\leadsto \color{blue}{\frac{\frac{v}{t1 + u}}{\frac{t1 - u}{t1}}} \]
    8. Taylor expanded in t1 around 0 95.5%

      \[\leadsto \frac{\color{blue}{\frac{v}{u}}}{\frac{t1 - u}{t1}} \]
    9. Taylor expanded in u around 0 48.2%

      \[\leadsto \color{blue}{\frac{v}{u}} \]

    if -3.4000000000000001e91 < u

    1. Initial program 77.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.7%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified97.7%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around inf 64.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    5. Step-by-step derivation
      1. associate-*r/64.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-164.9%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    6. Simplified64.9%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.4 \cdot 10^{+91}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 10: 13.9% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \frac{v}{t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ v t1))
double code(double u, double v, double t1) {
	return v / t1;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = v / t1
end function
public static double code(double u, double v, double t1) {
	return v / t1;
}
def code(u, v, t1):
	return v / t1
function code(u, v, t1)
	return Float64(v / t1)
end
function tmp = code(u, v, t1)
	tmp = v / t1;
end
code[u_, v_, t1_] := N[(v / t1), $MachinePrecision]
\begin{array}{l}

\\
\frac{v}{t1}
\end{array}
Derivation
  1. Initial program 78.2%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac97.7%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  3. Simplified97.7%

    \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  4. Step-by-step derivation
    1. *-commutative97.7%

      \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
    2. clear-num97.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \cdot \frac{-t1}{t1 + u} \]
    3. frac-2neg97.1%

      \[\leadsto \frac{1}{\frac{t1 + u}{v}} \cdot \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \]
    4. frac-times84.8%

      \[\leadsto \color{blue}{\frac{1 \cdot \left(-\left(-t1\right)\right)}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)}} \]
    5. *-un-lft-identity84.8%

      \[\leadsto \frac{\color{blue}{-\left(-t1\right)}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
    6. remove-double-neg84.8%

      \[\leadsto \frac{\color{blue}{t1}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
    7. distribute-neg-in84.8%

      \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
    8. add-sqr-sqrt42.4%

      \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
    9. sqrt-unprod66.2%

      \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
    10. sqr-neg66.2%

      \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
    11. sqrt-unprod26.4%

      \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
    12. add-sqr-sqrt55.4%

      \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
    13. sub-neg55.4%

      \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \color{blue}{\left(t1 - u\right)}} \]
  5. Applied egg-rr55.4%

    \[\leadsto \color{blue}{\frac{t1}{\frac{t1 + u}{v} \cdot \left(t1 - u\right)}} \]
  6. Taylor expanded in t1 around inf 17.0%

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  7. Final simplification17.0%

    \[\leadsto \frac{v}{t1} \]

Reproduce

?
herbie shell --seed 2023319 
(FPCore (u v t1)
  :name "Rosa's DopplerBench"
  :precision binary64
  (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))