
(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 12 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 (/ x (+ x 1.0)))
(t_2 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0)))
(t_3 (* z (+ x 1.0))))
(if (<= t_2 -5e+199)
(+ t_1 (- (/ y (* t (+ x 1.0))) (/ (/ x t) t_3)))
(if (<= t_2 2e+302) t_2 (+ t_1 (/ (- (/ y (+ x 1.0)) (/ x t_3)) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double t_3 = z * (x + 1.0);
double tmp;
if (t_2 <= -5e+199) {
tmp = t_1 + ((y / (t * (x + 1.0))) - ((x / t) / t_3));
} else if (t_2 <= 2e+302) {
tmp = t_2;
} else {
tmp = t_1 + (((y / (x + 1.0)) - (x / t_3)) / 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x / (x + 1.0d0)
t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0d0)
t_3 = z * (x + 1.0d0)
if (t_2 <= (-5d+199)) then
tmp = t_1 + ((y / (t * (x + 1.0d0))) - ((x / t) / t_3))
else if (t_2 <= 2d+302) then
tmp = t_2
else
tmp = t_1 + (((y / (x + 1.0d0)) - (x / t_3)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double t_3 = z * (x + 1.0);
double tmp;
if (t_2 <= -5e+199) {
tmp = t_1 + ((y / (t * (x + 1.0))) - ((x / t) / t_3));
} else if (t_2 <= 2e+302) {
tmp = t_2;
} else {
tmp = t_1 + (((y / (x + 1.0)) - (x / t_3)) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) t_3 = z * (x + 1.0) tmp = 0 if t_2 <= -5e+199: tmp = t_1 + ((y / (t * (x + 1.0))) - ((x / t) / t_3)) elif t_2 <= 2e+302: tmp = t_2 else: tmp = t_1 + (((y / (x + 1.0)) - (x / t_3)) / t) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) t_3 = Float64(z * Float64(x + 1.0)) tmp = 0.0 if (t_2 <= -5e+199) tmp = Float64(t_1 + Float64(Float64(y / Float64(t * Float64(x + 1.0))) - Float64(Float64(x / t) / t_3))); elseif (t_2 <= 2e+302) tmp = t_2; else tmp = Float64(t_1 + Float64(Float64(Float64(y / Float64(x + 1.0)) - Float64(x / t_3)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); t_3 = z * (x + 1.0); tmp = 0.0; if (t_2 <= -5e+199) tmp = t_1 + ((y / (t * (x + 1.0))) - ((x / t) / t_3)); elseif (t_2 <= 2e+302) tmp = t_2; else tmp = t_1 + (((y / (x + 1.0)) - (x / t_3)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+199], N[(t$95$1 + N[(N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x / t), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+302], t$95$2, N[(t$95$1 + N[(N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x / t$95$3), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
t_3 := z \cdot \left(x + 1\right)\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+199}:\\
\;\;\;\;t_1 + \left(\frac{y}{t \cdot \left(x + 1\right)} - \frac{\frac{x}{t}}{t_3}\right)\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{\frac{y}{x + 1} - \frac{x}{t_3}}{t}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -4.9999999999999998e199Initial program 61.6%
*-commutative61.6%
Simplified61.6%
Taylor expanded in t around inf 93.3%
associate--l+93.3%
+-commutative93.3%
+-commutative93.3%
associate-/r*93.3%
+-commutative93.3%
Simplified93.3%
if -4.9999999999999998e199 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2.0000000000000002e302Initial program 99.8%
if 2.0000000000000002e302 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 43.8%
*-commutative43.8%
Simplified43.8%
Taylor expanded in t around -inf 86.5%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (or (<= t_1 -5e+199) (not (<= t_1 2e+302)))
(+ (/ x (+ x 1.0)) (- (/ y (* t (+ x 1.0))) (/ (/ x t) (* z (+ x 1.0)))))
t_1)))
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 <= -5e+199) || !(t_1 <= 2e+302)) {
tmp = (x / (x + 1.0)) + ((y / (t * (x + 1.0))) - ((x / t) / (z * (x + 1.0))));
} 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 * z) - x) / ((z * t) - x))) / (x + 1.0d0)
if ((t_1 <= (-5d+199)) .or. (.not. (t_1 <= 2d+302))) then
tmp = (x / (x + 1.0d0)) + ((y / (t * (x + 1.0d0))) - ((x / t) / (z * (x + 1.0d0))))
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 * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if ((t_1 <= -5e+199) || !(t_1 <= 2e+302)) {
tmp = (x / (x + 1.0)) + ((y / (t * (x + 1.0))) - ((x / t) / (z * (x + 1.0))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) tmp = 0 if (t_1 <= -5e+199) or not (t_1 <= 2e+302): tmp = (x / (x + 1.0)) + ((y / (t * (x + 1.0))) - ((x / t) / (z * (x + 1.0)))) else: tmp = t_1 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 <= -5e+199) || !(t_1 <= 2e+302)) tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(Float64(y / Float64(t * Float64(x + 1.0))) - Float64(Float64(x / t) / Float64(z * Float64(x + 1.0))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); tmp = 0.0; if ((t_1 <= -5e+199) || ~((t_1 <= 2e+302))) tmp = (x / (x + 1.0)) + ((y / (t * (x + 1.0))) - ((x / t) / (z * (x + 1.0)))); else tmp = t_1; end tmp_2 = 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[Or[LessEqual[t$95$1, -5e+199], N[Not[LessEqual[t$95$1, 2e+302]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x / t), $MachinePrecision] / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\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 -5 \cdot 10^{+199} \lor \neg \left(t_1 \leq 2 \cdot 10^{+302}\right):\\
\;\;\;\;\frac{x}{x + 1} + \left(\frac{y}{t \cdot \left(x + 1\right)} - \frac{\frac{x}{t}}{z \cdot \left(x + 1\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -4.9999999999999998e199 or 2.0000000000000002e302 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 51.2%
*-commutative51.2%
Simplified51.2%
Taylor expanded in t around inf 89.3%
associate--l+89.3%
+-commutative89.3%
+-commutative89.3%
associate-/r*89.3%
+-commutative89.3%
Simplified89.3%
if -4.9999999999999998e199 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2.0000000000000002e302Initial program 99.8%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (or (<= t_1 -5e+199) (not (<= t_1 2e+302)))
(/ (+ x (/ y t)) (+ x 1.0))
t_1)))
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 <= -5e+199) || !(t_1 <= 2e+302)) {
tmp = (x + (y / t)) / (x + 1.0);
} 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 * z) - x) / ((z * t) - x))) / (x + 1.0d0)
if ((t_1 <= (-5d+199)) .or. (.not. (t_1 <= 2d+302))) then
tmp = (x + (y / t)) / (x + 1.0d0)
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 * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if ((t_1 <= -5e+199) || !(t_1 <= 2e+302)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) tmp = 0 if (t_1 <= -5e+199) or not (t_1 <= 2e+302): tmp = (x + (y / t)) / (x + 1.0) else: tmp = t_1 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 <= -5e+199) || !(t_1 <= 2e+302)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); tmp = 0.0; if ((t_1 <= -5e+199) || ~((t_1 <= 2e+302))) tmp = (x + (y / t)) / (x + 1.0); else tmp = t_1; end tmp_2 = 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[Or[LessEqual[t$95$1, -5e+199], N[Not[LessEqual[t$95$1, 2e+302]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]
\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 -5 \cdot 10^{+199} \lor \neg \left(t_1 \leq 2 \cdot 10^{+302}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -4.9999999999999998e199 or 2.0000000000000002e302 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 51.2%
*-commutative51.2%
Simplified51.2%
Taylor expanded in z around inf 89.1%
if -4.9999999999999998e199 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2.0000000000000002e302Initial program 99.8%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= z -5.8e-60)
t_1
(if (<= z -4.4e-279)
(/ (- x (/ x (- (* z t) x))) (+ x 1.0))
(if (<= z 4.8e-197)
(/ (+ x (+ 1.0 (/ (* z (- t y)) x))) (+ x 1.0))
(if (<= z 4.5e-36)
(/ (+ x (/ 1.0 (- (- -1.0) (/ t (/ x z))))) (+ x 1.0))
(if (<= z 370000000.0)
(/ (+ x (/ (- x (* y z)) x)) (+ x 1.0))
t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -5.8e-60) {
tmp = t_1;
} else if (z <= -4.4e-279) {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
} else if (z <= 4.8e-197) {
tmp = (x + (1.0 + ((z * (t - y)) / x))) / (x + 1.0);
} else if (z <= 4.5e-36) {
tmp = (x + (1.0 / (-(-1.0) - (t / (x / z))))) / (x + 1.0);
} else if (z <= 370000000.0) {
tmp = (x + ((x - (y * z)) / x)) / (x + 1.0);
} 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 (z <= (-5.8d-60)) then
tmp = t_1
else if (z <= (-4.4d-279)) then
tmp = (x - (x / ((z * t) - x))) / (x + 1.0d0)
else if (z <= 4.8d-197) then
tmp = (x + (1.0d0 + ((z * (t - y)) / x))) / (x + 1.0d0)
else if (z <= 4.5d-36) then
tmp = (x + (1.0d0 / (-(-1.0d0) - (t / (x / z))))) / (x + 1.0d0)
else if (z <= 370000000.0d0) then
tmp = (x + ((x - (y * z)) / x)) / (x + 1.0d0)
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 (z <= -5.8e-60) {
tmp = t_1;
} else if (z <= -4.4e-279) {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
} else if (z <= 4.8e-197) {
tmp = (x + (1.0 + ((z * (t - y)) / x))) / (x + 1.0);
} else if (z <= 4.5e-36) {
tmp = (x + (1.0 / (-(-1.0) - (t / (x / z))))) / (x + 1.0);
} else if (z <= 370000000.0) {
tmp = (x + ((x - (y * z)) / x)) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if z <= -5.8e-60: tmp = t_1 elif z <= -4.4e-279: tmp = (x - (x / ((z * t) - x))) / (x + 1.0) elif z <= 4.8e-197: tmp = (x + (1.0 + ((z * (t - y)) / x))) / (x + 1.0) elif z <= 4.5e-36: tmp = (x + (1.0 / (-(-1.0) - (t / (x / z))))) / (x + 1.0) elif z <= 370000000.0: tmp = (x + ((x - (y * z)) / x)) / (x + 1.0) 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 (z <= -5.8e-60) tmp = t_1; elseif (z <= -4.4e-279) tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); elseif (z <= 4.8e-197) tmp = Float64(Float64(x + Float64(1.0 + Float64(Float64(z * Float64(t - y)) / x))) / Float64(x + 1.0)); elseif (z <= 4.5e-36) tmp = Float64(Float64(x + Float64(1.0 / Float64(Float64(-(-1.0)) - Float64(t / Float64(x / z))))) / Float64(x + 1.0)); elseif (z <= 370000000.0) tmp = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / x)) / Float64(x + 1.0)); 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 (z <= -5.8e-60) tmp = t_1; elseif (z <= -4.4e-279) tmp = (x - (x / ((z * t) - x))) / (x + 1.0); elseif (z <= 4.8e-197) tmp = (x + (1.0 + ((z * (t - y)) / x))) / (x + 1.0); elseif (z <= 4.5e-36) tmp = (x + (1.0 / (-(-1.0) - (t / (x / z))))) / (x + 1.0); elseif (z <= 370000000.0) tmp = (x + ((x - (y * z)) / x)) / (x + 1.0); 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[z, -5.8e-60], t$95$1, If[LessEqual[z, -4.4e-279], N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e-197], N[(N[(x + N[(1.0 + N[(N[(z * N[(t - y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-36], N[(N[(x + N[(1.0 / N[((--1.0) - N[(t / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 370000000.0], N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-279}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-197}:\\
\;\;\;\;\frac{x + \left(1 + \frac{z \cdot \left(t - y\right)}{x}\right)}{x + 1}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-36}:\\
\;\;\;\;\frac{x + \frac{1}{\left(--1\right) - \frac{t}{\frac{x}{z}}}}{x + 1}\\
\mathbf{elif}\;z \leq 370000000:\\
\;\;\;\;\frac{x + \frac{x - y \cdot z}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.7999999999999999e-60 or 3.7e8 < z Initial program 87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in z around inf 85.4%
if -5.7999999999999999e-60 < z < -4.40000000000000001e-279Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 87.6%
+-commutative87.6%
Simplified87.6%
if -4.40000000000000001e-279 < z < 4.8000000000000002e-197Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 93.0%
associate--l+93.0%
associate-*r/93.0%
associate-*r/93.0%
div-sub93.0%
distribute-lft-out--93.0%
associate-*r/93.0%
mul-1-neg93.0%
unsub-neg93.0%
distribute-rgt-out--93.0%
Simplified93.0%
if 4.8000000000000002e-197 < z < 4.50000000000000024e-36Initial program 99.9%
*-commutative99.9%
Simplified99.9%
clear-num99.9%
inv-pow99.9%
fma-neg99.9%
Applied egg-rr99.9%
unpow-199.9%
*-commutative99.9%
fma-neg99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 87.0%
mul-1-neg87.0%
div-sub87.0%
sub-neg87.0%
associate-/l*87.1%
*-inverses87.1%
metadata-eval87.1%
Simplified87.1%
if 4.50000000000000024e-36 < z < 3.7e8Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 91.0%
fma-neg91.0%
associate-*r/91.0%
neg-mul-191.0%
neg-sub091.0%
fma-def91.0%
+-commutative91.0%
associate--r+91.0%
neg-sub091.0%
remove-double-neg91.0%
*-commutative91.0%
Simplified91.0%
Final simplification87.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x (/ x (- (* z t) x))) (+ x 1.0)))
(t_2 (/ (+ x (/ y t)) (+ x 1.0)))
(t_3 (/ (+ x (/ (- x (* y z)) x)) (+ x 1.0))))
(if (<= z -1.32e-61)
t_2
(if (<= z -4e-290)
t_1
(if (<= z 1.75e-183)
t_3
(if (<= z 6.5e-36) t_1 (if (<= z 380000000000.0) t_3 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x - (x / ((z * t) - x))) / (x + 1.0);
double t_2 = (x + (y / t)) / (x + 1.0);
double t_3 = (x + ((x - (y * z)) / x)) / (x + 1.0);
double tmp;
if (z <= -1.32e-61) {
tmp = t_2;
} else if (z <= -4e-290) {
tmp = t_1;
} else if (z <= 1.75e-183) {
tmp = t_3;
} else if (z <= 6.5e-36) {
tmp = t_1;
} else if (z <= 380000000000.0) {
tmp = t_3;
} else {
tmp = t_2;
}
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) :: t_3
real(8) :: tmp
t_1 = (x - (x / ((z * t) - x))) / (x + 1.0d0)
t_2 = (x + (y / t)) / (x + 1.0d0)
t_3 = (x + ((x - (y * z)) / x)) / (x + 1.0d0)
if (z <= (-1.32d-61)) then
tmp = t_2
else if (z <= (-4d-290)) then
tmp = t_1
else if (z <= 1.75d-183) then
tmp = t_3
else if (z <= 6.5d-36) then
tmp = t_1
else if (z <= 380000000000.0d0) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - (x / ((z * t) - x))) / (x + 1.0);
double t_2 = (x + (y / t)) / (x + 1.0);
double t_3 = (x + ((x - (y * z)) / x)) / (x + 1.0);
double tmp;
if (z <= -1.32e-61) {
tmp = t_2;
} else if (z <= -4e-290) {
tmp = t_1;
} else if (z <= 1.75e-183) {
tmp = t_3;
} else if (z <= 6.5e-36) {
tmp = t_1;
} else if (z <= 380000000000.0) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - (x / ((z * t) - x))) / (x + 1.0) t_2 = (x + (y / t)) / (x + 1.0) t_3 = (x + ((x - (y * z)) / x)) / (x + 1.0) tmp = 0 if z <= -1.32e-61: tmp = t_2 elif z <= -4e-290: tmp = t_1 elif z <= 1.75e-183: tmp = t_3 elif z <= 6.5e-36: tmp = t_1 elif z <= 380000000000.0: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) t_2 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) t_3 = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / x)) / Float64(x + 1.0)) tmp = 0.0 if (z <= -1.32e-61) tmp = t_2; elseif (z <= -4e-290) tmp = t_1; elseif (z <= 1.75e-183) tmp = t_3; elseif (z <= 6.5e-36) tmp = t_1; elseif (z <= 380000000000.0) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - (x / ((z * t) - x))) / (x + 1.0); t_2 = (x + (y / t)) / (x + 1.0); t_3 = (x + ((x - (y * z)) / x)) / (x + 1.0); tmp = 0.0; if (z <= -1.32e-61) tmp = t_2; elseif (z <= -4e-290) tmp = t_1; elseif (z <= 1.75e-183) tmp = t_3; elseif (z <= 6.5e-36) tmp = t_1; elseif (z <= 380000000000.0) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.32e-61], t$95$2, If[LessEqual[z, -4e-290], t$95$1, If[LessEqual[z, 1.75e-183], t$95$3, If[LessEqual[z, 6.5e-36], t$95$1, If[LessEqual[z, 380000000000.0], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
t_2 := \frac{x + \frac{y}{t}}{x + 1}\\
t_3 := \frac{x + \frac{x - y \cdot z}{x}}{x + 1}\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{-61}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-290}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-183}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 380000000000:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.32000000000000002e-61 or 3.8e11 < z Initial program 87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in z around inf 85.4%
if -1.32000000000000002e-61 < z < -4.0000000000000003e-290 or 1.74999999999999996e-183 < z < 6.50000000000000012e-36Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 89.1%
+-commutative89.1%
Simplified89.1%
if -4.0000000000000003e-290 < z < 1.74999999999999996e-183 or 6.50000000000000012e-36 < z < 3.8e11Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 88.7%
fma-neg88.7%
associate-*r/88.7%
neg-mul-188.7%
neg-sub088.7%
fma-def88.7%
+-commutative88.7%
associate--r+88.7%
neg-sub088.7%
remove-double-neg88.7%
*-commutative88.7%
Simplified88.7%
Final simplification87.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x (/ x (- (* z t) x))) (+ x 1.0)))
(t_2 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= z -3.2e-65)
t_2
(if (<= z -2.8e-286)
t_1
(if (<= z 4.8e-197)
(/ (+ x (+ 1.0 (/ (* z (- t y)) x))) (+ x 1.0))
(if (<= z 6.8e-36)
t_1
(if (<= z 26000000.0)
(/ (+ x (/ (- x (* y z)) x)) (+ x 1.0))
t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x - (x / ((z * t) - x))) / (x + 1.0);
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -3.2e-65) {
tmp = t_2;
} else if (z <= -2.8e-286) {
tmp = t_1;
} else if (z <= 4.8e-197) {
tmp = (x + (1.0 + ((z * (t - y)) / x))) / (x + 1.0);
} else if (z <= 6.8e-36) {
tmp = t_1;
} else if (z <= 26000000.0) {
tmp = (x + ((x - (y * z)) / x)) / (x + 1.0);
} else {
tmp = t_2;
}
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 = (x - (x / ((z * t) - x))) / (x + 1.0d0)
t_2 = (x + (y / t)) / (x + 1.0d0)
if (z <= (-3.2d-65)) then
tmp = t_2
else if (z <= (-2.8d-286)) then
tmp = t_1
else if (z <= 4.8d-197) then
tmp = (x + (1.0d0 + ((z * (t - y)) / x))) / (x + 1.0d0)
else if (z <= 6.8d-36) then
tmp = t_1
else if (z <= 26000000.0d0) then
tmp = (x + ((x - (y * z)) / x)) / (x + 1.0d0)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - (x / ((z * t) - x))) / (x + 1.0);
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -3.2e-65) {
tmp = t_2;
} else if (z <= -2.8e-286) {
tmp = t_1;
} else if (z <= 4.8e-197) {
tmp = (x + (1.0 + ((z * (t - y)) / x))) / (x + 1.0);
} else if (z <= 6.8e-36) {
tmp = t_1;
} else if (z <= 26000000.0) {
tmp = (x + ((x - (y * z)) / x)) / (x + 1.0);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - (x / ((z * t) - x))) / (x + 1.0) t_2 = (x + (y / t)) / (x + 1.0) tmp = 0 if z <= -3.2e-65: tmp = t_2 elif z <= -2.8e-286: tmp = t_1 elif z <= 4.8e-197: tmp = (x + (1.0 + ((z * (t - y)) / x))) / (x + 1.0) elif z <= 6.8e-36: tmp = t_1 elif z <= 26000000.0: tmp = (x + ((x - (y * z)) / x)) / (x + 1.0) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) t_2 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (z <= -3.2e-65) tmp = t_2; elseif (z <= -2.8e-286) tmp = t_1; elseif (z <= 4.8e-197) tmp = Float64(Float64(x + Float64(1.0 + Float64(Float64(z * Float64(t - y)) / x))) / Float64(x + 1.0)); elseif (z <= 6.8e-36) tmp = t_1; elseif (z <= 26000000.0) tmp = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / x)) / Float64(x + 1.0)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - (x / ((z * t) - x))) / (x + 1.0); t_2 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (z <= -3.2e-65) tmp = t_2; elseif (z <= -2.8e-286) tmp = t_1; elseif (z <= 4.8e-197) tmp = (x + (1.0 + ((z * (t - y)) / x))) / (x + 1.0); elseif (z <= 6.8e-36) tmp = t_1; elseif (z <= 26000000.0) tmp = (x + ((x - (y * z)) / x)) / (x + 1.0); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e-65], t$95$2, If[LessEqual[z, -2.8e-286], t$95$1, If[LessEqual[z, 4.8e-197], N[(N[(x + N[(1.0 + N[(N[(z * N[(t - y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e-36], t$95$1, If[LessEqual[z, 26000000.0], N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
t_2 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{-65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-286}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-197}:\\
\;\;\;\;\frac{x + \left(1 + \frac{z \cdot \left(t - y\right)}{x}\right)}{x + 1}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 26000000:\\
\;\;\;\;\frac{x + \frac{x - y \cdot z}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.1999999999999999e-65 or 2.6e7 < z Initial program 87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in z around inf 85.4%
if -3.1999999999999999e-65 < z < -2.8e-286 or 4.8000000000000002e-197 < z < 6.8000000000000005e-36Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 87.3%
+-commutative87.3%
Simplified87.3%
if -2.8e-286 < z < 4.8000000000000002e-197Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 93.0%
associate--l+93.0%
associate-*r/93.0%
associate-*r/93.0%
div-sub93.0%
distribute-lft-out--93.0%
associate-*r/93.0%
mul-1-neg93.0%
unsub-neg93.0%
distribute-rgt-out--93.0%
Simplified93.0%
if 6.8000000000000005e-36 < z < 2.6e7Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 91.0%
fma-neg91.0%
associate-*r/91.0%
neg-mul-191.0%
neg-sub091.0%
fma-def91.0%
+-commutative91.0%
associate--r+91.0%
neg-sub091.0%
remove-double-neg91.0%
*-commutative91.0%
Simplified91.0%
Final simplification87.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7e+32) (not (<= t 1.3e-14))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (/ 1.0 (/ (- (* z t) x) (* y z)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7e+32) || !(t <= 1.3e-14)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (1.0 / (((z * t) - x) / (y * z)))) / (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 ((t <= (-7d+32)) .or. (.not. (t <= 1.3d-14))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x + (1.0d0 / (((z * t) - x) / (y * z)))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7e+32) || !(t <= 1.3e-14)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (1.0 / (((z * t) - x) / (y * z)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -7e+32) or not (t <= 1.3e-14): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x + (1.0 / (((z * t) - x) / (y * z)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -7e+32) || !(t <= 1.3e-14)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(1.0 / Float64(Float64(Float64(z * t) - x) / Float64(y * z)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -7e+32) || ~((t <= 1.3e-14))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x + (1.0 / (((z * t) - x) / (y * z)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7e+32], N[Not[LessEqual[t, 1.3e-14]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(1.0 / N[(N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+32} \lor \neg \left(t \leq 1.3 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{z \cdot t - x}{y \cdot z}}}{x + 1}\\
\end{array}
\end{array}
if t < -7.0000000000000002e32 or 1.29999999999999998e-14 < t Initial program 89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in z around inf 90.1%
if -7.0000000000000002e32 < t < 1.29999999999999998e-14Initial program 96.3%
*-commutative96.3%
Simplified96.3%
clear-num96.3%
inv-pow96.3%
fma-neg96.3%
Applied egg-rr96.3%
unpow-196.3%
*-commutative96.3%
fma-neg96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in y around inf 83.6%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6e-178) (not (<= z 430000000.0))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (/ (- x (* y z)) x)) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6e-178) || !(z <= 430000000.0)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + ((x - (y * z)) / 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 <= (-6d-178)) .or. (.not. (z <= 430000000.0d0))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x + ((x - (y * z)) / 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 <= -6e-178) || !(z <= 430000000.0)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + ((x - (y * z)) / x)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6e-178) or not (z <= 430000000.0): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x + ((x - (y * z)) / x)) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6e-178) || !(z <= 430000000.0)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / x)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6e-178) || ~((z <= 430000000.0))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x + ((x - (y * z)) / x)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6e-178], N[Not[LessEqual[z, 430000000.0]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-178} \lor \neg \left(z \leq 430000000\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{x - y \cdot z}{x}}{x + 1}\\
\end{array}
\end{array}
if z < -5.9999999999999997e-178 or 4.3e8 < z Initial program 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in z around inf 83.7%
if -5.9999999999999997e-178 < z < 4.3e8Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 81.1%
fma-neg81.1%
associate-*r/81.1%
neg-mul-181.1%
neg-sub081.1%
fma-def81.1%
+-commutative81.1%
associate--r+81.1%
neg-sub081.1%
remove-double-neg81.1%
*-commutative81.1%
Simplified81.1%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= x -1.85e+73) 1.0 (if (<= x 2.05e+15) (/ (+ x (/ y t)) (+ x 1.0)) (+ 1.0 (/ -1.0 x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.85e+73) {
tmp = 1.0;
} else if (x <= 2.05e+15) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (-1.0 / 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 (x <= (-1.85d+73)) then
tmp = 1.0d0
else if (x <= 2.05d+15) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.85e+73) {
tmp = 1.0;
} else if (x <= 2.05e+15) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.85e+73: tmp = 1.0 elif x <= 2.05e+15: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 + (-1.0 / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.85e+73) tmp = 1.0; elseif (x <= 2.05e+15) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.85e+73) tmp = 1.0; elseif (x <= 2.05e+15) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.85e+73], 1.0, If[LessEqual[x, 2.05e+15], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{+73}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+15}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if x < -1.84999999999999987e73Initial program 95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in z around inf 74.5%
+-commutative74.5%
div-inv74.5%
fma-def74.5%
Applied egg-rr74.5%
Taylor expanded in x around inf 95.6%
if -1.84999999999999987e73 < x < 2.05e15Initial program 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in z around inf 69.8%
if 2.05e15 < x Initial program 92.0%
*-commutative92.0%
Simplified92.0%
Taylor expanded in z around inf 75.0%
Taylor expanded in x around -inf 75.0%
mul-1-neg75.0%
unsub-neg75.0%
mul-1-neg75.0%
sub-neg75.0%
Simplified75.0%
Taylor expanded in y around 0 92.3%
Final simplification79.5%
(FPCore (x y z t) :precision binary64 (if (<= x -2.55e-43) 1.0 (if (<= x 4.4e-117) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.55e-43) {
tmp = 1.0;
} else if (x <= 4.4e-117) {
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 <= (-2.55d-43)) then
tmp = 1.0d0
else if (x <= 4.4d-117) 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 <= -2.55e-43) {
tmp = 1.0;
} else if (x <= 4.4e-117) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.55e-43: tmp = 1.0 elif x <= 4.4e-117: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.55e-43) tmp = 1.0; elseif (x <= 4.4e-117) 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 <= -2.55e-43) tmp = 1.0; elseif (x <= 4.4e-117) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.55e-43], 1.0, If[LessEqual[x, 4.4e-117], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.55 \cdot 10^{-43}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-117}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.5499999999999998e-43 or 4.4000000000000002e-117 < x Initial program 94.0%
*-commutative94.0%
Simplified94.0%
Taylor expanded in z around inf 70.0%
+-commutative70.0%
div-inv70.0%
fma-def70.0%
Applied egg-rr70.0%
Taylor expanded in x around inf 75.4%
if -2.5499999999999998e-43 < x < 4.4000000000000002e-117Initial program 91.2%
*-commutative91.2%
Simplified91.2%
clear-num91.2%
inv-pow91.2%
fma-neg91.2%
Applied egg-rr91.2%
unpow-191.2%
*-commutative91.2%
fma-neg91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in x around 0 57.8%
Final simplification69.2%
(FPCore (x y z t) :precision binary64 (if (<= x -3.8e-58) (/ x (+ x 1.0)) (if (<= x 4.5e-118) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.8e-58) {
tmp = x / (x + 1.0);
} else if (x <= 4.5e-118) {
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 <= (-3.8d-58)) then
tmp = x / (x + 1.0d0)
else if (x <= 4.5d-118) 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 <= -3.8e-58) {
tmp = x / (x + 1.0);
} else if (x <= 4.5e-118) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.8e-58: tmp = x / (x + 1.0) elif x <= 4.5e-118: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.8e-58) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= 4.5e-118) 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 <= -3.8e-58) tmp = x / (x + 1.0); elseif (x <= 4.5e-118) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.8e-58], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e-118], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-58}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.7999999999999997e-58Initial program 91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in t around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -3.7999999999999997e-58 < x < 4.5e-118Initial program 92.7%
*-commutative92.7%
Simplified92.7%
clear-num92.7%
inv-pow92.7%
fma-neg92.7%
Applied egg-rr92.7%
unpow-192.7%
*-commutative92.7%
fma-neg92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in x around 0 60.1%
if 4.5e-118 < x Initial program 94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in z around inf 68.4%
+-commutative68.4%
div-inv68.4%
fma-def68.4%
Applied egg-rr68.4%
Taylor expanded in x around inf 75.8%
Final simplification71.2%
(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 93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in z around inf 71.8%
+-commutative71.8%
div-inv71.8%
fma-def71.8%
Applied egg-rr71.8%
Taylor expanded in x around inf 51.8%
Final simplification51.8%
(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 2023320
(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)))