
(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 (- (* z t) x))
(t_3 (/ (+ x (/ (- (* y z) x) t_2)) (+ x 1.0))))
(if (<= t_3 -2e+207)
(/ (+ x (* y (/ z (fma t z (- x))))) (+ x 1.0))
(if (<= t_3 2e+261)
(+ (+ (/ (* y z) (* t_2 (+ x 1.0))) t_1) (/ x (* t_2 (- -1.0 x))))
(- t_1 (/ (- (/ x (* z (+ x 1.0))) (/ y (+ x 1.0))) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = (z * t) - x;
double t_3 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
double tmp;
if (t_3 <= -2e+207) {
tmp = (x + (y * (z / fma(t, z, -x)))) / (x + 1.0);
} else if (t_3 <= 2e+261) {
tmp = (((y * z) / (t_2 * (x + 1.0))) + t_1) + (x / (t_2 * (-1.0 - x)));
} else {
tmp = t_1 - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) t_2 = Float64(Float64(z * t) - x) t_3 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_2)) / Float64(x + 1.0)) tmp = 0.0 if (t_3 <= -2e+207) tmp = Float64(Float64(x + Float64(y * Float64(z / fma(t, z, Float64(-x))))) / Float64(x + 1.0)); elseif (t_3 <= 2e+261) tmp = Float64(Float64(Float64(Float64(y * z) / Float64(t_2 * Float64(x + 1.0))) + t_1) + Float64(x / Float64(t_2 * Float64(-1.0 - x)))); else tmp = Float64(t_1 - Float64(Float64(Float64(x / Float64(z * Float64(x + 1.0))) - Float64(y / Float64(x + 1.0))) / t)); end return 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[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+207], N[(N[(x + N[(y * N[(z / N[(t * z + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+261], N[(N[(N[(N[(y * z), $MachinePrecision] / N[(t$95$2 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(x / N[(t$95$2 * N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(N[(N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := z \cdot t - x\\
t_3 := \frac{x + \frac{y \cdot z - x}{t\_2}}{x + 1}\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+207}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{\mathsf{fma}\left(t, z, -x\right)}}{x + 1}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+261}:\\
\;\;\;\;\left(\frac{y \cdot z}{t\_2 \cdot \left(x + 1\right)} + t\_1\right) + \frac{x}{t\_2 \cdot \left(-1 - x\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \frac{\frac{x}{z \cdot \left(x + 1\right)} - \frac{y}{x + 1}}{t}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -2.0000000000000001e207Initial program 62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in y around inf 62.7%
associate-/l*94.6%
fma-neg94.6%
Simplified94.6%
if -2.0000000000000001e207 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 1.9999999999999999e261Initial program 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in y around 0 99.0%
if 1.9999999999999999e261 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 19.0%
*-commutative19.0%
Simplified19.0%
Taylor expanded in t around -inf 93.0%
+-commutative93.0%
mul-1-neg93.0%
unsub-neg93.0%
+-commutative93.0%
sub-neg93.0%
mul-1-neg93.0%
distribute-neg-frac293.0%
distribute-neg-in93.0%
metadata-eval93.0%
unsub-neg93.0%
mul-1-neg93.0%
remove-double-neg93.0%
+-commutative93.0%
Simplified93.0%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))) (t_2 (- (* z t) x)))
(if (or (<= z -1.18e+196) (not (<= z 2.3e+79)))
(- t_1 (/ (- (/ x (* z (+ x 1.0))) (/ y (+ x 1.0))) t))
(+ (+ (/ (* y z) (* t_2 (+ x 1.0))) t_1) (/ x (* t_2 (- -1.0 x)))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = (z * t) - x;
double tmp;
if ((z <= -1.18e+196) || !(z <= 2.3e+79)) {
tmp = t_1 - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t);
} else {
tmp = (((y * z) / (t_2 * (x + 1.0))) + t_1) + (x / (t_2 * (-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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / (x + 1.0d0)
t_2 = (z * t) - x
if ((z <= (-1.18d+196)) .or. (.not. (z <= 2.3d+79))) then
tmp = t_1 - (((x / (z * (x + 1.0d0))) - (y / (x + 1.0d0))) / t)
else
tmp = (((y * z) / (t_2 * (x + 1.0d0))) + t_1) + (x / (t_2 * ((-1.0d0) - x)))
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 = (z * t) - x;
double tmp;
if ((z <= -1.18e+196) || !(z <= 2.3e+79)) {
tmp = t_1 - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t);
} else {
tmp = (((y * z) / (t_2 * (x + 1.0))) + t_1) + (x / (t_2 * (-1.0 - x)));
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) t_2 = (z * t) - x tmp = 0 if (z <= -1.18e+196) or not (z <= 2.3e+79): tmp = t_1 - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t) else: tmp = (((y * z) / (t_2 * (x + 1.0))) + t_1) + (x / (t_2 * (-1.0 - x))) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) t_2 = Float64(Float64(z * t) - x) tmp = 0.0 if ((z <= -1.18e+196) || !(z <= 2.3e+79)) tmp = Float64(t_1 - Float64(Float64(Float64(x / Float64(z * Float64(x + 1.0))) - Float64(y / Float64(x + 1.0))) / t)); else tmp = Float64(Float64(Float64(Float64(y * z) / Float64(t_2 * Float64(x + 1.0))) + t_1) + Float64(x / Float64(t_2 * Float64(-1.0 - x)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); t_2 = (z * t) - x; tmp = 0.0; if ((z <= -1.18e+196) || ~((z <= 2.3e+79))) tmp = t_1 - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t); else tmp = (((y * z) / (t_2 * (x + 1.0))) + t_1) + (x / (t_2 * (-1.0 - x))); 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[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[Or[LessEqual[z, -1.18e+196], N[Not[LessEqual[z, 2.3e+79]], $MachinePrecision]], N[(t$95$1 - N[(N[(N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * z), $MachinePrecision] / N[(t$95$2 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(x / N[(t$95$2 * N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := z \cdot t - x\\
\mathbf{if}\;z \leq -1.18 \cdot 10^{+196} \lor \neg \left(z \leq 2.3 \cdot 10^{+79}\right):\\
\;\;\;\;t\_1 - \frac{\frac{x}{z \cdot \left(x + 1\right)} - \frac{y}{x + 1}}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y \cdot z}{t\_2 \cdot \left(x + 1\right)} + t\_1\right) + \frac{x}{t\_2 \cdot \left(-1 - x\right)}\\
\end{array}
\end{array}
if z < -1.1800000000000001e196 or 2.3e79 < z Initial program 58.0%
*-commutative58.0%
Simplified58.0%
Taylor expanded in t around -inf 94.5%
+-commutative94.5%
mul-1-neg94.5%
unsub-neg94.5%
+-commutative94.5%
sub-neg94.5%
mul-1-neg94.5%
distribute-neg-frac294.5%
distribute-neg-in94.5%
metadata-eval94.5%
unsub-neg94.5%
mul-1-neg94.5%
remove-double-neg94.5%
+-commutative94.5%
Simplified94.5%
if -1.1800000000000001e196 < z < 2.3e79Initial program 98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in y around 0 98.8%
Final simplification97.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.3e+195) (not (<= z 1.2e+85))) (- (/ x (+ x 1.0)) (/ (- (/ x (* z (+ x 1.0))) (/ y (+ x 1.0))) t)) (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.3e+195) || !(z <= 1.2e+85)) {
tmp = (x / (x + 1.0)) - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t);
} 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 <= (-2.3d+195)) .or. (.not. (z <= 1.2d+85))) then
tmp = (x / (x + 1.0d0)) - (((x / (z * (x + 1.0d0))) - (y / (x + 1.0d0))) / t)
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 <= -2.3e+195) || !(z <= 1.2e+85)) {
tmp = (x / (x + 1.0)) - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t);
} else {
tmp = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.3e+195) or not (z <= 1.2e+85): tmp = (x / (x + 1.0)) - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t) 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 <= -2.3e+195) || !(z <= 1.2e+85)) tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(Float64(x / Float64(z * Float64(x + 1.0))) - Float64(y / Float64(x + 1.0))) / t)); 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 <= -2.3e+195) || ~((z <= 1.2e+85))) tmp = (x / (x + 1.0)) - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t); 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, -2.3e+195], N[Not[LessEqual[z, 1.2e+85]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $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 -2.3 \cdot 10^{+195} \lor \neg \left(z \leq 1.2 \cdot 10^{+85}\right):\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{x}{z \cdot \left(x + 1\right)} - \frac{y}{x + 1}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if z < -2.3000000000000001e195 or 1.19999999999999998e85 < z Initial program 58.0%
*-commutative58.0%
Simplified58.0%
Taylor expanded in t around -inf 94.5%
+-commutative94.5%
mul-1-neg94.5%
unsub-neg94.5%
+-commutative94.5%
sub-neg94.5%
mul-1-neg94.5%
distribute-neg-frac294.5%
distribute-neg-in94.5%
metadata-eval94.5%
unsub-neg94.5%
mul-1-neg94.5%
remove-double-neg94.5%
+-commutative94.5%
Simplified94.5%
if -2.3000000000000001e195 < z < 1.19999999999999998e85Initial program 98.8%
Final simplification97.6%
(FPCore (x y z t)
:precision binary64
(if (<= x -6.5e-103)
(/ x (+ x 1.0))
(if (<= x 8.8e-79)
(/ y t)
(if (<= x 1450000.0)
(- 1.0 (* y (/ z x)))
(if (<= x 4.2e+31) (+ 1.0 (/ (+ -1.0 (/ y t)) x)) 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.5e-103) {
tmp = x / (x + 1.0);
} else if (x <= 8.8e-79) {
tmp = y / t;
} else if (x <= 1450000.0) {
tmp = 1.0 - (y * (z / x));
} else if (x <= 4.2e+31) {
tmp = 1.0 + ((-1.0 + (y / t)) / 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 <= (-6.5d-103)) then
tmp = x / (x + 1.0d0)
else if (x <= 8.8d-79) then
tmp = y / t
else if (x <= 1450000.0d0) then
tmp = 1.0d0 - (y * (z / x))
else if (x <= 4.2d+31) then
tmp = 1.0d0 + (((-1.0d0) + (y / t)) / 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 <= -6.5e-103) {
tmp = x / (x + 1.0);
} else if (x <= 8.8e-79) {
tmp = y / t;
} else if (x <= 1450000.0) {
tmp = 1.0 - (y * (z / x));
} else if (x <= 4.2e+31) {
tmp = 1.0 + ((-1.0 + (y / t)) / x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.5e-103: tmp = x / (x + 1.0) elif x <= 8.8e-79: tmp = y / t elif x <= 1450000.0: tmp = 1.0 - (y * (z / x)) elif x <= 4.2e+31: tmp = 1.0 + ((-1.0 + (y / t)) / x) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.5e-103) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= 8.8e-79) tmp = Float64(y / t); elseif (x <= 1450000.0) tmp = Float64(1.0 - Float64(y * Float64(z / x))); elseif (x <= 4.2e+31) tmp = Float64(1.0 + Float64(Float64(-1.0 + Float64(y / t)) / x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6.5e-103) tmp = x / (x + 1.0); elseif (x <= 8.8e-79) tmp = y / t; elseif (x <= 1450000.0) tmp = 1.0 - (y * (z / x)); elseif (x <= 4.2e+31) tmp = 1.0 + ((-1.0 + (y / t)) / x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.5e-103], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.8e-79], N[(y / t), $MachinePrecision], If[LessEqual[x, 1450000.0], N[(1.0 - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e+31], N[(1.0 + N[(N[(-1.0 + N[(y / t), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-103}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{-79}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 1450000:\\
\;\;\;\;1 - y \cdot \frac{z}{x}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+31}:\\
\;\;\;\;1 + \frac{-1 + \frac{y}{t}}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -6.49999999999999966e-103Initial program 90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in t around inf 78.0%
+-commutative78.0%
Simplified78.0%
if -6.49999999999999966e-103 < x < 8.7999999999999995e-79Initial program 84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in z around inf 78.9%
Taylor expanded in x around 0 61.1%
if 8.7999999999999995e-79 < x < 1.45e6Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 54.3%
Taylor expanded in x around 0 52.4%
associate-/l*45.8%
mul-1-neg45.8%
sub-neg45.8%
Simplified45.8%
Taylor expanded in t around 0 53.2%
mul-1-neg53.2%
associate-/l*53.3%
distribute-lft-neg-in53.3%
Simplified53.3%
if 1.45e6 < x < 4.19999999999999958e31Initial program 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in z around inf 85.0%
Taylor expanded in x around -inf 75.2%
mul-1-neg75.2%
unsub-neg75.2%
mul-1-neg75.2%
sub-neg75.2%
Simplified75.2%
if 4.19999999999999958e31 < x Initial program 89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in y around inf 89.0%
associate-/l*100.0%
fma-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 89.0%
Taylor expanded in x around inf 97.9%
Final simplification73.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.9e+196) (not (<= z 6.4e+72))) (/ (+ 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 <= -2.9e+196) || !(z <= 6.4e+72)) {
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 <= (-2.9d+196)) .or. (.not. (z <= 6.4d+72))) 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 <= -2.9e+196) || !(z <= 6.4e+72)) {
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 <= -2.9e+196) or not (z <= 6.4e+72): 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 <= -2.9e+196) || !(z <= 6.4e+72)) 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 <= -2.9e+196) || ~((z <= 6.4e+72))) 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, -2.9e+196], N[Not[LessEqual[z, 6.4e+72]], $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 -2.9 \cdot 10^{+196} \lor \neg \left(z \leq 6.4 \cdot 10^{+72}\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 < -2.9e196 or 6.4000000000000003e72 < z Initial program 59.1%
*-commutative59.1%
Simplified59.1%
Taylor expanded in z around inf 94.6%
if -2.9e196 < z < 6.4000000000000003e72Initial program 98.8%
Final simplification97.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.5e-83) (not (<= t 1.6e-12))) (/ (+ 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 <= -8.5e-83) || !(t <= 1.6e-12)) {
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 <= (-8.5d-83)) .or. (.not. (t <= 1.6d-12))) 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 <= -8.5e-83) || !(t <= 1.6e-12)) {
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 <= -8.5e-83) or not (t <= 1.6e-12): 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 <= -8.5e-83) || !(t <= 1.6e-12)) 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 <= -8.5e-83) || ~((t <= 1.6e-12))) 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, -8.5e-83], N[Not[LessEqual[t, 1.6e-12]], $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 -8.5 \cdot 10^{-83} \lor \neg \left(t \leq 1.6 \cdot 10^{-12}\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 < -8.49999999999999938e-83 or 1.6e-12 < t Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in z around inf 91.1%
if -8.49999999999999938e-83 < t < 1.6e-12Initial program 94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in t around 0 76.9%
associate-+r+76.9%
mul-1-neg76.9%
unsub-neg76.9%
+-commutative76.9%
associate-/l*81.5%
+-commutative81.5%
Simplified81.5%
Final simplification87.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.65e-86) (not (<= t 4.5e-12))) (/ (+ x (/ y t)) (+ x 1.0)) (+ 1.0 (* z (/ y (* x (- -1.0 x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.65e-86) || !(t <= 4.5e-12)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (z * (y / (x * (-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 ((t <= (-1.65d-86)) .or. (.not. (t <= 4.5d-12))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 + (z * (y / (x * ((-1.0d0) - x))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.65e-86) || !(t <= 4.5e-12)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (z * (y / (x * (-1.0 - x))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.65e-86) or not (t <= 4.5e-12): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 + (z * (y / (x * (-1.0 - x)))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.65e-86) || !(t <= 4.5e-12)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 + Float64(z * Float64(y / Float64(x * Float64(-1.0 - x))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.65e-86) || ~((t <= 4.5e-12))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 + (z * (y / (x * (-1.0 - x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.65e-86], N[Not[LessEqual[t, 4.5e-12]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(z * N[(y / N[(x * N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{-86} \lor \neg \left(t \leq 4.5 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + z \cdot \frac{y}{x \cdot \left(-1 - x\right)}\\
\end{array}
\end{array}
if t < -1.64999999999999993e-86 or 4.49999999999999981e-12 < t Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in z around inf 91.1%
if -1.64999999999999993e-86 < t < 4.49999999999999981e-12Initial program 94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in z around 0 79.3%
Taylor expanded in y around inf 79.3%
neg-mul-179.3%
distribute-neg-frac279.3%
distribute-rgt-neg-in79.3%
distribute-neg-in79.3%
metadata-eval79.3%
unsub-neg79.3%
Simplified79.3%
Final simplification87.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9.5e-86) (not (<= t 6.2e-12))) (/ (+ x (/ y t)) (+ x 1.0)) (- 1.0 (* y (/ z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9.5e-86) || !(t <= 6.2e-12)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (y * (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 ((t <= (-9.5d-86)) .or. (.not. (t <= 6.2d-12))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 - (y * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9.5e-86) || !(t <= 6.2e-12)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (y * (z / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9.5e-86) or not (t <= 6.2e-12): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 - (y * (z / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9.5e-86) || !(t <= 6.2e-12)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(y * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -9.5e-86) || ~((t <= 6.2e-12))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 - (y * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9.5e-86], N[Not[LessEqual[t, 6.2e-12]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-86} \lor \neg \left(t \leq 6.2 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot \frac{z}{x}\\
\end{array}
\end{array}
if t < -9.4999999999999996e-86 or 6.2000000000000002e-12 < t Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in z around inf 91.1%
if -9.4999999999999996e-86 < t < 6.2000000000000002e-12Initial program 94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in z around 0 79.3%
Taylor expanded in x around 0 66.9%
associate-/l*63.6%
mul-1-neg63.6%
sub-neg63.6%
Simplified63.6%
Taylor expanded in t around 0 66.8%
mul-1-neg66.8%
associate-/l*66.9%
distribute-lft-neg-in66.9%
Simplified66.9%
Final simplification83.0%
(FPCore (x y z t) :precision binary64 (if (<= x -5e-7) 1.0 (if (<= x -5e-106) x (if (<= x 3.1e-75) (/ y t) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5e-7) {
tmp = 1.0;
} else if (x <= -5e-106) {
tmp = x;
} else if (x <= 3.1e-75) {
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 <= (-5d-7)) then
tmp = 1.0d0
else if (x <= (-5d-106)) then
tmp = x
else if (x <= 3.1d-75) 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 <= -5e-7) {
tmp = 1.0;
} else if (x <= -5e-106) {
tmp = x;
} else if (x <= 3.1e-75) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5e-7: tmp = 1.0 elif x <= -5e-106: tmp = x elif x <= 3.1e-75: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5e-7) tmp = 1.0; elseif (x <= -5e-106) tmp = x; elseif (x <= 3.1e-75) 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 <= -5e-7) tmp = 1.0; elseif (x <= -5e-106) tmp = x; elseif (x <= 3.1e-75) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5e-7], 1.0, If[LessEqual[x, -5e-106], x, If[LessEqual[x, 3.1e-75], N[(y / t), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-7}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-106}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-75}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -4.99999999999999977e-7 or 3.10000000000000007e-75 < x Initial program 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y around inf 85.9%
associate-/l*96.0%
fma-neg96.0%
Simplified96.0%
Taylor expanded in y around 0 85.9%
Taylor expanded in x around inf 83.4%
if -4.99999999999999977e-7 < x < -4.99999999999999983e-106Initial program 92.1%
*-commutative92.1%
Simplified92.1%
Taylor expanded in t around inf 48.3%
+-commutative48.3%
Simplified48.3%
Taylor expanded in x around 0 46.2%
if -4.99999999999999983e-106 < x < 3.10000000000000007e-75Initial program 84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in z around inf 78.9%
Taylor expanded in x around 0 61.1%
Final simplification71.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -8.8e-107) (not (<= x 2.15e-79))) (/ x (+ x 1.0)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8.8e-107) || !(x <= 2.15e-79)) {
tmp = x / (x + 1.0);
} else {
tmp = y / 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 <= (-8.8d-107)) .or. (.not. (x <= 2.15d-79))) then
tmp = x / (x + 1.0d0)
else
tmp = y / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8.8e-107) || !(x <= 2.15e-79)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -8.8e-107) or not (x <= 2.15e-79): tmp = x / (x + 1.0) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -8.8e-107) || !(x <= 2.15e-79)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -8.8e-107) || ~((x <= 2.15e-79))) tmp = x / (x + 1.0); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8.8e-107], N[Not[LessEqual[x, 2.15e-79]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{-107} \lor \neg \left(x \leq 2.15 \cdot 10^{-79}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if x < -8.8000000000000005e-107 or 2.14999999999999991e-79 < x Initial program 89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in t around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -8.8000000000000005e-107 < x < 2.14999999999999991e-79Initial program 84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in z around inf 78.9%
Taylor expanded in x around 0 61.1%
Final simplification71.9%
(FPCore (x y z t) :precision binary64 (if (<= x -0.000115) 1.0 (if (<= x 6.2e-25) x 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.000115) {
tmp = 1.0;
} else if (x <= 6.2e-25) {
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 <= (-0.000115d0)) then
tmp = 1.0d0
else if (x <= 6.2d-25) 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 <= -0.000115) {
tmp = 1.0;
} else if (x <= 6.2e-25) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -0.000115: tmp = 1.0 elif x <= 6.2e-25: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -0.000115) tmp = 1.0; elseif (x <= 6.2e-25) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -0.000115) tmp = 1.0; elseif (x <= 6.2e-25) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.000115], 1.0, If[LessEqual[x, 6.2e-25], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.000115:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-25}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.15e-4 or 6.19999999999999989e-25 < x Initial program 88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in y around inf 86.9%
associate-/l*97.4%
fma-neg97.4%
Simplified97.4%
Taylor expanded in y around 0 86.9%
Taylor expanded in x around inf 85.5%
if -1.15e-4 < x < 6.19999999999999989e-25Initial program 86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in t around inf 28.8%
+-commutative28.8%
Simplified28.8%
Taylor expanded in x around 0 28.4%
Final simplification57.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 87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y around inf 78.5%
associate-/l*85.3%
fma-neg85.3%
Simplified85.3%
Taylor expanded in y around 0 78.5%
Taylor expanded in x around inf 49.7%
Final simplification49.7%
(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 2024044
(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)))