
(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 (or (<= z -1.9e+59) (not (<= z 1.08e+55))) (/ (+ x (/ y (- t (/ x z)))) (+ x 1.0)) (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.9e+59) || !(z <= 1.08e+55)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x + (((y * z) - x) / ((t * 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 <= (-1.9d+59)) .or. (.not. (z <= 1.08d+55))) then
tmp = (x + (y / (t - (x / z)))) / (x + 1.0d0)
else
tmp = (x + (((y * z) - x) / ((t * 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 <= -1.9e+59) || !(z <= 1.08e+55)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.9e+59) or not (z <= 1.08e+55): tmp = (x + (y / (t - (x / z)))) / (x + 1.0) else: tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.9e+59) || !(z <= 1.08e+55)) tmp = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.9e+59) || ~((z <= 1.08e+55))) tmp = (x + (y / (t - (x / z)))) / (x + 1.0); else tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.9e+59], N[Not[LessEqual[z, 1.08e+55]], $MachinePrecision]], N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+59} \lor \neg \left(z \leq 1.08 \cdot 10^{+55}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\\
\end{array}
\end{array}
if z < -1.9e59 or 1.08000000000000004e55 < z Initial program 75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in y around inf 74.7%
associate-/l*91.5%
Simplified91.5%
Taylor expanded in t around 0 98.2%
mul-1-neg98.2%
unsub-neg98.2%
Simplified98.2%
if -1.9e59 < z < 1.08000000000000004e55Initial program 99.8%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* t z) x)))
(if (<= t -1e+126)
(/ (+ x (- (* y (/ 1.0 t)) (/ x t_1))) (+ x 1.0))
(/ (+ x (+ (* y (/ z t_1)) (/ -1.0 (+ (/ t (/ x z)) -1.0)))) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double t_1 = (t * z) - x;
double tmp;
if (t <= -1e+126) {
tmp = (x + ((y * (1.0 / t)) - (x / t_1))) / (x + 1.0);
} else {
tmp = (x + ((y * (z / t_1)) + (-1.0 / ((t / (x / z)) + -1.0)))) / (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 = (t * z) - x
if (t <= (-1d+126)) then
tmp = (x + ((y * (1.0d0 / t)) - (x / t_1))) / (x + 1.0d0)
else
tmp = (x + ((y * (z / t_1)) + ((-1.0d0) / ((t / (x / z)) + (-1.0d0))))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t * z) - x;
double tmp;
if (t <= -1e+126) {
tmp = (x + ((y * (1.0 / t)) - (x / t_1))) / (x + 1.0);
} else {
tmp = (x + ((y * (z / t_1)) + (-1.0 / ((t / (x / z)) + -1.0)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (t * z) - x tmp = 0 if t <= -1e+126: tmp = (x + ((y * (1.0 / t)) - (x / t_1))) / (x + 1.0) else: tmp = (x + ((y * (z / t_1)) + (-1.0 / ((t / (x / z)) + -1.0)))) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t * z) - x) tmp = 0.0 if (t <= -1e+126) tmp = Float64(Float64(x + Float64(Float64(y * Float64(1.0 / t)) - Float64(x / t_1))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(y * Float64(z / t_1)) + Float64(-1.0 / Float64(Float64(t / Float64(x / z)) + -1.0)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t * z) - x; tmp = 0.0; if (t <= -1e+126) tmp = (x + ((y * (1.0 / t)) - (x / t_1))) / (x + 1.0); else tmp = (x + ((y * (z / t_1)) + (-1.0 / ((t / (x / z)) + -1.0)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[t, -1e+126], N[(N[(x + N[(N[(y * N[(1.0 / t), $MachinePrecision]), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[(t / N[(x / z), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot z - x\\
\mathbf{if}\;t \leq -1 \cdot 10^{+126}:\\
\;\;\;\;\frac{x + \left(y \cdot \frac{1}{t} - \frac{x}{t_1}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(y \cdot \frac{z}{t_1} + \frac{-1}{\frac{t}{\frac{x}{z}} + -1}\right)}{x + 1}\\
\end{array}
\end{array}
if t < -9.99999999999999925e125Initial program 70.3%
*-commutative70.3%
Simplified70.3%
div-sub70.3%
*-un-lft-identity70.3%
times-frac85.6%
fma-neg85.6%
Applied egg-rr85.6%
fma-udef85.6%
unsub-neg85.6%
/-rgt-identity85.6%
*-commutative85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in z around inf 100.0%
if -9.99999999999999925e125 < t Initial program 93.3%
*-commutative93.3%
Simplified93.3%
div-sub93.3%
*-un-lft-identity93.3%
times-frac98.6%
fma-neg98.6%
Applied egg-rr98.6%
fma-udef98.6%
unsub-neg98.6%
/-rgt-identity98.6%
*-commutative98.6%
*-commutative98.6%
Simplified98.6%
clear-num98.6%
inv-pow98.6%
*-commutative98.6%
Applied egg-rr98.6%
unpow-198.6%
div-sub98.6%
*-commutative98.6%
sub-neg98.6%
associate-/l*98.6%
*-inverses98.6%
metadata-eval98.6%
Simplified98.6%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* t z) x)) (t_2 (/ x t_1)))
(if (<= t -5e+116)
(/ (+ x (- (* y (/ 1.0 t)) t_2)) (+ x 1.0))
(/ (+ x (- (* y (/ z t_1)) t_2)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double t_1 = (t * z) - x;
double t_2 = x / t_1;
double tmp;
if (t <= -5e+116) {
tmp = (x + ((y * (1.0 / t)) - t_2)) / (x + 1.0);
} else {
tmp = (x + ((y * (z / t_1)) - t_2)) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t * z) - x
t_2 = x / t_1
if (t <= (-5d+116)) then
tmp = (x + ((y * (1.0d0 / t)) - t_2)) / (x + 1.0d0)
else
tmp = (x + ((y * (z / t_1)) - t_2)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t * z) - x;
double t_2 = x / t_1;
double tmp;
if (t <= -5e+116) {
tmp = (x + ((y * (1.0 / t)) - t_2)) / (x + 1.0);
} else {
tmp = (x + ((y * (z / t_1)) - t_2)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (t * z) - x t_2 = x / t_1 tmp = 0 if t <= -5e+116: tmp = (x + ((y * (1.0 / t)) - t_2)) / (x + 1.0) else: tmp = (x + ((y * (z / t_1)) - t_2)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t * z) - x) t_2 = Float64(x / t_1) tmp = 0.0 if (t <= -5e+116) tmp = Float64(Float64(x + Float64(Float64(y * Float64(1.0 / t)) - t_2)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(y * Float64(z / t_1)) - t_2)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t * z) - x; t_2 = x / t_1; tmp = 0.0; if (t <= -5e+116) tmp = (x + ((y * (1.0 / t)) - t_2)) / (x + 1.0); else tmp = (x + ((y * (z / t_1)) - t_2)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(x / t$95$1), $MachinePrecision]}, If[LessEqual[t, -5e+116], N[(N[(x + N[(N[(y * N[(1.0 / t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot z - x\\
t_2 := \frac{x}{t_1}\\
\mathbf{if}\;t \leq -5 \cdot 10^{+116}:\\
\;\;\;\;\frac{x + \left(y \cdot \frac{1}{t} - t_2\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(y \cdot \frac{z}{t_1} - t_2\right)}{x + 1}\\
\end{array}
\end{array}
if t < -5.00000000000000025e116Initial program 70.3%
*-commutative70.3%
Simplified70.3%
div-sub70.3%
*-un-lft-identity70.3%
times-frac85.6%
fma-neg85.6%
Applied egg-rr85.6%
fma-udef85.6%
unsub-neg85.6%
/-rgt-identity85.6%
*-commutative85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in z around inf 100.0%
if -5.00000000000000025e116 < t Initial program 93.3%
*-commutative93.3%
Simplified93.3%
div-sub93.3%
*-un-lft-identity93.3%
times-frac98.6%
fma-neg98.6%
Applied egg-rr98.6%
fma-udef98.6%
unsub-neg98.6%
/-rgt-identity98.6%
*-commutative98.6%
*-commutative98.6%
Simplified98.6%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.65e-167) (not (<= z 4.1e-178))) (/ (+ x (/ y (- t (/ x z)))) (+ x 1.0)) (/ (+ x (/ -1.0 (+ -1.0 (/ (* t z) x)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.65e-167) || !(z <= 4.1e-178)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x + (-1.0 / (-1.0 + ((t * 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 <= (-1.65d-167)) .or. (.not. (z <= 4.1d-178))) then
tmp = (x + (y / (t - (x / z)))) / (x + 1.0d0)
else
tmp = (x + ((-1.0d0) / ((-1.0d0) + ((t * 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 <= -1.65e-167) || !(z <= 4.1e-178)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x + (-1.0 / (-1.0 + ((t * z) / x)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.65e-167) or not (z <= 4.1e-178): tmp = (x + (y / (t - (x / z)))) / (x + 1.0) else: tmp = (x + (-1.0 / (-1.0 + ((t * z) / x)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.65e-167) || !(z <= 4.1e-178)) tmp = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(-1.0 / Float64(-1.0 + Float64(Float64(t * z) / x)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.65e-167) || ~((z <= 4.1e-178))) tmp = (x + (y / (t - (x / z)))) / (x + 1.0); else tmp = (x + (-1.0 / (-1.0 + ((t * z) / x)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.65e-167], N[Not[LessEqual[z, 4.1e-178]], $MachinePrecision]], N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(-1.0 / N[(-1.0 + N[(N[(t * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-167} \lor \neg \left(z \leq 4.1 \cdot 10^{-178}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{-1}{-1 + \frac{t \cdot z}{x}}}{x + 1}\\
\end{array}
\end{array}
if z < -1.64999999999999998e-167 or 4.0999999999999999e-178 < z Initial program 87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in y around inf 83.8%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in t around 0 96.0%
mul-1-neg96.0%
unsub-neg96.0%
Simplified96.0%
if -1.64999999999999998e-167 < z < 4.0999999999999999e-178Initial program 99.8%
*-commutative99.8%
Simplified99.8%
div-sub99.8%
*-un-lft-identity99.8%
times-frac99.9%
fma-neg99.9%
Applied egg-rr99.9%
fma-udef99.9%
unsub-neg99.9%
/-rgt-identity99.9%
*-commutative99.9%
*-commutative99.9%
Simplified99.9%
clear-num99.9%
inv-pow99.9%
*-commutative99.9%
Applied egg-rr99.9%
unpow-199.9%
div-sub99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 93.6%
Final simplification95.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.4e-247) (not (<= z 8e-233))) (/ (+ x (/ y (- t (/ x z)))) (+ x 1.0)) (/ (+ 1.0 (- x (/ (* y z) x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.4e-247) || !(z <= 8e-233)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (1.0 + (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 <= (-2.4d-247)) .or. (.not. (z <= 8d-233))) then
tmp = (x + (y / (t - (x / z)))) / (x + 1.0d0)
else
tmp = (1.0d0 + (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 <= -2.4e-247) || !(z <= 8e-233)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (1.0 + (x - ((y * z) / x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.4e-247) or not (z <= 8e-233): tmp = (x + (y / (t - (x / z)))) / (x + 1.0) else: tmp = (1.0 + (x - ((y * z) / x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.4e-247) || !(z <= 8e-233)) tmp = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0)); else tmp = Float64(Float64(1.0 + Float64(x - Float64(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 <= -2.4e-247) || ~((z <= 8e-233))) tmp = (x + (y / (t - (x / z)))) / (x + 1.0); else tmp = (1.0 + (x - ((y * z) / x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.4e-247], N[Not[LessEqual[z, 8e-233]], $MachinePrecision]], N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-247} \lor \neg \left(z \leq 8 \cdot 10^{-233}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - \frac{y \cdot z}{x}\right)}{x + 1}\\
\end{array}
\end{array}
if z < -2.40000000000000011e-247 or 7.99999999999999966e-233 < z Initial program 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y around inf 81.7%
associate-/l*89.2%
Simplified89.2%
Taylor expanded in t around 0 92.1%
mul-1-neg92.1%
unsub-neg92.1%
Simplified92.1%
if -2.40000000000000011e-247 < z < 7.99999999999999966e-233Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
+-commutative100.0%
Simplified100.0%
Final simplification93.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.1e-168) (not (<= z 2.25e-180))) (/ (+ x (/ y (- t (/ x z)))) (+ x 1.0)) (/ (- x (/ x (- (* t z) x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.1e-168) || !(z <= 2.25e-180)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x - (x / ((t * 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 <= (-2.1d-168)) .or. (.not. (z <= 2.25d-180))) then
tmp = (x + (y / (t - (x / z)))) / (x + 1.0d0)
else
tmp = (x - (x / ((t * 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 <= -2.1e-168) || !(z <= 2.25e-180)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x - (x / ((t * z) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.1e-168) or not (z <= 2.25e-180): tmp = (x + (y / (t - (x / z)))) / (x + 1.0) else: tmp = (x - (x / ((t * z) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.1e-168) || !(z <= 2.25e-180)) tmp = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / Float64(Float64(t * z) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.1e-168) || ~((z <= 2.25e-180))) tmp = (x + (y / (t - (x / z)))) / (x + 1.0); else tmp = (x - (x / ((t * z) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.1e-168], N[Not[LessEqual[z, 2.25e-180]], $MachinePrecision]], N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-168} \lor \neg \left(z \leq 2.25 \cdot 10^{-180}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{t \cdot z - x}}{x + 1}\\
\end{array}
\end{array}
if z < -2.09999999999999994e-168 or 2.25000000000000005e-180 < z Initial program 87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in y around inf 83.8%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in t around 0 96.0%
mul-1-neg96.0%
unsub-neg96.0%
Simplified96.0%
if -2.09999999999999994e-168 < z < 2.25000000000000005e-180Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 93.5%
+-commutative93.5%
Simplified93.5%
Final simplification95.4%
(FPCore (x y z t) :precision binary64 (if (<= x -17.0) (- 1.0 (* (/ z x) (/ y x))) (if (<= x 25000000000.0) (/ (+ 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 <= -17.0) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= 25000000000.0) {
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 <= (-17.0d0)) then
tmp = 1.0d0 - ((z / x) * (y / x))
else if (x <= 25000000000.0d0) 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 <= -17.0) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= 25000000000.0) {
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 <= -17.0: tmp = 1.0 - ((z / x) * (y / x)) elif x <= 25000000000.0: 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 <= -17.0) tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); elseif (x <= 25000000000.0) 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 <= -17.0) tmp = 1.0 - ((z / x) * (y / x)); elseif (x <= 25000000000.0) 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, -17.0], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 25000000000.0], 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 -17:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq 25000000000:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if x < -17Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in x around -inf 82.6%
mul-1-neg82.6%
unsub-neg82.6%
distribute-rgt-out--82.6%
unpow282.6%
times-frac86.8%
Simplified86.8%
Taylor expanded in y around inf 95.4%
if -17 < x < 2.5e10Initial program 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in z around inf 66.4%
if 2.5e10 < x Initial program 90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in t around inf 98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= x -1.38e-8) (/ (- x (/ y (/ x z))) (+ x 1.0)) (if (<= x 12500000000.0) (/ (+ 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.38e-8) {
tmp = (x - (y / (x / z))) / (x + 1.0);
} else if (x <= 12500000000.0) {
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.38d-8)) then
tmp = (x - (y / (x / z))) / (x + 1.0d0)
else if (x <= 12500000000.0d0) 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.38e-8) {
tmp = (x - (y / (x / z))) / (x + 1.0);
} else if (x <= 12500000000.0) {
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.38e-8: tmp = (x - (y / (x / z))) / (x + 1.0) elif x <= 12500000000.0: 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.38e-8) tmp = Float64(Float64(x - Float64(y / Float64(x / z))) / Float64(x + 1.0)); elseif (x <= 12500000000.0) 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.38e-8) tmp = (x - (y / (x / z))) / (x + 1.0); elseif (x <= 12500000000.0) 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.38e-8], N[(N[(x - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 12500000000.0], 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.38 \cdot 10^{-8}:\\
\;\;\;\;\frac{x - \frac{y}{\frac{x}{z}}}{x + 1}\\
\mathbf{elif}\;x \leq 12500000000:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if x < -1.37999999999999995e-8Initial program 92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in y around inf 91.4%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in t around 0 89.5%
mul-1-neg89.5%
unsub-neg89.5%
associate-/l*94.5%
+-commutative94.5%
Simplified94.5%
if -1.37999999999999995e-8 < x < 1.25e10Initial program 88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in z around inf 67.4%
if 1.25e10 < x Initial program 90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in t around inf 98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
Final simplification83.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6.3e-55) (not (<= x 2.6e-18))) (/ x (+ x 1.0)) (/ y (+ t (* t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.3e-55) || !(x <= 2.6e-18)) {
tmp = x / (x + 1.0);
} else {
tmp = y / (t + (t * 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 <= (-6.3d-55)) .or. (.not. (x <= 2.6d-18))) then
tmp = x / (x + 1.0d0)
else
tmp = y / (t + (t * x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.3e-55) || !(x <= 2.6e-18)) {
tmp = x / (x + 1.0);
} else {
tmp = y / (t + (t * x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6.3e-55) or not (x <= 2.6e-18): tmp = x / (x + 1.0) else: tmp = y / (t + (t * x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -6.3e-55) || !(x <= 2.6e-18)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y / Float64(t + Float64(t * x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -6.3e-55) || ~((x <= 2.6e-18))) tmp = x / (x + 1.0); else tmp = y / (t + (t * x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6.3e-55], N[Not[LessEqual[x, 2.6e-18]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / N[(t + N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.3 \cdot 10^{-55} \lor \neg \left(x \leq 2.6 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t + t \cdot x}\\
\end{array}
\end{array}
if x < -6.2999999999999997e-55 or 2.6e-18 < x Initial program 90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in t around inf 88.9%
+-commutative88.9%
Simplified88.9%
if -6.2999999999999997e-55 < x < 2.6e-18Initial program 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in y around inf 48.9%
Taylor expanded in z around inf 45.8%
distribute-lft-in45.8%
*-rgt-identity45.8%
Simplified45.8%
Final simplification71.0%
(FPCore (x y z t) :precision binary64 (if (<= x -1.75e-5) (- 1.0 (* (/ z x) (/ y x))) (if (<= x 3.4e-17) (/ y t) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.75e-5) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= 3.4e-17) {
tmp = y / 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 <= (-1.75d-5)) then
tmp = 1.0d0 - ((z / x) * (y / x))
else if (x <= 3.4d-17) then
tmp = y / 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 <= -1.75e-5) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= 3.4e-17) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.75e-5: tmp = 1.0 - ((z / x) * (y / x)) elif x <= 3.4e-17: tmp = y / t else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.75e-5) tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); elseif (x <= 3.4e-17) tmp = Float64(y / 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 <= -1.75e-5) tmp = 1.0 - ((z / x) * (y / x)); elseif (x <= 3.4e-17) tmp = y / t; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.75e-5], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.4e-17], N[(y / t), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{-5}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-17}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -1.7499999999999998e-5Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in x around -inf 82.6%
mul-1-neg82.6%
unsub-neg82.6%
distribute-rgt-out--82.6%
unpow282.6%
times-frac86.8%
Simplified86.8%
Taylor expanded in y around inf 95.4%
if -1.7499999999999998e-5 < x < 3.3999999999999998e-17Initial program 90.1%
*-commutative90.1%
Simplified90.1%
div-sub90.1%
*-un-lft-identity90.1%
times-frac93.7%
fma-neg93.7%
Applied egg-rr93.7%
fma-udef93.7%
unsub-neg93.7%
/-rgt-identity93.7%
*-commutative93.7%
*-commutative93.7%
Simplified93.7%
clear-num93.7%
inv-pow93.7%
*-commutative93.7%
Applied egg-rr93.7%
unpow-193.7%
div-sub93.7%
*-commutative93.7%
sub-neg93.7%
associate-/l*93.8%
*-inverses93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in x around 0 44.1%
if 3.3999999999999998e-17 < x Initial program 88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in t around inf 94.1%
+-commutative94.1%
Simplified94.1%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.75e-54) (not (<= x 2.8e-18))) (/ x (+ x 1.0)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.75e-54) || !(x <= 2.8e-18)) {
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 <= (-1.75d-54)) .or. (.not. (x <= 2.8d-18))) 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 <= -1.75e-54) || !(x <= 2.8e-18)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.75e-54) or not (x <= 2.8e-18): tmp = x / (x + 1.0) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.75e-54) || !(x <= 2.8e-18)) 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 <= -1.75e-54) || ~((x <= 2.8e-18))) tmp = x / (x + 1.0); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.75e-54], N[Not[LessEqual[x, 2.8e-18]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{-54} \lor \neg \left(x \leq 2.8 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if x < -1.74999999999999991e-54 or 2.80000000000000012e-18 < x Initial program 90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in t around inf 88.9%
+-commutative88.9%
Simplified88.9%
if -1.74999999999999991e-54 < x < 2.80000000000000012e-18Initial program 90.6%
*-commutative90.6%
Simplified90.6%
div-sub90.6%
*-un-lft-identity90.6%
times-frac93.4%
fma-neg93.4%
Applied egg-rr93.4%
fma-udef93.4%
unsub-neg93.4%
/-rgt-identity93.4%
*-commutative93.4%
*-commutative93.4%
Simplified93.4%
clear-num93.4%
inv-pow93.4%
*-commutative93.4%
Applied egg-rr93.4%
unpow-193.4%
div-sub93.5%
*-commutative93.5%
sub-neg93.5%
associate-/l*93.5%
*-inverses93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in x around 0 45.8%
Final simplification71.0%
(FPCore (x y z t) :precision binary64 (if (<= x -1.35e-5) 1.0 (if (<= x 5.2e-64) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.35e-5) {
tmp = 1.0;
} else if (x <= 5.2e-64) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.35d-5)) then
tmp = 1.0d0
else if (x <= 5.2d-64) then
tmp = y / t
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.35e-5) {
tmp = 1.0;
} else if (x <= 5.2e-64) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.35e-5: tmp = 1.0 elif x <= 5.2e-64: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.35e-5) tmp = 1.0; elseif (x <= 5.2e-64) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.35e-5) tmp = 1.0; elseif (x <= 5.2e-64) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.35e-5], 1.0, If[LessEqual[x, 5.2e-64], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-5}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-64}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.3499999999999999e-5 or 5.2e-64 < x Initial program 90.6%
*-commutative90.6%
Simplified90.6%
div-sub90.6%
*-un-lft-identity90.6%
times-frac99.4%
fma-neg99.4%
Applied egg-rr99.4%
fma-udef99.4%
unsub-neg99.4%
/-rgt-identity99.4%
*-commutative99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x around inf 85.6%
if -1.3499999999999999e-5 < x < 5.2e-64Initial program 89.9%
*-commutative89.9%
Simplified89.9%
div-sub89.9%
*-un-lft-identity89.9%
times-frac93.0%
fma-neg93.0%
Applied egg-rr93.0%
fma-udef93.0%
unsub-neg93.0%
/-rgt-identity93.0%
*-commutative93.0%
*-commutative93.0%
Simplified93.0%
clear-num93.0%
inv-pow93.0%
*-commutative93.0%
Applied egg-rr93.0%
unpow-193.0%
div-sub93.0%
*-commutative93.0%
sub-neg93.0%
associate-/l*93.0%
*-inverses93.0%
metadata-eval93.0%
Simplified93.0%
Taylor expanded in x around 0 44.9%
Final simplification69.9%
(FPCore (x y z t) :precision binary64 (if (<= x -6e-7) 1.0 (if (<= x 1.45e-216) x 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6e-7) {
tmp = 1.0;
} else if (x <= 1.45e-216) {
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 <= (-6d-7)) then
tmp = 1.0d0
else if (x <= 1.45d-216) 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 <= -6e-7) {
tmp = 1.0;
} else if (x <= 1.45e-216) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6e-7: tmp = 1.0 elif x <= 1.45e-216: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6e-7) tmp = 1.0; elseif (x <= 1.45e-216) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6e-7) tmp = 1.0; elseif (x <= 1.45e-216) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6e-7], 1.0, If[LessEqual[x, 1.45e-216], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{-7}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-216}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -5.9999999999999997e-7 or 1.45e-216 < x Initial program 90.5%
*-commutative90.5%
Simplified90.5%
div-sub90.5%
*-un-lft-identity90.5%
times-frac99.0%
fma-neg99.0%
Applied egg-rr99.0%
fma-udef99.0%
unsub-neg99.0%
/-rgt-identity99.0%
*-commutative99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in x around inf 76.3%
if -5.9999999999999997e-7 < x < 1.45e-216Initial program 89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in t around inf 28.7%
+-commutative28.7%
Simplified28.7%
Taylor expanded in x around 0 28.2%
Final simplification63.1%
(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 90.4%
*-commutative90.4%
Simplified90.4%
div-sub90.4%
*-un-lft-identity90.4%
times-frac96.9%
fma-neg96.9%
Applied egg-rr96.9%
fma-udef96.9%
unsub-neg96.9%
/-rgt-identity96.9%
*-commutative96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in x around inf 57.7%
Final simplification57.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 2023290
(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)))