
(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:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (u v t1) :precision binary64 (/ (/ v (+ t1 u)) (/ (+ t1 u) (- t1))))
double code(double u, double v, double t1) {
return (v / (t1 + u)) / ((t1 + u) / -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 + u)) / ((t1 + u) / -t1)
end function
public static double code(double u, double v, double t1) {
return (v / (t1 + u)) / ((t1 + u) / -t1);
}
def code(u, v, t1): return (v / (t1 + u)) / ((t1 + u) / -t1)
function code(u, v, t1) return Float64(Float64(v / Float64(t1 + u)) / Float64(Float64(t1 + u) / Float64(-t1))) end
function tmp = code(u, v, t1) tmp = (v / (t1 + u)) / ((t1 + u) / -t1); end
code[u_, v_, t1_] := N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] / (-t1)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{t1 + u}}{\frac{t1 + u}{-t1}}
\end{array}
Initial program 74.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lower-neg.f64N/A
lower-/.f6498.1
Applied rewrites98.1%
Final simplification98.1%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* (+ t1 u) (+ t1 u)))) (if (<= (/ (* v (- t1)) t_1) 2e+229) (* v (/ (- t1) t_1)) (/ v (- t1)))))
double code(double u, double v, double t1) {
double t_1 = (t1 + u) * (t1 + u);
double tmp;
if (((v * -t1) / t_1) <= 2e+229) {
tmp = v * (-t1 / t_1);
} 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) :: t_1
real(8) :: tmp
t_1 = (t1 + u) * (t1 + u)
if (((v * -t1) / t_1) <= 2d+229) then
tmp = v * (-t1 / t_1)
else
tmp = v / -t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (t1 + u) * (t1 + u);
double tmp;
if (((v * -t1) / t_1) <= 2e+229) {
tmp = v * (-t1 / t_1);
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): t_1 = (t1 + u) * (t1 + u) tmp = 0 if ((v * -t1) / t_1) <= 2e+229: tmp = v * (-t1 / t_1) else: tmp = v / -t1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(t1 + u) * Float64(t1 + u)) tmp = 0.0 if (Float64(Float64(v * Float64(-t1)) / t_1) <= 2e+229) tmp = Float64(v * Float64(Float64(-t1) / t_1)); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (t1 + u) * (t1 + u); tmp = 0.0; if (((v * -t1) / t_1) <= 2e+229) tmp = v * (-t1 / t_1); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(v * (-t1)), $MachinePrecision] / t$95$1), $MachinePrecision], 2e+229], N[(v * N[((-t1) / t$95$1), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t1 + u\right) \cdot \left(t1 + u\right)\\
\mathbf{if}\;\frac{v \cdot \left(-t1\right)}{t\_1} \leq 2 \cdot 10^{+229}:\\
\;\;\;\;v \cdot \frac{-t1}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < 2e229Initial program 85.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6488.4
Applied rewrites88.4%
if 2e229 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) Initial program 20.0%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6472.8
Applied rewrites72.8%
Final simplification85.9%
(FPCore (u v t1) :precision binary64 (if (<= u -5.7e+174) (/ (* v (/ t1 u)) (- (- t1) u)) (/ v (* (+ t1 u) (- -1.0 (/ u t1))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.7e+174) {
tmp = (v * (t1 / u)) / (-t1 - u);
} else {
tmp = v / ((t1 + u) * (-1.0 - (u / 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 <= (-5.7d+174)) then
tmp = (v * (t1 / u)) / (-t1 - u)
else
tmp = v / ((t1 + u) * ((-1.0d0) - (u / t1)))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -5.7e+174) {
tmp = (v * (t1 / u)) / (-t1 - u);
} else {
tmp = v / ((t1 + u) * (-1.0 - (u / t1)));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.7e+174: tmp = (v * (t1 / u)) / (-t1 - u) else: tmp = v / ((t1 + u) * (-1.0 - (u / t1))) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.7e+174) tmp = Float64(Float64(v * Float64(t1 / u)) / Float64(Float64(-t1) - u)); else tmp = Float64(v / Float64(Float64(t1 + u) * Float64(-1.0 - Float64(u / t1)))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -5.7e+174) tmp = (v * (t1 / u)) / (-t1 - u); else tmp = v / ((t1 + u) * (-1.0 - (u / t1))); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.7e+174], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / N[((-t1) - u), $MachinePrecision]), $MachinePrecision], N[(v / N[(N[(t1 + u), $MachinePrecision] * N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.7 \cdot 10^{+174}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{\left(-t1\right) - u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)}\\
\end{array}
\end{array}
if u < -5.6999999999999999e174Initial program 73.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-neg.f64N/A
neg-mul-1N/A
associate-*r*N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
times-fracN/A
lift-neg.f64N/A
frac-2negN/A
associate-*l/N/A
clear-numN/A
lift-/.f64N/A
div-invN/A
lower-/.f64N/A
Applied rewrites99.9%
Taylor expanded in t1 around 0
lower-/.f6499.9
Applied rewrites99.9%
if -5.6999999999999999e174 < u Initial program 75.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lower-neg.f64N/A
lower-/.f6497.9
Applied rewrites97.9%
Taylor expanded in v around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-lft-neg-inN/A
+-commutativeN/A
*-lft-identityN/A
associate-*l/N/A
distribute-neg-inN/A
associate-*l/N/A
*-lft-identityN/A
mul-1-negN/A
sub-negN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6495.9
Applied rewrites95.9%
Final simplification96.2%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (* (+ t1 u) -1.0))))
(if (<= t1 -8.5e-84)
t_1
(if (<= t1 2.2e-51) (* (- t1) (/ v (* u u))) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / ((t1 + u) * -1.0);
double tmp;
if (t1 <= -8.5e-84) {
tmp = t_1;
} else if (t1 <= 2.2e-51) {
tmp = -t1 * (v / (u * u));
} else {
tmp = t_1;
}
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) :: tmp
t_1 = v / ((t1 + u) * (-1.0d0))
if (t1 <= (-8.5d-84)) then
tmp = t_1
else if (t1 <= 2.2d-51) then
tmp = -t1 * (v / (u * u))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v / ((t1 + u) * -1.0);
double tmp;
if (t1 <= -8.5e-84) {
tmp = t_1;
} else if (t1 <= 2.2e-51) {
tmp = -t1 * (v / (u * u));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = v / ((t1 + u) * -1.0) tmp = 0 if t1 <= -8.5e-84: tmp = t_1 elif t1 <= 2.2e-51: tmp = -t1 * (v / (u * u)) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(Float64(t1 + u) * -1.0)) tmp = 0.0 if (t1 <= -8.5e-84) tmp = t_1; elseif (t1 <= 2.2e-51) tmp = Float64(Float64(-t1) * Float64(v / Float64(u * u))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v / ((t1 + u) * -1.0); tmp = 0.0; if (t1 <= -8.5e-84) tmp = t_1; elseif (t1 <= 2.2e-51) tmp = -t1 * (v / (u * u)); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(N[(t1 + u), $MachinePrecision] * -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -8.5e-84], t$95$1, If[LessEqual[t1, 2.2e-51], N[((-t1) * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{\left(t1 + u\right) \cdot -1}\\
\mathbf{if}\;t1 \leq -8.5 \cdot 10^{-84}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.2 \cdot 10^{-51}:\\
\;\;\;\;\left(-t1\right) \cdot \frac{v}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -8.4999999999999994e-84 or 2.2e-51 < t1 Initial program 73.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lower-neg.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in t1 around inf
Applied rewrites86.5%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f6486.5
Applied rewrites86.5%
if -8.4999999999999994e-84 < t1 < 2.2e-51Initial program 77.8%
Taylor expanded in t1 around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6476.0
Applied rewrites76.0%
Final simplification82.5%
(FPCore (u v t1) :precision binary64 (* (/ v (+ t1 u)) (/ t1 (- (- t1) u))))
double code(double u, double v, double t1) {
return (v / (t1 + u)) * (t1 / (-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 / (t1 + u)) * (t1 / (-t1 - u))
end function
public static double code(double u, double v, double t1) {
return (v / (t1 + u)) * (t1 / (-t1 - u));
}
def code(u, v, t1): return (v / (t1 + u)) * (t1 / (-t1 - u))
function code(u, v, t1) return Float64(Float64(v / Float64(t1 + u)) * Float64(t1 / Float64(Float64(-t1) - u))) end
function tmp = code(u, v, t1) tmp = (v / (t1 + u)) * (t1 / (-t1 - u)); end
code[u_, v_, t1_] := N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{t1 + u} \cdot \frac{t1}{\left(-t1\right) - u}
\end{array}
Initial program 74.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-neg.f64N/A
neg-mul-1N/A
associate-*r*N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6498.1
Applied rewrites98.1%
Final simplification98.1%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* t1 (/ v (* u u))))) (if (<= u -1.02e+109) t_1 (if (<= u 1.6e+103) (/ v (- t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = t1 * (v / (u * u));
double tmp;
if (u <= -1.02e+109) {
tmp = t_1;
} else if (u <= 1.6e+103) {
tmp = v / -t1;
} else {
tmp = t_1;
}
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) :: tmp
t_1 = t1 * (v / (u * u))
if (u <= (-1.02d+109)) then
tmp = t_1
else if (u <= 1.6d+103) then
tmp = v / -t1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = t1 * (v / (u * u));
double tmp;
if (u <= -1.02e+109) {
tmp = t_1;
} else if (u <= 1.6e+103) {
tmp = v / -t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = t1 * (v / (u * u)) tmp = 0 if u <= -1.02e+109: tmp = t_1 elif u <= 1.6e+103: tmp = v / -t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(t1 * Float64(v / Float64(u * u))) tmp = 0.0 if (u <= -1.02e+109) tmp = t_1; elseif (u <= 1.6e+103) tmp = Float64(v / Float64(-t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = t1 * (v / (u * u)); tmp = 0.0; if (u <= -1.02e+109) tmp = t_1; elseif (u <= 1.6e+103) tmp = v / -t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -1.02e+109], t$95$1, If[LessEqual[u, 1.6e+103], N[(v / (-t1)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t1 \cdot \frac{v}{u \cdot u}\\
\mathbf{if}\;u \leq -1.02 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 1.6 \cdot 10^{+103}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -1.01999999999999994e109 or 1.59999999999999996e103 < u Initial program 79.7%
Taylor expanded in t1 around 0
unpow2N/A
lower-*.f6475.3
Applied rewrites75.3%
lift-/.f64N/A
div-invN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
metadata-eval73.5
Applied rewrites73.5%
lift-*.f64N/A
lift-neg.f64N/A
distribute-rgt-neg-outN/A
neg-mul-1N/A
associate-*r*N/A
neg-mul-1N/A
lift-/.f64N/A
distribute-frac-neg2N/A
lower-*.f64N/A
metadata-evalN/A
frac-2negN/A
lower-/.f6473.5
Applied rewrites73.5%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
neg-mul-1N/A
lift-neg.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lift-neg.f64N/A
lift-neg.f64N/A
+-lft-identityN/A
flip-+N/A
Applied rewrites74.1%
if -1.01999999999999994e109 < u < 1.59999999999999996e103Initial program 72.8%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6471.6
Applied rewrites71.6%
Final simplification72.4%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* v (/ t1 (* u u))))) (if (<= u -6.2e+145) t_1 (if (<= u 1.2e+195) (/ v (* (+ t1 u) -1.0)) t_1))))
double code(double u, double v, double t1) {
double t_1 = v * (t1 / (u * u));
double tmp;
if (u <= -6.2e+145) {
tmp = t_1;
} else if (u <= 1.2e+195) {
tmp = v / ((t1 + u) * -1.0);
} else {
tmp = t_1;
}
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) :: tmp
t_1 = v * (t1 / (u * u))
if (u <= (-6.2d+145)) then
tmp = t_1
else if (u <= 1.2d+195) then
tmp = v / ((t1 + u) * (-1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v * (t1 / (u * u));
double tmp;
if (u <= -6.2e+145) {
tmp = t_1;
} else if (u <= 1.2e+195) {
tmp = v / ((t1 + u) * -1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = v * (t1 / (u * u)) tmp = 0 if u <= -6.2e+145: tmp = t_1 elif u <= 1.2e+195: tmp = v / ((t1 + u) * -1.0) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(v * Float64(t1 / Float64(u * u))) tmp = 0.0 if (u <= -6.2e+145) tmp = t_1; elseif (u <= 1.2e+195) tmp = Float64(v / Float64(Float64(t1 + u) * -1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v * (t1 / (u * u)); tmp = 0.0; if (u <= -6.2e+145) tmp = t_1; elseif (u <= 1.2e+195) tmp = v / ((t1 + u) * -1.0); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -6.2e+145], t$95$1, If[LessEqual[u, 1.2e+195], N[(v / N[(N[(t1 + u), $MachinePrecision] * -1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := v \cdot \frac{t1}{u \cdot u}\\
\mathbf{if}\;u \leq -6.2 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 1.2 \cdot 10^{+195}:\\
\;\;\;\;\frac{v}{\left(t1 + u\right) \cdot -1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -6.19999999999999977e145 or 1.2000000000000001e195 < u Initial program 81.9%
Taylor expanded in t1 around 0
unpow2N/A
lower-*.f6481.9
Applied rewrites81.9%
lift-/.f64N/A
div-invN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
metadata-eval82.5
Applied rewrites82.5%
lift-*.f64N/A
lift-neg.f64N/A
distribute-rgt-neg-outN/A
neg-mul-1N/A
associate-*r*N/A
neg-mul-1N/A
lift-/.f64N/A
distribute-frac-neg2N/A
lower-*.f64N/A
metadata-evalN/A
frac-2negN/A
lower-/.f6482.5
Applied rewrites82.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
Applied rewrites80.8%
if -6.19999999999999977e145 < u < 1.2000000000000001e195Initial program 73.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lower-neg.f64N/A
lower-/.f6497.6
Applied rewrites97.6%
Taylor expanded in t1 around inf
Applied rewrites70.0%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f6470.0
Applied rewrites70.0%
Final simplification72.3%
(FPCore (u v t1) :precision binary64 (/ v (* (+ t1 u) -1.0)))
double code(double u, double v, double t1) {
return v / ((t1 + u) * -1.0);
}
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 + u) * (-1.0d0))
end function
public static double code(double u, double v, double t1) {
return v / ((t1 + u) * -1.0);
}
def code(u, v, t1): return v / ((t1 + u) * -1.0)
function code(u, v, t1) return Float64(v / Float64(Float64(t1 + u) * -1.0)) end
function tmp = code(u, v, t1) tmp = v / ((t1 + u) * -1.0); end
code[u_, v_, t1_] := N[(v / N[(N[(t1 + u), $MachinePrecision] * -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\left(t1 + u\right) \cdot -1}
\end{array}
Initial program 74.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lower-neg.f64N/A
lower-/.f6498.1
Applied rewrites98.1%
Taylor expanded in t1 around inf
Applied rewrites66.6%
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f6466.6
Applied rewrites66.6%
(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 / Float64(-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}
Initial program 74.9%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6457.0
Applied rewrites57.0%
Final simplification57.0%
(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}
Initial program 74.9%
Taylor expanded in t1 around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6457.0
Applied rewrites57.0%
Applied rewrites56.8%
Applied rewrites17.6%
herbie shell --seed 2024233
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))