
(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 6 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) -5e+270) (/ (/ x (- t)) z) (/ x (- y (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -5e+270) {
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) <= (-5d+270)) 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) <= -5e+270) {
tmp = (x / -t) / z;
} else {
tmp = x / (y - (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * t) <= -5e+270: 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) <= -5e+270) tmp = Float64(Float64(x / Float64(-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) <= -5e+270) 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], -5e+270], 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 -5 \cdot 10^{+270}:\\
\;\;\;\;\frac{\frac{x}{-t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\end{array}
\end{array}
if (*.f64 z t) < -4.99999999999999976e270Initial program 70.2%
clear-num70.3%
associate-/r/70.3%
Applied egg-rr70.3%
Taylor expanded in y around 0 70.3%
associate-*l/70.2%
neg-mul-170.2%
associate-/r*99.9%
distribute-neg-frac99.9%
distribute-neg-frac299.9%
Applied egg-rr99.9%
if -4.99999999999999976e270 < (*.f64 z t) Initial program 99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x) (* z t))))
(if (<= (* z t) -4e+78)
t_1
(if (<= (* z t) 5e-69)
(/ x y)
(if (<= (* z t) 2e-43) t_1 (if (<= (* z t) 2e+25) (/ x y) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = -x / (z * t);
double tmp;
if ((z * t) <= -4e+78) {
tmp = t_1;
} else if ((z * t) <= 5e-69) {
tmp = x / y;
} else if ((z * t) <= 2e-43) {
tmp = t_1;
} else if ((z * t) <= 2e+25) {
tmp = x / y;
} 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 = -x / (z * t)
if ((z * t) <= (-4d+78)) then
tmp = t_1
else if ((z * t) <= 5d-69) then
tmp = x / y
else if ((z * t) <= 2d-43) then
tmp = t_1
else if ((z * t) <= 2d+25) then
tmp = x / y
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 = -x / (z * t);
double tmp;
if ((z * t) <= -4e+78) {
tmp = t_1;
} else if ((z * t) <= 5e-69) {
tmp = x / y;
} else if ((z * t) <= 2e-43) {
tmp = t_1;
} else if ((z * t) <= 2e+25) {
tmp = x / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -x / (z * t) tmp = 0 if (z * t) <= -4e+78: tmp = t_1 elif (z * t) <= 5e-69: tmp = x / y elif (z * t) <= 2e-43: tmp = t_1 elif (z * t) <= 2e+25: tmp = x / y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-x) / Float64(z * t)) tmp = 0.0 if (Float64(z * t) <= -4e+78) tmp = t_1; elseif (Float64(z * t) <= 5e-69) tmp = Float64(x / y); elseif (Float64(z * t) <= 2e-43) tmp = t_1; elseif (Float64(z * t) <= 2e+25) tmp = Float64(x / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -x / (z * t); tmp = 0.0; if ((z * t) <= -4e+78) tmp = t_1; elseif ((z * t) <= 5e-69) tmp = x / y; elseif ((z * t) <= 2e-43) tmp = t_1; elseif ((z * t) <= 2e+25) tmp = x / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -4e+78], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 5e-69], N[(x / y), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e-43], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 2e+25], N[(x / y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{z \cdot t}\\
\mathbf{if}\;z \cdot t \leq -4 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{-69}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+25}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -4.00000000000000003e78 or 5.00000000000000033e-69 < (*.f64 z t) < 2.00000000000000015e-43 or 2.00000000000000018e25 < (*.f64 z t) Initial program 92.9%
clear-num91.9%
associate-/r/92.9%
Applied egg-rr92.9%
Taylor expanded in y around 0 79.4%
associate-*l/79.4%
neg-mul-179.4%
*-commutative79.4%
Applied egg-rr79.4%
if -4.00000000000000003e78 < (*.f64 z t) < 5.00000000000000033e-69 or 2.00000000000000015e-43 < (*.f64 z t) < 2.00000000000000018e25Initial program 99.9%
Taylor expanded in y around inf 83.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x (- t)) z)))
(if (<= (* z t) -2e+94)
t_1
(if (<= (* z t) 5e-69)
(/ x y)
(if (<= (* z t) 2e-43)
(/ (- x) (* z t))
(if (<= (* z t) 2e+25) (/ x y) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / -t) / z;
double tmp;
if ((z * t) <= -2e+94) {
tmp = t_1;
} else if ((z * t) <= 5e-69) {
tmp = x / y;
} else if ((z * t) <= 2e-43) {
tmp = -x / (z * t);
} else if ((z * t) <= 2e+25) {
tmp = x / y;
} 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 = (x / -t) / z
if ((z * t) <= (-2d+94)) then
tmp = t_1
else if ((z * t) <= 5d-69) then
tmp = x / y
else if ((z * t) <= 2d-43) then
tmp = -x / (z * t)
else if ((z * t) <= 2d+25) then
tmp = x / y
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 = (x / -t) / z;
double tmp;
if ((z * t) <= -2e+94) {
tmp = t_1;
} else if ((z * t) <= 5e-69) {
tmp = x / y;
} else if ((z * t) <= 2e-43) {
tmp = -x / (z * t);
} else if ((z * t) <= 2e+25) {
tmp = x / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / -t) / z tmp = 0 if (z * t) <= -2e+94: tmp = t_1 elif (z * t) <= 5e-69: tmp = x / y elif (z * t) <= 2e-43: tmp = -x / (z * t) elif (z * t) <= 2e+25: tmp = x / y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / Float64(-t)) / z) tmp = 0.0 if (Float64(z * t) <= -2e+94) tmp = t_1; elseif (Float64(z * t) <= 5e-69) tmp = Float64(x / y); elseif (Float64(z * t) <= 2e-43) tmp = Float64(Float64(-x) / Float64(z * t)); elseif (Float64(z * t) <= 2e+25) tmp = Float64(x / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / -t) / z; tmp = 0.0; if ((z * t) <= -2e+94) tmp = t_1; elseif ((z * t) <= 5e-69) tmp = x / y; elseif ((z * t) <= 2e-43) tmp = -x / (z * t); elseif ((z * t) <= 2e+25) tmp = x / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / (-t)), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -2e+94], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 5e-69], N[(x / y), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e-43], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+25], N[(x / y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{-t}}{z}\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{-69}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-43}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+25}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -2e94 or 2.00000000000000018e25 < (*.f64 z t) Initial program 92.3%
clear-num91.2%
associate-/r/92.3%
Applied egg-rr92.3%
Taylor expanded in y around 0 79.2%
associate-*l/79.3%
neg-mul-179.3%
associate-/r*82.5%
distribute-neg-frac82.5%
distribute-neg-frac282.5%
Applied egg-rr82.5%
if -2e94 < (*.f64 z t) < 5.00000000000000033e-69 or 2.00000000000000015e-43 < (*.f64 z t) < 2.00000000000000018e25Initial program 99.9%
Taylor expanded in y around inf 82.6%
if 5.00000000000000033e-69 < (*.f64 z t) < 2.00000000000000015e-43Initial program 99.8%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 86.0%
associate-*l/86.0%
neg-mul-186.0%
*-commutative86.0%
Applied egg-rr86.0%
(FPCore (x y z t)
:precision binary64
(if (<= (* z t) -2e+59)
(/ (/ x (- z)) t)
(if (<= (* z t) 5e-69)
(/ x y)
(if (<= (* z t) 2e-43)
(/ (- x) (* z t))
(if (<= (* z t) 2e+25) (/ x y) (/ (/ x (- t)) z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -2e+59) {
tmp = (x / -z) / t;
} else if ((z * t) <= 5e-69) {
tmp = x / y;
} else if ((z * t) <= 2e-43) {
tmp = -x / (z * t);
} else if ((z * t) <= 2e+25) {
tmp = x / y;
} else {
tmp = (x / -t) / z;
}
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) <= (-2d+59)) then
tmp = (x / -z) / t
else if ((z * t) <= 5d-69) then
tmp = x / y
else if ((z * t) <= 2d-43) then
tmp = -x / (z * t)
else if ((z * t) <= 2d+25) then
tmp = x / y
else
tmp = (x / -t) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -2e+59) {
tmp = (x / -z) / t;
} else if ((z * t) <= 5e-69) {
tmp = x / y;
} else if ((z * t) <= 2e-43) {
tmp = -x / (z * t);
} else if ((z * t) <= 2e+25) {
tmp = x / y;
} else {
tmp = (x / -t) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * t) <= -2e+59: tmp = (x / -z) / t elif (z * t) <= 5e-69: tmp = x / y elif (z * t) <= 2e-43: tmp = -x / (z * t) elif (z * t) <= 2e+25: tmp = x / y else: tmp = (x / -t) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * t) <= -2e+59) tmp = Float64(Float64(x / Float64(-z)) / t); elseif (Float64(z * t) <= 5e-69) tmp = Float64(x / y); elseif (Float64(z * t) <= 2e-43) tmp = Float64(Float64(-x) / Float64(z * t)); elseif (Float64(z * t) <= 2e+25) tmp = Float64(x / y); else tmp = Float64(Float64(x / Float64(-t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * t) <= -2e+59) tmp = (x / -z) / t; elseif ((z * t) <= 5e-69) tmp = x / y; elseif ((z * t) <= 2e-43) tmp = -x / (z * t); elseif ((z * t) <= 2e+25) tmp = x / y; else tmp = (x / -t) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], -2e+59], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e-69], N[(x / y), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e-43], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+25], N[(x / y), $MachinePrecision], N[(N[(x / (-t)), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+59}:\\
\;\;\;\;\frac{\frac{x}{-z}}{t}\\
\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{-69}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-43}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+25}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{-t}}{z}\\
\end{array}
\end{array}
if (*.f64 z t) < -1.99999999999999994e59Initial program 88.7%
clear-num87.6%
associate-/r/88.7%
Applied egg-rr88.7%
Taylor expanded in y around 0 75.8%
associate-*l/75.8%
neg-mul-175.8%
*-commutative75.8%
associate-/r*85.2%
distribute-neg-frac85.2%
distribute-neg-frac285.2%
Applied egg-rr85.2%
if -1.99999999999999994e59 < (*.f64 z t) < 5.00000000000000033e-69 or 2.00000000000000015e-43 < (*.f64 z t) < 2.00000000000000018e25Initial program 99.9%
Taylor expanded in y around inf 84.6%
if 5.00000000000000033e-69 < (*.f64 z t) < 2.00000000000000015e-43Initial program 99.8%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 86.0%
associate-*l/86.0%
neg-mul-186.0%
*-commutative86.0%
Applied egg-rr86.0%
if 2.00000000000000018e25 < (*.f64 z t) Initial program 96.6%
clear-num95.7%
associate-/r/96.5%
Applied egg-rr96.5%
Taylor expanded in y around 0 80.2%
associate-*l/80.2%
neg-mul-180.2%
associate-/r*77.1%
distribute-neg-frac77.1%
distribute-neg-frac277.1%
Applied egg-rr77.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (/ x t) z))) (if (<= t -1.35e+29) t_1 (if (<= t 2.05e+206) (/ x y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / t) / z;
double tmp;
if (t <= -1.35e+29) {
tmp = t_1;
} else if (t <= 2.05e+206) {
tmp = x / y;
} 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 = (x / t) / z
if (t <= (-1.35d+29)) then
tmp = t_1
else if (t <= 2.05d+206) then
tmp = x / y
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 = (x / t) / z;
double tmp;
if (t <= -1.35e+29) {
tmp = t_1;
} else if (t <= 2.05e+206) {
tmp = x / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / t) / z tmp = 0 if t <= -1.35e+29: tmp = t_1 elif t <= 2.05e+206: tmp = x / y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / t) / z) tmp = 0.0 if (t <= -1.35e+29) tmp = t_1; elseif (t <= 2.05e+206) tmp = Float64(x / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / t) / z; tmp = 0.0; if (t <= -1.35e+29) tmp = t_1; elseif (t <= 2.05e+206) tmp = x / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t, -1.35e+29], t$95$1, If[LessEqual[t, 2.05e+206], N[(x / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{t}}{z}\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{+206}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.35e29 or 2.0500000000000002e206 < t Initial program 90.4%
clear-num89.6%
associate-/r/90.3%
Applied egg-rr90.3%
Taylor expanded in y around 0 66.1%
associate-/r*67.2%
associate-*l/75.6%
Applied egg-rr75.6%
associate-*l/75.7%
neg-mul-175.7%
add-sqr-sqrt33.2%
sqrt-unprod41.7%
sqr-neg41.7%
sqrt-unprod18.3%
add-sqr-sqrt31.0%
Applied egg-rr31.0%
if -1.35e29 < t < 2.0500000000000002e206Initial program 99.3%
Taylor expanded in y around inf 63.1%
(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 96.5%
Taylor expanded in y around inf 53.1%
(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 2024052 -o generate:simplify
(FPCore (x y z t)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(if (< x -1.618195973607049e+50) (/ 1.0 (- (/ y x) (* (/ z x) t))) (if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) (/ 1.0 (- (/ y x) (* (/ z x) t)))))
(/ x (- y (* z t))))