
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
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) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
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) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_2 -5e+41)
(* (/ y (+ x 1.0)) (/ z (fma t z (- x))))
(if (<= t_2 5e+200)
(pow (/ (+ x 1.0) (+ x (/ (fma y z (- x)) t_1))) -1.0)
(/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -5e+41) {
tmp = (y / (x + 1.0)) * (z / fma(t, z, -x));
} else if (t_2 <= 5e+200) {
tmp = pow(((x + 1.0) / (x + (fma(y, z, -x) / t_1))), -1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= -5e+41) tmp = Float64(Float64(y / Float64(x + 1.0)) * Float64(z / fma(t, z, Float64(-x)))); elseif (t_2 <= 5e+200) tmp = Float64(Float64(x + 1.0) / Float64(x + Float64(fma(y, z, Float64(-x)) / t_1))) ^ -1.0; else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+41], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / N[(t * z + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+200], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(x + N[(N[(y * z + (-x)), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+41}:\\
\;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{\mathsf{fma}\left(t, z, -x\right)}\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+200}:\\
\;\;\;\;{\left(\frac{x + 1}{x + \frac{\mathsf{fma}\left(y, z, -x\right)}{t_1}}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -5.00000000000000022e41Initial program 65.7%
*-commutative65.7%
Simplified65.7%
Taylor expanded in y around inf 65.3%
times-frac93.5%
+-commutative93.5%
fma-neg93.5%
Simplified93.5%
if -5.00000000000000022e41 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 5.00000000000000019e200Initial program 99.2%
*-commutative99.2%
Simplified99.2%
clear-num99.2%
inv-pow99.2%
fma-neg99.2%
Applied egg-rr99.2%
if 5.00000000000000019e200 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 18.8%
*-commutative18.8%
Simplified18.8%
Taylor expanded in z around inf 87.2%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (<= t_1 -2e+80)
(* (/ y (+ x 1.0)) (/ z (fma t z (- x))))
(if (<= t_1 5e+200) t_1 (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if (t_1 <= -2e+80) {
tmp = (y / (x + 1.0)) * (z / fma(t, z, -x));
} else if (t_1 <= 5e+200) {
tmp = t_1;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) tmp = 0.0 if (t_1 <= -2e+80) tmp = Float64(Float64(y / Float64(x + 1.0)) * Float64(z / fma(t, z, Float64(-x)))); elseif (t_1 <= 5e+200) tmp = t_1; else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+80], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / N[(t * z + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+200], t$95$1, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+80}:\\
\;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{\mathsf{fma}\left(t, z, -x\right)}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+200}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -2e80Initial program 62.1%
*-commutative62.1%
Simplified62.1%
Taylor expanded in y around inf 61.7%
times-frac92.9%
+-commutative92.9%
fma-neg92.9%
Simplified92.9%
if -2e80 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 5.00000000000000019e200Initial program 99.2%
if 5.00000000000000019e200 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 18.8%
*-commutative18.8%
Simplified18.8%
Taylor expanded in z around inf 87.2%
Final simplification97.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_2 -5e+96)
(/ y (/ (* t_1 (+ x 1.0)) z))
(if (<= t_2 5e+200) t_2 (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -5e+96) {
tmp = y / ((t_1 * (x + 1.0)) / z);
} else if (t_2 <= 5e+200) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
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) :: t_2
real(8) :: tmp
t_1 = (z * t) - x
t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0d0)
if (t_2 <= (-5d+96)) then
tmp = y / ((t_1 * (x + 1.0d0)) / z)
else if (t_2 <= 5d+200) then
tmp = t_2
else
tmp = (x + (y / t)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -5e+96) {
tmp = y / ((t_1 * (x + 1.0)) / z);
} else if (t_2 <= 5e+200) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_2 <= -5e+96: tmp = y / ((t_1 * (x + 1.0)) / z) elif t_2 <= 5e+200: tmp = t_2 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= -5e+96) tmp = Float64(y / Float64(Float64(t_1 * Float64(x + 1.0)) / z)); elseif (t_2 <= 5e+200) tmp = t_2; else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_2 <= -5e+96) tmp = y / ((t_1 * (x + 1.0)) / z); elseif (t_2 <= 5e+200) tmp = t_2; else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+96], N[(y / N[(N[(t$95$1 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+200], t$95$2, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+96}:\\
\;\;\;\;\frac{y}{\frac{t_1 \cdot \left(x + 1\right)}{z}}\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+200}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -5.0000000000000004e96Initial program 60.8%
*-commutative60.8%
Simplified60.8%
clear-num60.9%
inv-pow60.9%
fma-neg60.9%
Applied egg-rr60.9%
Taylor expanded in y around inf 60.3%
associate-/l*81.7%
*-commutative81.7%
+-commutative81.7%
Simplified81.7%
if -5.0000000000000004e96 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 5.00000000000000019e200Initial program 99.2%
if 5.00000000000000019e200 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 18.8%
*-commutative18.8%
Simplified18.8%
Taylor expanded in z around inf 87.2%
Final simplification96.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -4.7e-9)
t_1
(if (<= t -3.15e-52)
1.0
(if (<= t -7.4e-61)
(/ y (* t (+ x 1.0)))
(if (<= t 112000000000.0)
(- 1.0 (/ y (* (+ x 1.0) (/ x z))))
t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -4.7e-9) {
tmp = t_1;
} else if (t <= -3.15e-52) {
tmp = 1.0;
} else if (t <= -7.4e-61) {
tmp = y / (t * (x + 1.0));
} else if (t <= 112000000000.0) {
tmp = 1.0 - (y / ((x + 1.0) * (x / z)));
} 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 + (y / t)) / (x + 1.0d0)
if (t <= (-4.7d-9)) then
tmp = t_1
else if (t <= (-3.15d-52)) then
tmp = 1.0d0
else if (t <= (-7.4d-61)) then
tmp = y / (t * (x + 1.0d0))
else if (t <= 112000000000.0d0) then
tmp = 1.0d0 - (y / ((x + 1.0d0) * (x / z)))
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 + (y / t)) / (x + 1.0);
double tmp;
if (t <= -4.7e-9) {
tmp = t_1;
} else if (t <= -3.15e-52) {
tmp = 1.0;
} else if (t <= -7.4e-61) {
tmp = y / (t * (x + 1.0));
} else if (t <= 112000000000.0) {
tmp = 1.0 - (y / ((x + 1.0) * (x / z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -4.7e-9: tmp = t_1 elif t <= -3.15e-52: tmp = 1.0 elif t <= -7.4e-61: tmp = y / (t * (x + 1.0)) elif t <= 112000000000.0: tmp = 1.0 - (y / ((x + 1.0) * (x / z))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -4.7e-9) tmp = t_1; elseif (t <= -3.15e-52) tmp = 1.0; elseif (t <= -7.4e-61) tmp = Float64(y / Float64(t * Float64(x + 1.0))); elseif (t <= 112000000000.0) tmp = Float64(1.0 - Float64(y / Float64(Float64(x + 1.0) * Float64(x / z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -4.7e-9) tmp = t_1; elseif (t <= -3.15e-52) tmp = 1.0; elseif (t <= -7.4e-61) tmp = y / (t * (x + 1.0)); elseif (t <= 112000000000.0) tmp = 1.0 - (y / ((x + 1.0) * (x / z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.7e-9], t$95$1, If[LessEqual[t, -3.15e-52], 1.0, If[LessEqual[t, -7.4e-61], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 112000000000.0], N[(1.0 - N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -4.7 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3.15 \cdot 10^{-52}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq -7.4 \cdot 10^{-61}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{elif}\;t \leq 112000000000:\\
\;\;\;\;1 - \frac{y}{\left(x + 1\right) \cdot \frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.6999999999999999e-9 or 1.12e11 < t Initial program 84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in z around inf 89.5%
if -4.6999999999999999e-9 < t < -3.1500000000000002e-52Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 68.4%
Taylor expanded in x around inf 100.0%
if -3.1500000000000002e-52 < t < -7.3999999999999999e-61Initial program 76.0%
*-commutative76.0%
Simplified76.0%
Taylor expanded in y around inf 76.0%
Taylor expanded in z around inf 93.1%
if -7.3999999999999999e-61 < t < 1.12e11Initial program 90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in t around 0 72.7%
associate-+r+72.7%
mul-1-neg72.7%
unsub-neg72.7%
+-commutative72.7%
associate-/l*77.7%
+-commutative77.7%
Simplified77.7%
Taylor expanded in y around 0 72.6%
mul-1-neg72.6%
+-commutative72.6%
*-commutative72.6%
times-frac78.5%
sub-neg78.5%
associate-*r/77.7%
associate-/l*78.5%
associate-/l/78.5%
Simplified78.5%
Final simplification85.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -1.15e-8)
t_1
(if (<= t -1.7e-52)
1.0
(if (<= t -7.4e-61)
(/ y (/ (* (- (* z t) x) (+ x 1.0)) z))
(if (<= t 115000000000.0)
(- 1.0 (/ y (* (+ x 1.0) (/ x z))))
t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.15e-8) {
tmp = t_1;
} else if (t <= -1.7e-52) {
tmp = 1.0;
} else if (t <= -7.4e-61) {
tmp = y / ((((z * t) - x) * (x + 1.0)) / z);
} else if (t <= 115000000000.0) {
tmp = 1.0 - (y / ((x + 1.0) * (x / z)));
} 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 + (y / t)) / (x + 1.0d0)
if (t <= (-1.15d-8)) then
tmp = t_1
else if (t <= (-1.7d-52)) then
tmp = 1.0d0
else if (t <= (-7.4d-61)) then
tmp = y / ((((z * t) - x) * (x + 1.0d0)) / z)
else if (t <= 115000000000.0d0) then
tmp = 1.0d0 - (y / ((x + 1.0d0) * (x / z)))
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 + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.15e-8) {
tmp = t_1;
} else if (t <= -1.7e-52) {
tmp = 1.0;
} else if (t <= -7.4e-61) {
tmp = y / ((((z * t) - x) * (x + 1.0)) / z);
} else if (t <= 115000000000.0) {
tmp = 1.0 - (y / ((x + 1.0) * (x / z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -1.15e-8: tmp = t_1 elif t <= -1.7e-52: tmp = 1.0 elif t <= -7.4e-61: tmp = y / ((((z * t) - x) * (x + 1.0)) / z) elif t <= 115000000000.0: tmp = 1.0 - (y / ((x + 1.0) * (x / z))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -1.15e-8) tmp = t_1; elseif (t <= -1.7e-52) tmp = 1.0; elseif (t <= -7.4e-61) tmp = Float64(y / Float64(Float64(Float64(Float64(z * t) - x) * Float64(x + 1.0)) / z)); elseif (t <= 115000000000.0) tmp = Float64(1.0 - Float64(y / Float64(Float64(x + 1.0) * Float64(x / z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -1.15e-8) tmp = t_1; elseif (t <= -1.7e-52) tmp = 1.0; elseif (t <= -7.4e-61) tmp = y / ((((z * t) - x) * (x + 1.0)) / z); elseif (t <= 115000000000.0) tmp = 1.0 - (y / ((x + 1.0) * (x / z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.15e-8], t$95$1, If[LessEqual[t, -1.7e-52], 1.0, If[LessEqual[t, -7.4e-61], N[(y / N[(N[(N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 115000000000.0], N[(1.0 - N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{-52}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq -7.4 \cdot 10^{-61}:\\
\;\;\;\;\frac{y}{\frac{\left(z \cdot t - x\right) \cdot \left(x + 1\right)}{z}}\\
\mathbf{elif}\;t \leq 115000000000:\\
\;\;\;\;1 - \frac{y}{\left(x + 1\right) \cdot \frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.15e-8 or 1.15e11 < t Initial program 84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in z around inf 89.5%
if -1.15e-8 < t < -1.70000000000000009e-52Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 68.4%
Taylor expanded in x around inf 100.0%
if -1.70000000000000009e-52 < t < -7.3999999999999999e-61Initial program 76.0%
*-commutative76.0%
Simplified76.0%
clear-num76.4%
inv-pow76.4%
fma-neg76.4%
Applied egg-rr76.4%
Taylor expanded in y around inf 76.0%
associate-/l*100.0%
*-commutative100.0%
+-commutative100.0%
Simplified100.0%
if -7.3999999999999999e-61 < t < 1.15e11Initial program 90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in t around 0 72.7%
associate-+r+72.7%
mul-1-neg72.7%
unsub-neg72.7%
+-commutative72.7%
associate-/l*77.7%
+-commutative77.7%
Simplified77.7%
Taylor expanded in y around 0 72.6%
mul-1-neg72.6%
+-commutative72.6%
*-commutative72.6%
times-frac78.5%
sub-neg78.5%
associate-*r/77.7%
associate-/l*78.5%
associate-/l/78.5%
Simplified78.5%
Final simplification85.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.8e+49) (not (<= z 3.5e-9))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (- x (/ x (- (* z t) x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.8e+49) || !(z <= 3.5e-9)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
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 <= (-5.8d+49)) .or. (.not. (z <= 3.5d-9))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x - (x / ((z * t) - x))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.8e+49) || !(z <= 3.5e-9)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.8e+49) or not (z <= 3.5e-9): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x - (x / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.8e+49) || !(z <= 3.5e-9)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.8e+49) || ~((z <= 3.5e-9))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x - (x / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.8e+49], N[Not[LessEqual[z, 3.5e-9]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+49} \lor \neg \left(z \leq 3.5 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if z < -5.8e49 or 3.4999999999999999e-9 < z Initial program 73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in z around inf 85.5%
if -5.8e49 < z < 3.4999999999999999e-9Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 80.6%
Final simplification82.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.95e-143) (not (<= z 3.8e-75))) (/ (+ x (/ y t)) (+ x 1.0)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.95e-143) || !(z <= 3.8e-75)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
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 <= (-2.95d-143)) .or. (.not. (z <= 3.8d-75))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.95e-143) || !(z <= 3.8e-75)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.95e-143) or not (z <= 3.8e-75): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.95e-143) || !(z <= 3.8e-75)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.95e-143) || ~((z <= 3.8e-75))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.95e-143], N[Not[LessEqual[z, 3.8e-75]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.95 \cdot 10^{-143} \lor \neg \left(z \leq 3.8 \cdot 10^{-75}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -2.95e-143 or 3.79999999999999994e-75 < z Initial program 82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in z around inf 82.7%
if -2.95e-143 < z < 3.79999999999999994e-75Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 46.9%
Taylor expanded in x around inf 68.4%
Final simplification77.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.5e-144) (not (<= z 4.1e-75))) (/ (+ x (/ y t)) (+ x 1.0)) (+ 1.0 (* y (- z (/ z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.5e-144) || !(z <= 4.1e-75)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (y * (z - (z / x)));
}
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 <= (-2.5d-144)) .or. (.not. (z <= 4.1d-75))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 + (y * (z - (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.5e-144) || !(z <= 4.1e-75)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (y * (z - (z / x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.5e-144) or not (z <= 4.1e-75): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 + (y * (z - (z / x))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.5e-144) || !(z <= 4.1e-75)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 + Float64(y * Float64(z - Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.5e-144) || ~((z <= 4.1e-75))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 + (y * (z - (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.5e-144], N[Not[LessEqual[z, 4.1e-75]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[(z - N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-144} \lor \neg \left(z \leq 4.1 \cdot 10^{-75}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \left(z - \frac{z}{x}\right)\\
\end{array}
\end{array}
if z < -2.4999999999999999e-144 or 4.10000000000000002e-75 < z Initial program 82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in z around inf 82.7%
if -2.4999999999999999e-144 < z < 4.10000000000000002e-75Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 79.6%
associate-+r+79.6%
mul-1-neg79.6%
unsub-neg79.6%
+-commutative79.6%
associate-/l*79.6%
+-commutative79.6%
Simplified79.6%
Taylor expanded in x around 0 71.7%
associate--l+71.7%
associate-*r/71.7%
associate-*r*71.7%
neg-mul-171.7%
associate-*r*71.7%
neg-mul-171.7%
distribute-lft-out--71.7%
Simplified71.7%
Final simplification79.0%
(FPCore (x y z t)
:precision binary64
(if (<= x -5.4e-82)
1.0
(if (<= x -4.5e-149)
(* x (+ 1.0 (/ -1.0 (* z t))))
(if (<= x 7e-89) (/ y t) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.4e-82) {
tmp = 1.0;
} else if (x <= -4.5e-149) {
tmp = x * (1.0 + (-1.0 / (z * t)));
} else if (x <= 7e-89) {
tmp = y / t;
} else {
tmp = 1.0;
}
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 (x <= (-5.4d-82)) then
tmp = 1.0d0
else if (x <= (-4.5d-149)) then
tmp = x * (1.0d0 + ((-1.0d0) / (z * t)))
else if (x <= 7d-89) then
tmp = y / t
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.4e-82) {
tmp = 1.0;
} else if (x <= -4.5e-149) {
tmp = x * (1.0 + (-1.0 / (z * t)));
} else if (x <= 7e-89) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.4e-82: tmp = 1.0 elif x <= -4.5e-149: tmp = x * (1.0 + (-1.0 / (z * t))) elif x <= 7e-89: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.4e-82) tmp = 1.0; elseif (x <= -4.5e-149) tmp = Float64(x * Float64(1.0 + Float64(-1.0 / Float64(z * t)))); elseif (x <= 7e-89) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.4e-82) tmp = 1.0; elseif (x <= -4.5e-149) tmp = x * (1.0 + (-1.0 / (z * t))); elseif (x <= 7e-89) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.4e-82], 1.0, If[LessEqual[x, -4.5e-149], N[(x * N[(1.0 + N[(-1.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e-89], N[(y / t), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{-82}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-149}:\\
\;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-89}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -5.4000000000000003e-82 or 6.9999999999999994e-89 < x Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in z around inf 69.2%
Taylor expanded in x around inf 77.9%
if -5.4000000000000003e-82 < x < -4.4999999999999998e-149Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in t around -inf 71.4%
mul-1-neg71.4%
distribute-lft-out--71.4%
Simplified71.4%
Taylor expanded in y around 0 55.0%
+-commutative55.0%
Simplified55.0%
Taylor expanded in x around 0 55.0%
if -4.4999999999999998e-149 < x < 6.9999999999999994e-89Initial program 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in z around inf 75.3%
Taylor expanded in x around 0 55.9%
Final simplification69.4%
(FPCore (x y z t) :precision binary64 (if (<= x -8e-82) 1.0 (if (<= x -1.9e-149) (- x (/ (/ x t) z)) (if (<= x 2.75e-89) (/ y t) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8e-82) {
tmp = 1.0;
} else if (x <= -1.9e-149) {
tmp = x - ((x / t) / z);
} else if (x <= 2.75e-89) {
tmp = y / t;
} else {
tmp = 1.0;
}
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 (x <= (-8d-82)) then
tmp = 1.0d0
else if (x <= (-1.9d-149)) then
tmp = x - ((x / t) / z)
else if (x <= 2.75d-89) then
tmp = y / t
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8e-82) {
tmp = 1.0;
} else if (x <= -1.9e-149) {
tmp = x - ((x / t) / z);
} else if (x <= 2.75e-89) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -8e-82: tmp = 1.0 elif x <= -1.9e-149: tmp = x - ((x / t) / z) elif x <= 2.75e-89: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -8e-82) tmp = 1.0; elseif (x <= -1.9e-149) tmp = Float64(x - Float64(Float64(x / t) / z)); elseif (x <= 2.75e-89) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -8e-82) tmp = 1.0; elseif (x <= -1.9e-149) tmp = x - ((x / t) / z); elseif (x <= 2.75e-89) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -8e-82], 1.0, If[LessEqual[x, -1.9e-149], N[(x - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.75e-89], N[(y / t), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-82}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-149}:\\
\;\;\;\;x - \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{-89}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -8e-82 or 2.75000000000000006e-89 < x Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in z around inf 69.2%
Taylor expanded in x around inf 77.9%
if -8e-82 < x < -1.90000000000000003e-149Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in t around -inf 71.4%
mul-1-neg71.4%
distribute-lft-out--71.4%
Simplified71.4%
Taylor expanded in y around 0 55.0%
+-commutative55.0%
Simplified55.0%
Taylor expanded in x around 0 55.0%
sub-neg55.0%
distribute-rgt-in55.0%
*-lft-identity55.0%
cancel-sign-sub-inv55.0%
associate-*l/55.0%
times-frac55.1%
associate-*l/55.0%
*-lft-identity55.0%
Simplified55.0%
Taylor expanded in x around 0 55.0%
associate-/r*53.9%
Simplified53.9%
if -1.90000000000000003e-149 < x < 2.75000000000000006e-89Initial program 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in z around inf 75.3%
Taylor expanded in x around 0 55.9%
Final simplification69.3%
(FPCore (x y z t) :precision binary64 (if (<= x -1.05e-81) 1.0 (if (<= x -7.5e-149) (- x (/ (/ x z) t)) (if (<= x 1.4e-87) (/ y t) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.05e-81) {
tmp = 1.0;
} else if (x <= -7.5e-149) {
tmp = x - ((x / z) / t);
} else if (x <= 1.4e-87) {
tmp = y / t;
} else {
tmp = 1.0;
}
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 (x <= (-1.05d-81)) then
tmp = 1.0d0
else if (x <= (-7.5d-149)) then
tmp = x - ((x / z) / t)
else if (x <= 1.4d-87) then
tmp = y / t
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.05e-81) {
tmp = 1.0;
} else if (x <= -7.5e-149) {
tmp = x - ((x / z) / t);
} else if (x <= 1.4e-87) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.05e-81: tmp = 1.0 elif x <= -7.5e-149: tmp = x - ((x / z) / t) elif x <= 1.4e-87: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.05e-81) tmp = 1.0; elseif (x <= -7.5e-149) tmp = Float64(x - Float64(Float64(x / z) / t)); elseif (x <= 1.4e-87) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.05e-81) tmp = 1.0; elseif (x <= -7.5e-149) tmp = x - ((x / z) / t); elseif (x <= 1.4e-87) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.05e-81], 1.0, If[LessEqual[x, -7.5e-149], N[(x - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-87], N[(y / t), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-81}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-149}:\\
\;\;\;\;x - \frac{\frac{x}{z}}{t}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-87}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.05e-81 or 1.4e-87 < x Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in z around inf 69.2%
Taylor expanded in x around inf 77.9%
if -1.05e-81 < x < -7.49999999999999995e-149Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in t around -inf 71.4%
mul-1-neg71.4%
distribute-lft-out--71.4%
Simplified71.4%
Taylor expanded in y around 0 55.0%
+-commutative55.0%
Simplified55.0%
Taylor expanded in x around 0 55.0%
sub-neg55.0%
distribute-rgt-in55.0%
*-lft-identity55.0%
cancel-sign-sub-inv55.0%
associate-*l/55.0%
times-frac55.1%
associate-*l/55.0%
*-lft-identity55.0%
Simplified55.0%
if -7.49999999999999995e-149 < x < 1.4e-87Initial program 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in z around inf 75.3%
Taylor expanded in x around 0 55.9%
Final simplification69.4%
(FPCore (x y z t) :precision binary64 (if (<= x -9.2e-82) 1.0 (if (<= x -7.4e-149) x (if (<= x 2.55e-89) (/ y t) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.2e-82) {
tmp = 1.0;
} else if (x <= -7.4e-149) {
tmp = x;
} else if (x <= 2.55e-89) {
tmp = y / t;
} else {
tmp = 1.0;
}
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 (x <= (-9.2d-82)) then
tmp = 1.0d0
else if (x <= (-7.4d-149)) then
tmp = x
else if (x <= 2.55d-89) then
tmp = y / t
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.2e-82) {
tmp = 1.0;
} else if (x <= -7.4e-149) {
tmp = x;
} else if (x <= 2.55e-89) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9.2e-82: tmp = 1.0 elif x <= -7.4e-149: tmp = x elif x <= 2.55e-89: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9.2e-82) tmp = 1.0; elseif (x <= -7.4e-149) tmp = x; elseif (x <= 2.55e-89) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -9.2e-82) tmp = 1.0; elseif (x <= -7.4e-149) tmp = x; elseif (x <= 2.55e-89) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9.2e-82], 1.0, If[LessEqual[x, -7.4e-149], x, If[LessEqual[x, 2.55e-89], N[(y / t), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{-82}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -7.4 \cdot 10^{-149}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{-89}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -9.19999999999999988e-82 or 2.55000000000000002e-89 < x Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in z around inf 69.2%
Taylor expanded in x around inf 77.9%
if -9.19999999999999988e-82 < x < -7.3999999999999998e-149Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in t around -inf 71.4%
mul-1-neg71.4%
distribute-lft-out--71.4%
Simplified71.4%
Taylor expanded in y around 0 55.0%
+-commutative55.0%
Simplified55.0%
Taylor expanded in x around 0 55.0%
sub-neg55.0%
distribute-rgt-in55.0%
*-lft-identity55.0%
cancel-sign-sub-inv55.0%
associate-*l/55.0%
times-frac55.1%
associate-*l/55.0%
*-lft-identity55.0%
Simplified55.0%
Taylor expanded in z around inf 47.5%
if -7.3999999999999998e-149 < x < 2.55000000000000002e-89Initial program 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in z around inf 75.3%
Taylor expanded in x around 0 55.9%
Final simplification68.9%
(FPCore (x y z t) :precision binary64 (if (<= x -4.8e-82) 1.0 (if (<= x 5.5e-54) x 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.8e-82) {
tmp = 1.0;
} else if (x <= 5.5e-54) {
tmp = x;
} else {
tmp = 1.0;
}
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 (x <= (-4.8d-82)) then
tmp = 1.0d0
else if (x <= 5.5d-54) then
tmp = x
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.8e-82) {
tmp = 1.0;
} else if (x <= 5.5e-54) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.8e-82: tmp = 1.0 elif x <= 5.5e-54: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.8e-82) tmp = 1.0; elseif (x <= 5.5e-54) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.8e-82) tmp = 1.0; elseif (x <= 5.5e-54) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.8e-82], 1.0, If[LessEqual[x, 5.5e-54], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{-82}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-54}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -4.80000000000000017e-82 or 5.50000000000000046e-54 < x Initial program 87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in z around inf 69.1%
Taylor expanded in x around inf 79.2%
if -4.80000000000000017e-82 < x < 5.50000000000000046e-54Initial program 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in t around -inf 81.0%
mul-1-neg81.0%
distribute-lft-out--81.0%
Simplified81.0%
Taylor expanded in y around 0 35.4%
+-commutative35.4%
Simplified35.4%
Taylor expanded in x around 0 35.4%
sub-neg35.4%
distribute-rgt-in35.4%
*-lft-identity35.4%
cancel-sign-sub-inv35.4%
associate-*l/35.4%
times-frac35.5%
associate-*l/35.5%
*-lft-identity35.5%
Simplified35.5%
Taylor expanded in z around inf 28.0%
Final simplification58.8%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
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 = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in z around inf 70.8%
Taylor expanded in x around inf 53.0%
Final simplification53.0%
(FPCore (x y z t) :precision binary64 (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
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 / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
def code(x, y, z, t): return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(y / Float64(t - Float64(x / z))) - Float64(x / Float64(Float64(t * z) - x)))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}
\end{array}
herbie shell --seed 2024019
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))