
(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
(if (<= z -1.62e+165)
(/ (+ x (/ y t)) (+ x 1.0))
(if (<= z 3.2e+111)
(/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))
(- (/ x (+ x 1.0)) (/ (+ (/ y (- -1.0 x)) (/ x (* z (+ x 1.0)))) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.62e+165) {
tmp = (x + (y / t)) / (x + 1.0);
} else if (z <= 3.2e+111) {
tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - (((y / (-1.0 - x)) + (x / (z * (x + 1.0)))) / 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 <= (-1.62d+165)) then
tmp = (x + (y / t)) / (x + 1.0d0)
else if (z <= 3.2d+111) then
tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0d0)
else
tmp = (x / (x + 1.0d0)) - (((y / ((-1.0d0) - x)) + (x / (z * (x + 1.0d0)))) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.62e+165) {
tmp = (x + (y / t)) / (x + 1.0);
} else if (z <= 3.2e+111) {
tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - (((y / (-1.0 - x)) + (x / (z * (x + 1.0)))) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.62e+165: tmp = (x + (y / t)) / (x + 1.0) elif z <= 3.2e+111: tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) else: tmp = (x / (x + 1.0)) - (((y / (-1.0 - x)) + (x / (z * (x + 1.0)))) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.62e+165) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); elseif (z <= 3.2e+111) tmp = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(Float64(y / Float64(-1.0 - x)) + Float64(x / Float64(z * Float64(x + 1.0)))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.62e+165) tmp = (x + (y / t)) / (x + 1.0); elseif (z <= 3.2e+111) tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); else tmp = (x / (x + 1.0)) - (((y / (-1.0 - x)) + (x / (z * (x + 1.0)))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.62e+165], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+111], 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], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] + N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.62 \cdot 10^{+165}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+111}:\\
\;\;\;\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{y}{-1 - x} + \frac{x}{z \cdot \left(x + 1\right)}}{t}\\
\end{array}
\end{array}
if z < -1.61999999999999993e165Initial program 75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in z around inf 99.9%
if -1.61999999999999993e165 < z < 3.2000000000000001e111Initial program 98.2%
if 3.2000000000000001e111 < z Initial program 68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in t around -inf 90.1%
+-commutative90.1%
mul-1-neg90.1%
unsub-neg90.1%
+-commutative90.1%
Simplified90.1%
Final simplification96.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* y z) x)))
(if (<= (/ (+ x (/ t_1 (- (* z t) x))) (+ x 1.0)) 5e+307)
(/ (+ x (* t_1 (/ (/ 1.0 (- z (/ x t))) t))) (+ x 1.0))
(- (/ x (+ x 1.0)) (/ (+ (/ y (- -1.0 x)) (/ x (* z (+ x 1.0)))) t)))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) - x;
double tmp;
if (((x + (t_1 / ((z * t) - x))) / (x + 1.0)) <= 5e+307) {
tmp = (x + (t_1 * ((1.0 / (z - (x / t))) / t))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - (((y / (-1.0 - x)) + (x / (z * (x + 1.0)))) / 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) :: tmp
t_1 = (y * z) - x
if (((x + (t_1 / ((z * t) - x))) / (x + 1.0d0)) <= 5d+307) then
tmp = (x + (t_1 * ((1.0d0 / (z - (x / t))) / t))) / (x + 1.0d0)
else
tmp = (x / (x + 1.0d0)) - (((y / ((-1.0d0) - x)) + (x / (z * (x + 1.0d0)))) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y * z) - x;
double tmp;
if (((x + (t_1 / ((z * t) - x))) / (x + 1.0)) <= 5e+307) {
tmp = (x + (t_1 * ((1.0 / (z - (x / t))) / t))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - (((y / (-1.0 - x)) + (x / (z * (x + 1.0)))) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) - x tmp = 0 if ((x + (t_1 / ((z * t) - x))) / (x + 1.0)) <= 5e+307: tmp = (x + (t_1 * ((1.0 / (z - (x / t))) / t))) / (x + 1.0) else: tmp = (x / (x + 1.0)) - (((y / (-1.0 - x)) + (x / (z * (x + 1.0)))) / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) - x) tmp = 0.0 if (Float64(Float64(x + Float64(t_1 / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) <= 5e+307) tmp = Float64(Float64(x + Float64(t_1 * Float64(Float64(1.0 / Float64(z - Float64(x / t))) / t))) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(Float64(y / Float64(-1.0 - x)) + Float64(x / Float64(z * Float64(x + 1.0)))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * z) - x; tmp = 0.0; if (((x + (t_1 / ((z * t) - x))) / (x + 1.0)) <= 5e+307) tmp = (x + (t_1 * ((1.0 / (z - (x / t))) / t))) / (x + 1.0); else tmp = (x / (x + 1.0)) - (((y / (-1.0 - x)) + (x / (z * (x + 1.0)))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[N[(N[(x + N[(t$95$1 / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 5e+307], N[(N[(x + N[(t$95$1 * N[(N[(1.0 / N[(z - N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] + N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z - x\\
\mathbf{if}\;\frac{x + \frac{t\_1}{z \cdot t - x}}{x + 1} \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\frac{x + t\_1 \cdot \frac{\frac{1}{z - \frac{x}{t}}}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{y}{-1 - x} + \frac{x}{z \cdot \left(x + 1\right)}}{t}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 5e307Initial program 96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in t around inf 96.9%
mul-1-neg96.9%
unsub-neg96.9%
Simplified96.9%
div-inv96.8%
*-commutative96.8%
Applied egg-rr96.8%
inv-pow96.8%
unpow-prod-down97.0%
inv-pow97.0%
Applied egg-rr97.0%
associate-*l/97.1%
*-lft-identity97.1%
unpow-197.1%
Simplified97.1%
if 5e307 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 18.5%
*-commutative18.5%
Simplified18.5%
Taylor expanded in t around -inf 82.7%
+-commutative82.7%
mul-1-neg82.7%
unsub-neg82.7%
+-commutative82.7%
Simplified82.7%
Final simplification95.8%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -750000.0)
(not
(or (<= t -1.8e-64) (and (not (<= t -2.8e-115)) (<= t 3.2e-138)))))
(/ (+ x (/ y t)) (+ x 1.0))
(/ (- (+ x 1.0) (* y (/ z x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -750000.0) || !((t <= -1.8e-64) || (!(t <= -2.8e-115) && (t <= 3.2e-138)))) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = ((x + 1.0) - (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 ((t <= (-750000.0d0)) .or. (.not. (t <= (-1.8d-64)) .or. (.not. (t <= (-2.8d-115))) .and. (t <= 3.2d-138))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = ((x + 1.0d0) - (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 ((t <= -750000.0) || !((t <= -1.8e-64) || (!(t <= -2.8e-115) && (t <= 3.2e-138)))) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -750000.0) or not ((t <= -1.8e-64) or (not (t <= -2.8e-115) and (t <= 3.2e-138))): tmp = (x + (y / t)) / (x + 1.0) else: tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -750000.0) || !((t <= -1.8e-64) || (!(t <= -2.8e-115) && (t <= 3.2e-138)))) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(Float64(x + 1.0) - Float64(y * Float64(z / x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -750000.0) || ~(((t <= -1.8e-64) || (~((t <= -2.8e-115)) && (t <= 3.2e-138))))) tmp = (x + (y / t)) / (x + 1.0); else tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -750000.0], N[Not[Or[LessEqual[t, -1.8e-64], And[N[Not[LessEqual[t, -2.8e-115]], $MachinePrecision], LessEqual[t, 3.2e-138]]]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -750000 \lor \neg \left(t \leq -1.8 \cdot 10^{-64} \lor \neg \left(t \leq -2.8 \cdot 10^{-115}\right) \land t \leq 3.2 \cdot 10^{-138}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\
\end{array}
\end{array}
if t < -7.5e5 or -1.7999999999999999e-64 < t < -2.79999999999999987e-115 or 3.2000000000000001e-138 < t Initial program 86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in z around inf 86.9%
if -7.5e5 < t < -1.7999999999999999e-64 or -2.79999999999999987e-115 < t < 3.2000000000000001e-138Initial program 96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in t around 0 80.2%
associate-+r+80.2%
mul-1-neg80.2%
unsub-neg80.2%
+-commutative80.2%
associate-/l*83.7%
+-commutative83.7%
Simplified83.7%
Final simplification85.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -1300000.0)
t_1
(if (<= t -9.5e-64)
(/ (+ x (/ (- x (* y z)) x)) (+ x 1.0))
(if (or (<= t -1.45e-118) (not (<= t 3.1e-139)))
t_1
(/ (- (+ x 1.0) (* y (/ z x))) (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1300000.0) {
tmp = t_1;
} else if (t <= -9.5e-64) {
tmp = (x + ((x - (y * z)) / x)) / (x + 1.0);
} else if ((t <= -1.45e-118) || !(t <= 3.1e-139)) {
tmp = t_1;
} else {
tmp = ((x + 1.0) - (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) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-1300000.0d0)) then
tmp = t_1
else if (t <= (-9.5d-64)) then
tmp = (x + ((x - (y * z)) / x)) / (x + 1.0d0)
else if ((t <= (-1.45d-118)) .or. (.not. (t <= 3.1d-139))) then
tmp = t_1
else
tmp = ((x + 1.0d0) - (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 t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1300000.0) {
tmp = t_1;
} else if (t <= -9.5e-64) {
tmp = (x + ((x - (y * z)) / x)) / (x + 1.0);
} else if ((t <= -1.45e-118) || !(t <= 3.1e-139)) {
tmp = t_1;
} else {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -1300000.0: tmp = t_1 elif t <= -9.5e-64: tmp = (x + ((x - (y * z)) / x)) / (x + 1.0) elif (t <= -1.45e-118) or not (t <= 3.1e-139): tmp = t_1 else: tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0) 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 <= -1300000.0) tmp = t_1; elseif (t <= -9.5e-64) tmp = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / x)) / Float64(x + 1.0)); elseif ((t <= -1.45e-118) || !(t <= 3.1e-139)) tmp = t_1; else tmp = Float64(Float64(Float64(x + 1.0) - Float64(y * Float64(z / x))) / Float64(x + 1.0)); 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 <= -1300000.0) tmp = t_1; elseif (t <= -9.5e-64) tmp = (x + ((x - (y * z)) / x)) / (x + 1.0); elseif ((t <= -1.45e-118) || ~((t <= 3.1e-139))) tmp = t_1; else tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0); 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, -1300000.0], t$95$1, If[LessEqual[t, -9.5e-64], N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.45e-118], N[Not[LessEqual[t, 3.1e-139]], $MachinePrecision]], t$95$1, N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -1300000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{-64}:\\
\;\;\;\;\frac{x + \frac{x - y \cdot z}{x}}{x + 1}\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-118} \lor \neg \left(t \leq 3.1 \cdot 10^{-139}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\
\end{array}
\end{array}
if t < -1.3e6 or -9.50000000000000043e-64 < t < -1.4499999999999999e-118 or 3.0999999999999999e-139 < t Initial program 86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in z around inf 86.9%
if -1.3e6 < t < -9.50000000000000043e-64Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 79.6%
neg-mul-179.6%
Simplified79.6%
if -1.4499999999999999e-118 < t < 3.0999999999999999e-139Initial program 95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in t around 0 80.4%
associate-+r+80.4%
mul-1-neg80.4%
unsub-neg80.4%
+-commutative80.4%
associate-/l*84.6%
+-commutative84.6%
Simplified84.6%
Final simplification85.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.5e+165) (not (<= z 8.5e+96))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.5e+165) || !(z <= 8.5e+96)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (((y * z) - 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 <= (-1.5d+165)) .or. (.not. (z <= 8.5d+96))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x + (((y * z) - 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 <= -1.5e+165) || !(z <= 8.5e+96)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.5e+165) or not (z <= 8.5e+96): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.5e+165) || !(z <= 8.5e+96)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(Float64(y * z) - 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 <= -1.5e+165) || ~((z <= 8.5e+96))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.5e+165], N[Not[LessEqual[z, 8.5e+96]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+165} \lor \neg \left(z \leq 8.5 \cdot 10^{+96}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if z < -1.49999999999999995e165 or 8.50000000000000025e96 < z Initial program 71.7%
*-commutative71.7%
Simplified71.7%
Taylor expanded in z around inf 92.5%
if -1.49999999999999995e165 < z < 8.50000000000000025e96Initial program 98.2%
Final simplification96.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.2e-96) (not (<= z 1.85e-123))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (/ x (- x (* z t)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e-96) || !(z <= 1.85e-123)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (x / (x - (z * 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) :: tmp
if ((z <= (-7.2d-96)) .or. (.not. (z <= 1.85d-123))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x + (x / (x - (z * t)))) / (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 <= -7.2e-96) || !(z <= 1.85e-123)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.2e-96) or not (z <= 1.85e-123): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.2e-96) || !(z <= 1.85e-123)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.2e-96) || ~((z <= 1.85e-123))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x + (x / (x - (z * t)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.2e-96], N[Not[LessEqual[z, 1.85e-123]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-96} \lor \neg \left(z \leq 1.85 \cdot 10^{-123}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\end{array}
\end{array}
if z < -7.20000000000000016e-96 or 1.85000000000000008e-123 < z Initial program 84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in z around inf 82.1%
if -7.20000000000000016e-96 < z < 1.85000000000000008e-123Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 80.9%
+-commutative80.9%
Simplified80.9%
Final simplification81.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ 1.0 (/ -1.0 x))))
(if (<= x -4.6e-23)
t_1
(if (<= x 4.8e-79) (* y (/ 1.0 t)) (if (<= x 1.0) (* x (- 1.0 x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + (-1.0 / x);
double tmp;
if (x <= -4.6e-23) {
tmp = t_1;
} else if (x <= 4.8e-79) {
tmp = y * (1.0 / t);
} else if (x <= 1.0) {
tmp = x * (1.0 - x);
} 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 + ((-1.0d0) / x)
if (x <= (-4.6d-23)) then
tmp = t_1
else if (x <= 4.8d-79) then
tmp = y * (1.0d0 / t)
else if (x <= 1.0d0) then
tmp = x * (1.0d0 - x)
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 + (-1.0 / x);
double tmp;
if (x <= -4.6e-23) {
tmp = t_1;
} else if (x <= 4.8e-79) {
tmp = y * (1.0 / t);
} else if (x <= 1.0) {
tmp = x * (1.0 - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 + (-1.0 / x) tmp = 0 if x <= -4.6e-23: tmp = t_1 elif x <= 4.8e-79: tmp = y * (1.0 / t) elif x <= 1.0: tmp = x * (1.0 - x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 + Float64(-1.0 / x)) tmp = 0.0 if (x <= -4.6e-23) tmp = t_1; elseif (x <= 4.8e-79) tmp = Float64(y * Float64(1.0 / t)); elseif (x <= 1.0) tmp = Float64(x * Float64(1.0 - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 + (-1.0 / x); tmp = 0.0; if (x <= -4.6e-23) tmp = t_1; elseif (x <= 4.8e-79) tmp = y * (1.0 / t); elseif (x <= 1.0) tmp = x * (1.0 - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.6e-23], t$95$1, If[LessEqual[x, 4.8e-79], N[(y * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.0], N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \frac{-1}{x}\\
\mathbf{if}\;x \leq -4.6 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-79}:\\
\;\;\;\;y \cdot \frac{1}{t}\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;x \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.6000000000000002e-23 or 1 < x Initial program 88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in t around inf 88.2%
+-commutative88.2%
Simplified88.2%
Taylor expanded in x around inf 87.0%
if -4.6000000000000002e-23 < x < 4.80000000000000011e-79Initial program 92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in y around inf 58.3%
associate-/l*59.9%
associate-/r*59.9%
+-commutative59.9%
Simplified59.9%
Taylor expanded in x around 0 53.7%
if 4.80000000000000011e-79 < x < 1Initial program 78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in t around inf 59.4%
+-commutative59.4%
Simplified59.4%
Taylor expanded in x around 0 59.6%
*-rgt-identity59.6%
neg-mul-159.6%
sub-neg59.6%
*-rgt-identity59.6%
Simplified59.6%
Final simplification69.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7800.0) (not (<= x 5e-7))) (/ (+ x 1.0) (+ x 1.0)) (/ (+ x (/ y t)) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7800.0) || !(x <= 5e-7)) {
tmp = (x + 1.0) / (x + 1.0);
} 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) :: tmp
if ((x <= (-7800.0d0)) .or. (.not. (x <= 5d-7))) then
tmp = (x + 1.0d0) / (x + 1.0d0)
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 tmp;
if ((x <= -7800.0) || !(x <= 5e-7)) {
tmp = (x + 1.0) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7800.0) or not (x <= 5e-7): tmp = (x + 1.0) / (x + 1.0) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7800.0) || !(x <= 5e-7)) tmp = Float64(Float64(x + 1.0) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7800.0) || ~((x <= 5e-7))) tmp = (x + 1.0) / (x + 1.0); else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7800.0], N[Not[LessEqual[x, 5e-7]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7800 \lor \neg \left(x \leq 5 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{x + 1}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if x < -7800 or 4.99999999999999977e-7 < x Initial program 89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in z around 0 89.3%
if -7800 < x < 4.99999999999999977e-7Initial program 90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in z around inf 72.9%
Final simplification80.5%
(FPCore (x y z t) :precision binary64 (if (<= x -6.8e-16) (/ 1.0 (/ (+ x 1.0) x)) (if (<= x 9.8e-76) (* y (/ z (- (* z t) x))) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.8e-16) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= 9.8e-76) {
tmp = y * (z / ((z * t) - x));
} else {
tmp = 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 (x <= (-6.8d-16)) then
tmp = 1.0d0 / ((x + 1.0d0) / x)
else if (x <= 9.8d-76) then
tmp = y * (z / ((z * t) - x))
else
tmp = 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 (x <= -6.8e-16) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= 9.8e-76) {
tmp = y * (z / ((z * t) - x));
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.8e-16: tmp = 1.0 / ((x + 1.0) / x) elif x <= 9.8e-76: tmp = y * (z / ((z * t) - x)) else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.8e-16) tmp = Float64(1.0 / Float64(Float64(x + 1.0) / x)); elseif (x <= 9.8e-76) tmp = Float64(y * Float64(z / Float64(Float64(z * t) - x))); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6.8e-16) tmp = 1.0 / ((x + 1.0) / x); elseif (x <= 9.8e-76) tmp = y * (z / ((z * t) - x)); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.8e-16], N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.8e-76], N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-16}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x}}\\
\mathbf{elif}\;x \leq 9.8 \cdot 10^{-76}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -6.8e-16Initial program 88.6%
*-commutative88.6%
Simplified88.6%
clear-num88.6%
inv-pow88.6%
fma-neg88.6%
Applied egg-rr88.6%
unpow-188.6%
fma-neg88.6%
*-commutative88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in x around inf 90.5%
if -6.8e-16 < x < 9.79999999999999944e-76Initial program 92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in y around inf 57.9%
associate-/l*59.5%
associate-/r*59.5%
+-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 59.5%
if 9.79999999999999944e-76 < x Initial program 86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 81.9%
+-commutative81.9%
Simplified81.9%
Final simplification73.3%
(FPCore (x y z t) :precision binary64 (if (<= x -4.6e-25) (/ 1.0 (/ (+ x 1.0) x)) (if (<= x 8.5e-77) (/ y (* t (+ x 1.0))) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.6e-25) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= 8.5e-77) {
tmp = y / (t * (x + 1.0));
} else {
tmp = 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 (x <= (-4.6d-25)) then
tmp = 1.0d0 / ((x + 1.0d0) / x)
else if (x <= 8.5d-77) then
tmp = y / (t * (x + 1.0d0))
else
tmp = 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 (x <= -4.6e-25) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= 8.5e-77) {
tmp = y / (t * (x + 1.0));
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.6e-25: tmp = 1.0 / ((x + 1.0) / x) elif x <= 8.5e-77: tmp = y / (t * (x + 1.0)) else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.6e-25) tmp = Float64(1.0 / Float64(Float64(x + 1.0) / x)); elseif (x <= 8.5e-77) tmp = Float64(y / Float64(t * Float64(x + 1.0))); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.6e-25) tmp = 1.0 / ((x + 1.0) / x); elseif (x <= 8.5e-77) tmp = y / (t * (x + 1.0)); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.6e-25], N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.5e-77], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x}}\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-77}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -4.5999999999999998e-25Initial program 88.8%
*-commutative88.8%
Simplified88.8%
clear-num88.8%
inv-pow88.8%
fma-neg88.8%
Applied egg-rr88.8%
unpow-188.8%
fma-neg88.8%
*-commutative88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in x around inf 89.1%
if -4.5999999999999998e-25 < x < 8.4999999999999998e-77Initial program 92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in y around inf 58.3%
associate-/l*59.9%
associate-/r*59.9%
+-commutative59.9%
Simplified59.9%
Taylor expanded in z around inf 53.8%
if 8.4999999999999998e-77 < x Initial program 86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 81.9%
+-commutative81.9%
Simplified81.9%
Final simplification70.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.45e-26) (not (<= x 1.05e-76))) (/ x (+ x 1.0)) (* y (/ 1.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.45e-26) || !(x <= 1.05e-76)) {
tmp = x / (x + 1.0);
} else {
tmp = y * (1.0 / 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 ((x <= (-1.45d-26)) .or. (.not. (x <= 1.05d-76))) then
tmp = x / (x + 1.0d0)
else
tmp = y * (1.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.45e-26) || !(x <= 1.05e-76)) {
tmp = x / (x + 1.0);
} else {
tmp = y * (1.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.45e-26) or not (x <= 1.05e-76): tmp = x / (x + 1.0) else: tmp = y * (1.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.45e-26) || !(x <= 1.05e-76)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y * Float64(1.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.45e-26) || ~((x <= 1.05e-76))) tmp = x / (x + 1.0); else tmp = y * (1.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.45e-26], N[Not[LessEqual[x, 1.05e-76]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-26} \lor \neg \left(x \leq 1.05 \cdot 10^{-76}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1}{t}\\
\end{array}
\end{array}
if x < -1.4499999999999999e-26 or 1.04999999999999996e-76 < x Initial program 87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in t around inf 85.2%
+-commutative85.2%
Simplified85.2%
if -1.4499999999999999e-26 < x < 1.04999999999999996e-76Initial program 92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in y around inf 58.3%
associate-/l*59.9%
associate-/r*59.9%
+-commutative59.9%
Simplified59.9%
Taylor expanded in x around 0 53.7%
Final simplification70.3%
(FPCore (x y z t) :precision binary64 (if (<= x -5.8e-28) (/ 1.0 (/ (+ x 1.0) x)) (if (<= x 3.7e-78) (* y (/ 1.0 t)) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.8e-28) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= 3.7e-78) {
tmp = y * (1.0 / t);
} else {
tmp = 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 (x <= (-5.8d-28)) then
tmp = 1.0d0 / ((x + 1.0d0) / x)
else if (x <= 3.7d-78) then
tmp = y * (1.0d0 / t)
else
tmp = 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 (x <= -5.8e-28) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= 3.7e-78) {
tmp = y * (1.0 / t);
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.8e-28: tmp = 1.0 / ((x + 1.0) / x) elif x <= 3.7e-78: tmp = y * (1.0 / t) else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.8e-28) tmp = Float64(1.0 / Float64(Float64(x + 1.0) / x)); elseif (x <= 3.7e-78) tmp = Float64(y * Float64(1.0 / t)); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.8e-28) tmp = 1.0 / ((x + 1.0) / x); elseif (x <= 3.7e-78) tmp = y * (1.0 / t); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.8e-28], N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.7e-78], N[(y * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-28}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x}}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-78}:\\
\;\;\;\;y \cdot \frac{1}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -5.80000000000000026e-28Initial program 88.8%
*-commutative88.8%
Simplified88.8%
clear-num88.8%
inv-pow88.8%
fma-neg88.8%
Applied egg-rr88.8%
unpow-188.8%
fma-neg88.8%
*-commutative88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in x around inf 89.1%
if -5.80000000000000026e-28 < x < 3.70000000000000006e-78Initial program 92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in y around inf 58.3%
associate-/l*59.9%
associate-/r*59.9%
+-commutative59.9%
Simplified59.9%
Taylor expanded in x around 0 53.7%
if 3.70000000000000006e-78 < x Initial program 86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 81.9%
+-commutative81.9%
Simplified81.9%
Final simplification70.3%
(FPCore (x y z t) :precision binary64 (if (<= t -3.8e+188) (* x (- 1.0 x)) (* y (/ 1.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.8e+188) {
tmp = x * (1.0 - x);
} else {
tmp = y * (1.0 / 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 (t <= (-3.8d+188)) then
tmp = x * (1.0d0 - x)
else
tmp = y * (1.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.8e+188) {
tmp = x * (1.0 - x);
} else {
tmp = y * (1.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.8e+188: tmp = x * (1.0 - x) else: tmp = y * (1.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.8e+188) tmp = Float64(x * Float64(1.0 - x)); else tmp = Float64(y * Float64(1.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.8e+188) tmp = x * (1.0 - x); else tmp = y * (1.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.8e+188], N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision], N[(y * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+188}:\\
\;\;\;\;x \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1}{t}\\
\end{array}
\end{array}
if t < -3.7999999999999998e188Initial program 87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in t around inf 90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in x around 0 50.3%
*-rgt-identity50.3%
neg-mul-150.3%
sub-neg50.3%
*-rgt-identity50.3%
Simplified50.3%
if -3.7999999999999998e188 < t Initial program 90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in y around inf 35.4%
associate-/l*37.3%
associate-/r*39.4%
+-commutative39.4%
Simplified39.4%
Taylor expanded in x around 0 30.3%
Final simplification32.9%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in t around inf 54.7%
+-commutative54.7%
Simplified54.7%
Taylor expanded in x around 0 14.0%
*-rgt-identity14.0%
neg-mul-114.0%
sub-neg14.0%
*-rgt-identity14.0%
Simplified14.0%
Taylor expanded in x around 0 14.8%
Final simplification14.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 2024096
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))