
(FPCore (x y z t) :precision binary64 (/ x (- y (* z t))))
double code(double x, double y, double z, double t) {
return x / (y - (z * t));
}
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 * t))
end function
public static double code(double x, double y, double z, double t) {
return x / (y - (z * t));
}
def code(x, y, z, t): return x / (y - (z * t))
function code(x, y, z, t) return Float64(x / Float64(y - Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = x / (y - (z * t)); end
code[x_, y_, z_, t_] := N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y - z \cdot t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (- y (* z t))))
double code(double x, double y, double z, double t) {
return x / (y - (z * t));
}
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 * t))
end function
public static double code(double x, double y, double z, double t) {
return x / (y - (z * t));
}
def code(x, y, z, t): return x / (y - (z * t))
function code(x, y, z, t) return Float64(x / Float64(y - Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = x / (y - (z * t)); end
code[x_, y_, z_, t_] := N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y - z \cdot t}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= (* z t) -1e+239) (/ (/ -1.0 t) (/ z x)) (/ x (- y (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -1e+239) {
tmp = (-1.0 / t) / (z / x);
} else {
tmp = x / (y - (z * t));
}
return tmp;
}
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
real(8) :: tmp
if ((z * t) <= (-1d+239)) then
tmp = ((-1.0d0) / t) / (z / x)
else
tmp = x / (y - (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -1e+239) {
tmp = (-1.0 / t) / (z / x);
} else {
tmp = x / (y - (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * t) <= -1e+239: tmp = (-1.0 / t) / (z / x) else: tmp = x / (y - (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * t) <= -1e+239) tmp = Float64(Float64(-1.0 / t) / Float64(z / x)); else tmp = Float64(x / Float64(y - Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * t) <= -1e+239) tmp = (-1.0 / t) / (z / x); else tmp = x / (y - (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], -1e+239], N[(N[(-1.0 / t), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+239}:\\
\;\;\;\;\frac{\frac{-1}{t}}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\end{array}
\end{array}
if (*.f64 z t) < -9.99999999999999991e238Initial program 74.6%
Taylor expanded in z around inf 74.6%
*-un-lft-identity74.6%
*-commutative74.6%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
if -9.99999999999999991e238 < (*.f64 z t) Initial program 98.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (* z t) -1e+44) (not (<= (* z t) 2e-33))) (/ (/ x z) (- t)) (/ x y)))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * t) <= -1e+44) || !((z * t) <= 2e-33)) {
tmp = (x / z) / -t;
} else {
tmp = x / y;
}
return tmp;
}
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
real(8) :: tmp
if (((z * t) <= (-1d+44)) .or. (.not. ((z * t) <= 2d-33))) then
tmp = (x / z) / -t
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * t) <= -1e+44) || !((z * t) <= 2e-33)) {
tmp = (x / z) / -t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * t) <= -1e+44) or not ((z * t) <= 2e-33): tmp = (x / z) / -t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * t) <= -1e+44) || !(Float64(z * t) <= 2e-33)) tmp = Float64(Float64(x / z) / Float64(-t)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * t) <= -1e+44) || ~(((z * t) <= 2e-33))) tmp = (x / z) / -t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -1e+44], N[Not[LessEqual[N[(z * t), $MachinePrecision], 2e-33]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / (-t)), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+44} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{-33}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (*.f64 z t) < -1.0000000000000001e44 or 2.0000000000000001e-33 < (*.f64 z t) Initial program 91.4%
Taylor expanded in t around inf 75.2%
distribute-lft-out75.2%
associate-*r/75.2%
mul-1-neg75.2%
associate-/l*81.2%
Simplified81.2%
Taylor expanded in z around inf 83.9%
if -1.0000000000000001e44 < (*.f64 z t) < 2.0000000000000001e-33Initial program 100.0%
Taylor expanded in y around inf 85.3%
Final simplification84.6%
(FPCore (x y z t) :precision binary64 (if (<= (* z t) -4e+21) (/ -1.0 (* z (/ t x))) (if (<= (* z t) 2e-33) (/ x y) (/ x (- (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -4e+21) {
tmp = -1.0 / (z * (t / x));
} else if ((z * t) <= 2e-33) {
tmp = x / y;
} else {
tmp = x / -(z * t);
}
return tmp;
}
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
real(8) :: tmp
if ((z * t) <= (-4d+21)) then
tmp = (-1.0d0) / (z * (t / x))
else if ((z * t) <= 2d-33) then
tmp = x / y
else
tmp = x / -(z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -4e+21) {
tmp = -1.0 / (z * (t / x));
} else if ((z * t) <= 2e-33) {
tmp = x / y;
} else {
tmp = x / -(z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * t) <= -4e+21: tmp = -1.0 / (z * (t / x)) elif (z * t) <= 2e-33: tmp = x / y else: tmp = x / -(z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * t) <= -4e+21) tmp = Float64(-1.0 / Float64(z * Float64(t / x))); elseif (Float64(z * t) <= 2e-33) tmp = Float64(x / y); else tmp = Float64(x / Float64(-Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * t) <= -4e+21) tmp = -1.0 / (z * (t / x)); elseif ((z * t) <= 2e-33) tmp = x / y; else tmp = x / -(z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], -4e+21], N[(-1.0 / N[(z * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e-33], N[(x / y), $MachinePrecision], N[(x / (-N[(z * t), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -4 \cdot 10^{+21}:\\
\;\;\;\;\frac{-1}{z \cdot \frac{t}{x}}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-z \cdot t}\\
\end{array}
\end{array}
if (*.f64 z t) < -4e21Initial program 88.2%
Taylor expanded in z around inf 85.3%
*-un-lft-identity85.3%
*-commutative85.3%
times-frac95.4%
Applied egg-rr95.4%
Taylor expanded in y around 0 87.4%
clear-num87.3%
frac-times87.8%
metadata-eval87.8%
associate-/l*77.6%
*-commutative77.6%
associate-/l*86.5%
Applied egg-rr86.5%
if -4e21 < (*.f64 z t) < 2.0000000000000001e-33Initial program 100.0%
Taylor expanded in y around inf 86.5%
if 2.0000000000000001e-33 < (*.f64 z t) Initial program 94.7%
Taylor expanded in y around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
Simplified82.1%
Final simplification85.2%
(FPCore (x y z t) :precision binary64 (if (<= (* z t) -4e+21) (/ (/ (- x) t) z) (if (<= (* z t) 2e-33) (/ x y) (/ x (- (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -4e+21) {
tmp = (-x / t) / z;
} else if ((z * t) <= 2e-33) {
tmp = x / y;
} else {
tmp = x / -(z * t);
}
return tmp;
}
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
real(8) :: tmp
if ((z * t) <= (-4d+21)) then
tmp = (-x / t) / z
else if ((z * t) <= 2d-33) then
tmp = x / y
else
tmp = x / -(z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -4e+21) {
tmp = (-x / t) / z;
} else if ((z * t) <= 2e-33) {
tmp = x / y;
} else {
tmp = x / -(z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * t) <= -4e+21: tmp = (-x / t) / z elif (z * t) <= 2e-33: tmp = x / y else: tmp = x / -(z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * t) <= -4e+21) tmp = Float64(Float64(Float64(-x) / t) / z); elseif (Float64(z * t) <= 2e-33) tmp = Float64(x / y); else tmp = Float64(x / Float64(-Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * t) <= -4e+21) tmp = (-x / t) / z; elseif ((z * t) <= 2e-33) tmp = x / y; else tmp = x / -(z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], -4e+21], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e-33], N[(x / y), $MachinePrecision], N[(x / (-N[(z * t), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -4 \cdot 10^{+21}:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-z \cdot t}\\
\end{array}
\end{array}
if (*.f64 z t) < -4e21Initial program 88.2%
Taylor expanded in y around inf 76.4%
mul-1-neg76.4%
unsub-neg76.4%
associate-/l*76.5%
Simplified76.5%
Taylor expanded in y around 0 76.8%
associate-/r*86.0%
associate-*r/86.0%
associate-*r/86.0%
neg-mul-186.0%
Simplified86.0%
if -4e21 < (*.f64 z t) < 2.0000000000000001e-33Initial program 100.0%
Taylor expanded in y around inf 86.5%
if 2.0000000000000001e-33 < (*.f64 z t) Initial program 94.7%
Taylor expanded in y around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
Simplified82.1%
Final simplification85.1%
(FPCore (x y z t) :precision binary64 (if (<= (* z t) -1e+44) (/ (/ x z) (- t)) (if (<= (* z t) 2e-33) (/ x y) (/ x (- (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -1e+44) {
tmp = (x / z) / -t;
} else if ((z * t) <= 2e-33) {
tmp = x / y;
} else {
tmp = x / -(z * t);
}
return tmp;
}
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
real(8) :: tmp
if ((z * t) <= (-1d+44)) then
tmp = (x / z) / -t
else if ((z * t) <= 2d-33) then
tmp = x / y
else
tmp = x / -(z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -1e+44) {
tmp = (x / z) / -t;
} else if ((z * t) <= 2e-33) {
tmp = x / y;
} else {
tmp = x / -(z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * t) <= -1e+44: tmp = (x / z) / -t elif (z * t) <= 2e-33: tmp = x / y else: tmp = x / -(z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * t) <= -1e+44) tmp = Float64(Float64(x / z) / Float64(-t)); elseif (Float64(z * t) <= 2e-33) tmp = Float64(x / y); else tmp = Float64(x / Float64(-Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * t) <= -1e+44) tmp = (x / z) / -t; elseif ((z * t) <= 2e-33) tmp = x / y; else tmp = x / -(z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], -1e+44], N[(N[(x / z), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e-33], N[(x / y), $MachinePrecision], N[(x / (-N[(z * t), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+44}:\\
\;\;\;\;\frac{\frac{x}{z}}{-t}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-z \cdot t}\\
\end{array}
\end{array}
if (*.f64 z t) < -1.0000000000000001e44Initial program 87.4%
Taylor expanded in t around inf 80.5%
distribute-lft-out80.5%
associate-*r/80.5%
mul-1-neg80.5%
associate-/l*87.1%
Simplified87.1%
Taylor expanded in z around inf 89.7%
if -1.0000000000000001e44 < (*.f64 z t) < 2.0000000000000001e-33Initial program 100.0%
Taylor expanded in y around inf 85.3%
if 2.0000000000000001e-33 < (*.f64 z t) Initial program 94.7%
Taylor expanded in y around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
Simplified82.1%
Final simplification85.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (* z t) -5e+231) (not (<= (* z t) 4e+206))) (/ x (* z t)) (/ x y)))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * t) <= -5e+231) || !((z * t) <= 4e+206)) {
tmp = x / (z * t);
} else {
tmp = x / y;
}
return tmp;
}
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
real(8) :: tmp
if (((z * t) <= (-5d+231)) .or. (.not. ((z * t) <= 4d+206))) then
tmp = x / (z * t)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * t) <= -5e+231) || !((z * t) <= 4e+206)) {
tmp = x / (z * t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * t) <= -5e+231) or not ((z * t) <= 4e+206): tmp = x / (z * t) else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * t) <= -5e+231) || !(Float64(z * t) <= 4e+206)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * t) <= -5e+231) || ~(((z * t) <= 4e+206))) tmp = x / (z * t); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -5e+231], N[Not[LessEqual[N[(z * t), $MachinePrecision], 4e+206]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+231} \lor \neg \left(z \cdot t \leq 4 \cdot 10^{+206}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (*.f64 z t) < -5.00000000000000028e231 or 4.0000000000000002e206 < (*.f64 z t) Initial program 81.3%
Taylor expanded in t around inf 86.8%
distribute-lft-out86.8%
associate-*r/86.8%
mul-1-neg86.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
add-sqr-sqrt76.9%
sqrt-unprod66.5%
sqr-neg66.5%
sqrt-unprod53.4%
add-sqr-sqrt54.3%
div-inv54.3%
frac-times54.6%
*-rgt-identity54.6%
Applied egg-rr54.6%
if -5.00000000000000028e231 < (*.f64 z t) < 4.0000000000000002e206Initial program 99.9%
Taylor expanded in y around inf 63.7%
Final simplification61.5%
(FPCore (x y z t) :precision binary64 (if (<= (* z t) -1e+239) (/ (/ (- x) t) z) (/ x (- y (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -1e+239) {
tmp = (-x / t) / z;
} else {
tmp = x / (y - (z * t));
}
return tmp;
}
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
real(8) :: tmp
if ((z * t) <= (-1d+239)) then
tmp = (-x / t) / z
else
tmp = x / (y - (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -1e+239) {
tmp = (-x / t) / z;
} else {
tmp = x / (y - (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * t) <= -1e+239: tmp = (-x / t) / z else: tmp = x / (y - (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * t) <= -1e+239) tmp = Float64(Float64(Float64(-x) / t) / z); else tmp = Float64(x / Float64(y - Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * t) <= -1e+239) tmp = (-x / t) / z; else tmp = x / (y - (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], -1e+239], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+239}:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\end{array}
\end{array}
if (*.f64 z t) < -9.99999999999999991e238Initial program 74.6%
Taylor expanded in y around inf 61.9%
mul-1-neg61.9%
unsub-neg61.9%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in y around 0 74.6%
associate-/r*99.7%
associate-*r/99.7%
associate-*r/99.7%
neg-mul-199.7%
Simplified99.7%
if -9.99999999999999991e238 < (*.f64 z t) Initial program 98.2%
(FPCore (x y z t) :precision binary64 (/ x y))
double code(double x, double y, double z, double t) {
return 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
end function
public static double code(double x, double y, double z, double t) {
return x / y;
}
def code(x, y, z, t): return x / y
function code(x, y, z, t) return Float64(x / y) end
function tmp = code(x, y, z, t) tmp = x / y; end
code[x_, y_, z_, t_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y}
\end{array}
Initial program 95.4%
Taylor expanded in y around inf 53.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (- (/ y x) (* (/ z x) t)))))
(if (< x -1.618195973607049e+50)
t_1
(if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / ((y / x) - ((z / x) * t));
double tmp;
if (x < -1.618195973607049e+50) {
tmp = t_1;
} else if (x < 2.1378306434876444e+131) {
tmp = x / (y - (z * t));
} else {
tmp = t_1;
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 / ((y / x) - ((z / x) * t))
if (x < (-1.618195973607049d+50)) then
tmp = t_1
else if (x < 2.1378306434876444d+131) then
tmp = x / (y - (z * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / ((y / x) - ((z / x) * t));
double tmp;
if (x < -1.618195973607049e+50) {
tmp = t_1;
} else if (x < 2.1378306434876444e+131) {
tmp = x / (y - (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 / ((y / x) - ((z / x) * t)) tmp = 0 if x < -1.618195973607049e+50: tmp = t_1 elif x < 2.1378306434876444e+131: tmp = x / (y - (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 / Float64(Float64(y / x) - Float64(Float64(z / x) * t))) tmp = 0.0 if (x < -1.618195973607049e+50) tmp = t_1; elseif (x < 2.1378306434876444e+131) tmp = Float64(x / Float64(y - Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 / ((y / x) - ((z / x) * t)); tmp = 0.0; if (x < -1.618195973607049e+50) tmp = t_1; elseif (x < 2.1378306434876444e+131) tmp = x / (y - (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(N[(y / x), $MachinePrecision] - N[(N[(z / x), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[x, -1.618195973607049e+50], t$95$1, If[Less[x, 2.1378306434876444e+131], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\
\mathbf{if}\;x < -1.618195973607049 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x < 2.1378306434876444 \cdot 10^{+131}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024150
(FPCore (x y z t)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(! :herbie-platform default (if (< x -161819597360704900000000000000000000000000000000000) (/ 1 (- (/ y x) (* (/ z x) t))) (if (< x 213783064348764440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ x (- y (* z t))) (/ 1 (- (/ y x) (* (/ z x) t))))))
(/ x (- y (* z t))))