
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 (- INFINITY))
(* (/ y t) (/ z (fma y (/ b t) (+ a 1.0))))
(if (<= t_1 -2e-318)
t_1
(if (<= t_1 0.0)
(/ (* y z) (+ (* y b) (* t (+ a 1.0))))
(if (<= t_1 2e+304) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y / t) * (z / fma(y, (b / t), (a + 1.0)));
} else if (t_1 <= -2e-318) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t_1 <= 2e+304) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y / t) * Float64(z / fma(y, Float64(b / t), Float64(a + 1.0)))); elseif (t_1 <= -2e-318) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif (t_1 <= 2e+304) tmp = t_1; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y / t), $MachinePrecision] * N[(z / N[(y * N[(b / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-318], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+304], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-318}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 40.4%
associate-/l*70.6%
associate-+l+70.6%
associate-/l*70.6%
Simplified70.6%
Taylor expanded in x around 0 68.9%
times-frac87.5%
+-commutative87.5%
+-commutative87.5%
associate-*l/87.5%
*-commutative87.5%
associate-+r+87.5%
fma-udef87.5%
+-commutative87.5%
Simplified87.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.0000024e-318 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.9999999999999999e304Initial program 99.8%
if -2.0000024e-318 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 50.4%
associate-/l*50.4%
associate-+l+50.4%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in x around 0 50.4%
Taylor expanded in t around 0 73.4%
if 1.9999999999999999e304 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 13.3%
associate-/l*25.1%
associate-+l+25.1%
associate-/l*32.1%
Simplified32.1%
Taylor expanded in y around inf 82.1%
Final simplification91.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 -2e+231)
(/ (+ x (* y (/ z t))) (+ 1.0 (+ a (* y (/ b t)))))
(if (<= t_1 -2e-318)
t_1
(if (<= t_1 0.0)
(/ (* y z) (+ (* y b) (* t (+ a 1.0))))
(if (<= t_1 2e+304) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -2e+231) {
tmp = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t))));
} else if (t_1 <= -2e-318) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t_1 <= 2e+304) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0d0))
if (t_1 <= (-2d+231)) then
tmp = (x + (y * (z / t))) / (1.0d0 + (a + (y * (b / t))))
else if (t_1 <= (-2d-318)) then
tmp = t_1
else if (t_1 <= 0.0d0) then
tmp = (y * z) / ((y * b) + (t * (a + 1.0d0)))
else if (t_1 <= 2d+304) then
tmp = t_1
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -2e+231) {
tmp = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t))));
} else if (t_1 <= -2e-318) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t_1 <= 2e+304) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if t_1 <= -2e+231: tmp = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t)))) elif t_1 <= -2e-318: tmp = t_1 elif t_1 <= 0.0: tmp = (y * z) / ((y * b) + (t * (a + 1.0))) elif t_1 <= 2e+304: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= -2e+231) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))); elseif (t_1 <= -2e-318) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif (t_1 <= 2e+304) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if (t_1 <= -2e+231) tmp = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t)))); elseif (t_1 <= -2e-318) tmp = t_1; elseif (t_1 <= 0.0) tmp = (y * z) / ((y * b) + (t * (a + 1.0))); elseif (t_1 <= 2e+304) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+231], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-318], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+304], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+231}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-318}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.0000000000000001e231Initial program 56.5%
*-commutative56.5%
associate-/l*78.5%
+-commutative78.5%
associate-+l+78.5%
associate-*r/78.5%
*-commutative78.5%
Simplified78.5%
associate-/r/78.5%
Applied egg-rr78.5%
if -2.0000000000000001e231 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.0000024e-318 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.9999999999999999e304Initial program 99.8%
if -2.0000024e-318 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 50.4%
associate-/l*50.4%
associate-+l+50.4%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in x around 0 50.4%
Taylor expanded in t around 0 73.4%
if 1.9999999999999999e304 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 13.3%
associate-/l*25.1%
associate-+l+25.1%
associate-/l*32.1%
Simplified32.1%
Taylor expanded in y around inf 82.1%
Final simplification90.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2 (+ 1.0 (+ a (/ b (/ t y))))))
(if (<= t_1 -2e-318)
(+ (/ y (/ (* t t_2) z)) (/ x t_2))
(if (<= t_1 0.0)
(/ (* y z) (+ (* y b) (* t (+ a 1.0))))
(if (<= t_1 2e+304) t_1 (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = 1.0 + (a + (b / (t / y)));
double tmp;
if (t_1 <= -2e-318) {
tmp = (y / ((t * t_2) / z)) + (x / t_2);
} else if (t_1 <= 0.0) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t_1 <= 2e+304) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0d0))
t_2 = 1.0d0 + (a + (b / (t / y)))
if (t_1 <= (-2d-318)) then
tmp = (y / ((t * t_2) / z)) + (x / t_2)
else if (t_1 <= 0.0d0) then
tmp = (y * z) / ((y * b) + (t * (a + 1.0d0)))
else if (t_1 <= 2d+304) then
tmp = t_1
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = 1.0 + (a + (b / (t / y)));
double tmp;
if (t_1 <= -2e-318) {
tmp = (y / ((t * t_2) / z)) + (x / t_2);
} else if (t_1 <= 0.0) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t_1 <= 2e+304) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) t_2 = 1.0 + (a + (b / (t / y))) tmp = 0 if t_1 <= -2e-318: tmp = (y / ((t * t_2) / z)) + (x / t_2) elif t_1 <= 0.0: tmp = (y * z) / ((y * b) + (t * (a + 1.0))) elif t_1 <= 2e+304: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) t_2 = Float64(1.0 + Float64(a + Float64(b / Float64(t / y)))) tmp = 0.0 if (t_1 <= -2e-318) tmp = Float64(Float64(y / Float64(Float64(t * t_2) / z)) + Float64(x / t_2)); elseif (t_1 <= 0.0) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif (t_1 <= 2e+304) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); t_2 = 1.0 + (a + (b / (t / y))); tmp = 0.0; if (t_1 <= -2e-318) tmp = (y / ((t * t_2) / z)) + (x / t_2); elseif (t_1 <= 0.0) tmp = (y * z) / ((y * b) + (t * (a + 1.0))); elseif (t_1 <= 2e+304) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(a + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-318], N[(N[(y / N[(N[(t * t$95$2), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+304], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_2 := 1 + \left(a + \frac{b}{\frac{t}{y}}\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-318}:\\
\;\;\;\;\frac{y}{\frac{t \cdot t_2}{z}} + \frac{x}{t_2}\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.0000024e-318Initial program 89.7%
*-commutative89.7%
associate-/l*92.8%
+-commutative92.8%
associate-+l+92.8%
associate-*r/86.8%
*-commutative86.8%
Simplified86.8%
associate-/r/85.6%
Applied egg-rr85.6%
Taylor expanded in x around 0 93.3%
+-commutative93.3%
associate-/l*95.1%
associate-/l*93.0%
associate-/l*91.9%
Simplified91.9%
if -2.0000024e-318 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 50.4%
associate-/l*50.4%
associate-+l+50.4%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in x around 0 50.4%
Taylor expanded in t around 0 73.4%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.9999999999999999e304Initial program 99.8%
if 1.9999999999999999e304 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 13.3%
associate-/l*25.1%
associate-+l+25.1%
associate-/l*32.1%
Simplified32.1%
Taylor expanded in y around inf 82.1%
Final simplification89.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* y (/ z t))) (+ 1.0 (+ a (* y (/ b t)))))))
(if (<= t -3.9e-88)
t_1
(if (<= t -2.6e-159)
(/ (* y z) (+ (* y b) (* t (+ a 1.0))))
(if (<= t 2e-71) (+ (/ z b) (/ (* x t) (* y b))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t))));
double tmp;
if (t <= -3.9e-88) {
tmp = t_1;
} else if (t <= -2.6e-159) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 2e-71) {
tmp = (z / b) + ((x * t) / (y * b));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y * (z / t))) / (1.0d0 + (a + (y * (b / t))))
if (t <= (-3.9d-88)) then
tmp = t_1
else if (t <= (-2.6d-159)) then
tmp = (y * z) / ((y * b) + (t * (a + 1.0d0)))
else if (t <= 2d-71) then
tmp = (z / b) + ((x * t) / (y * b))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t))));
double tmp;
if (t <= -3.9e-88) {
tmp = t_1;
} else if (t <= -2.6e-159) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 2e-71) {
tmp = (z / b) + ((x * t) / (y * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t)))) tmp = 0 if t <= -3.9e-88: tmp = t_1 elif t <= -2.6e-159: tmp = (y * z) / ((y * b) + (t * (a + 1.0))) elif t <= 2e-71: tmp = (z / b) + ((x * t) / (y * b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))) tmp = 0.0 if (t <= -3.9e-88) tmp = t_1; elseif (t <= -2.6e-159) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif (t <= 2e-71) tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t)))); tmp = 0.0; if (t <= -3.9e-88) tmp = t_1; elseif (t <= -2.6e-159) tmp = (y * z) / ((y * b) + (t * (a + 1.0))); elseif (t <= 2e-71) tmp = (z / b) + ((x * t) / (y * b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.9e-88], t$95$1, If[LessEqual[t, -2.6e-159], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e-71], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y \cdot \frac{z}{t}}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{if}\;t \leq -3.9 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{-159}:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-71}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.89999999999999992e-88 or 1.9999999999999998e-71 < t Initial program 82.8%
*-commutative82.8%
associate-/l*88.2%
+-commutative88.2%
associate-+l+88.2%
associate-*r/93.4%
*-commutative93.4%
Simplified93.4%
associate-/r/93.9%
Applied egg-rr93.9%
if -3.89999999999999992e-88 < t < -2.5999999999999998e-159Initial program 71.5%
associate-/l*52.3%
associate-+l+52.3%
associate-/l*46.3%
Simplified46.3%
Taylor expanded in x around 0 90.0%
Taylor expanded in t around 0 90.1%
if -2.5999999999999998e-159 < t < 1.9999999999999998e-71Initial program 55.8%
associate-/l*46.4%
associate-+l+46.4%
associate-/l*41.5%
Simplified41.5%
Taylor expanded in b around inf 44.4%
times-frac31.0%
+-commutative31.0%
associate-*r/31.1%
*-commutative31.1%
fma-udef31.1%
Simplified31.1%
Taylor expanded in t around 0 70.7%
Final simplification86.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -6.2e-86)
(/ (+ x (* y (/ z t))) (+ 1.0 (+ a (* y (/ b t)))))
(if (<= t -2.6e-159)
(/ (* y z) (+ (* y b) (* t (+ a 1.0))))
(if (<= t 4.1e-72)
(+ (/ z b) (/ (* x t) (* y b)))
(/ (+ x (/ y (/ t z))) (+ a (+ 1.0 (/ y (/ t b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.2e-86) {
tmp = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t))));
} else if (t <= -2.6e-159) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 4.1e-72) {
tmp = (z / b) + ((x * t) / (y * b));
} else {
tmp = (x + (y / (t / z))) / (a + (1.0 + (y / (t / b))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-6.2d-86)) then
tmp = (x + (y * (z / t))) / (1.0d0 + (a + (y * (b / t))))
else if (t <= (-2.6d-159)) then
tmp = (y * z) / ((y * b) + (t * (a + 1.0d0)))
else if (t <= 4.1d-72) then
tmp = (z / b) + ((x * t) / (y * b))
else
tmp = (x + (y / (t / z))) / (a + (1.0d0 + (y / (t / b))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.2e-86) {
tmp = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t))));
} else if (t <= -2.6e-159) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 4.1e-72) {
tmp = (z / b) + ((x * t) / (y * b));
} else {
tmp = (x + (y / (t / z))) / (a + (1.0 + (y / (t / b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6.2e-86: tmp = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t)))) elif t <= -2.6e-159: tmp = (y * z) / ((y * b) + (t * (a + 1.0))) elif t <= 4.1e-72: tmp = (z / b) + ((x * t) / (y * b)) else: tmp = (x + (y / (t / z))) / (a + (1.0 + (y / (t / b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6.2e-86) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))); elseif (t <= -2.6e-159) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif (t <= 4.1e-72) tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); else tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -6.2e-86) tmp = (x + (y * (z / t))) / (1.0 + (a + (y * (b / t)))); elseif (t <= -2.6e-159) tmp = (y * z) / ((y * b) + (t * (a + 1.0))); elseif (t <= 4.1e-72) tmp = (z / b) + ((x * t) / (y * b)); else tmp = (x + (y / (t / z))) / (a + (1.0 + (y / (t / b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.2e-86], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.6e-159], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e-72], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{-86}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{-159}:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{-72}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\end{array}
\end{array}
if t < -6.19999999999999977e-86Initial program 86.0%
*-commutative86.0%
associate-/l*88.6%
+-commutative88.6%
associate-+l+88.6%
associate-*r/92.4%
*-commutative92.4%
Simplified92.4%
associate-/r/93.5%
Applied egg-rr93.5%
if -6.19999999999999977e-86 < t < -2.5999999999999998e-159Initial program 71.5%
associate-/l*52.3%
associate-+l+52.3%
associate-/l*46.3%
Simplified46.3%
Taylor expanded in x around 0 90.0%
Taylor expanded in t around 0 90.1%
if -2.5999999999999998e-159 < t < 4.10000000000000003e-72Initial program 55.8%
associate-/l*46.4%
associate-+l+46.4%
associate-/l*41.5%
Simplified41.5%
Taylor expanded in b around inf 44.4%
times-frac31.0%
+-commutative31.0%
associate-*r/31.1%
*-commutative31.1%
fma-udef31.1%
Simplified31.1%
Taylor expanded in t around 0 70.7%
if 4.10000000000000003e-72 < t Initial program 80.1%
associate-/l*87.8%
associate-+l+87.8%
associate-/l*94.3%
Simplified94.3%
Final simplification86.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.2e-159) (not (<= t 5.2e-72))) (/ (+ x (/ z (/ t y))) (+ 1.0 (+ a (* y (/ b t))))) (+ (/ z b) (/ (* x t) (* y b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.2e-159) || !(t <= 5.2e-72)) {
tmp = (x + (z / (t / y))) / (1.0 + (a + (y * (b / t))));
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-3.2d-159)) .or. (.not. (t <= 5.2d-72))) then
tmp = (x + (z / (t / y))) / (1.0d0 + (a + (y * (b / t))))
else
tmp = (z / b) + ((x * t) / (y * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.2e-159) || !(t <= 5.2e-72)) {
tmp = (x + (z / (t / y))) / (1.0 + (a + (y * (b / t))));
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.2e-159) or not (t <= 5.2e-72): tmp = (x + (z / (t / y))) / (1.0 + (a + (y * (b / t)))) else: tmp = (z / b) + ((x * t) / (y * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.2e-159) || !(t <= 5.2e-72)) tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))); else tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.2e-159) || ~((t <= 5.2e-72))) tmp = (x + (z / (t / y))) / (1.0 + (a + (y * (b / t)))); else tmp = (z / b) + ((x * t) / (y * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.2e-159], N[Not[LessEqual[t, 5.2e-72]], $MachinePrecision]], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-159} \lor \neg \left(t \leq 5.2 \cdot 10^{-72}\right):\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -3.2e-159 or 5.19999999999999992e-72 < t Initial program 82.2%
*-commutative82.2%
associate-/l*87.2%
+-commutative87.2%
associate-+l+87.2%
associate-*r/91.6%
*-commutative91.6%
Simplified91.6%
if -3.2e-159 < t < 5.19999999999999992e-72Initial program 55.8%
associate-/l*46.4%
associate-+l+46.4%
associate-/l*41.5%
Simplified41.5%
Taylor expanded in b around inf 44.4%
times-frac31.0%
+-commutative31.0%
associate-*r/31.1%
*-commutative31.1%
fma-udef31.1%
Simplified31.1%
Taylor expanded in t around 0 70.7%
Final simplification84.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ z b) (/ (* x t) (* y b)))) (t_2 (/ x (+ a 1.0))))
(if (<= t -1.9e-32)
t_2
(if (<= t 1e-38)
t_1
(if (<= t 9e+32)
(/ (+ x (/ y (/ t z))) a)
(if (<= t 1.55e+49) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + ((x * t) / (y * b));
double t_2 = x / (a + 1.0);
double tmp;
if (t <= -1.9e-32) {
tmp = t_2;
} else if (t <= 1e-38) {
tmp = t_1;
} else if (t <= 9e+32) {
tmp = (x + (y / (t / z))) / a;
} else if (t <= 1.55e+49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z / b) + ((x * t) / (y * b))
t_2 = x / (a + 1.0d0)
if (t <= (-1.9d-32)) then
tmp = t_2
else if (t <= 1d-38) then
tmp = t_1
else if (t <= 9d+32) then
tmp = (x + (y / (t / z))) / a
else if (t <= 1.55d+49) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + ((x * t) / (y * b));
double t_2 = x / (a + 1.0);
double tmp;
if (t <= -1.9e-32) {
tmp = t_2;
} else if (t <= 1e-38) {
tmp = t_1;
} else if (t <= 9e+32) {
tmp = (x + (y / (t / z))) / a;
} else if (t <= 1.55e+49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z / b) + ((x * t) / (y * b)) t_2 = x / (a + 1.0) tmp = 0 if t <= -1.9e-32: tmp = t_2 elif t <= 1e-38: tmp = t_1 elif t <= 9e+32: tmp = (x + (y / (t / z))) / a elif t <= 1.55e+49: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))) t_2 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -1.9e-32) tmp = t_2; elseif (t <= 1e-38) tmp = t_1; elseif (t <= 9e+32) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / a); elseif (t <= 1.55e+49) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z / b) + ((x * t) / (y * b)); t_2 = x / (a + 1.0); tmp = 0.0; if (t <= -1.9e-32) tmp = t_2; elseif (t <= 1e-38) tmp = t_1; elseif (t <= 9e+32) tmp = (x + (y / (t / z))) / a; elseif (t <= 1.55e+49) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.9e-32], t$95$2, If[LessEqual[t, 1e-38], t$95$1, If[LessEqual[t, 9e+32], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 1.55e+49], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
t_2 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{-32}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 10^{-38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+32}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.90000000000000004e-32 or 1.54999999999999996e49 < t Initial program 82.2%
associate-/l*89.9%
associate-+l+89.9%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around 0 66.9%
if -1.90000000000000004e-32 < t < 9.9999999999999996e-39 or 9.0000000000000007e32 < t < 1.54999999999999996e49Initial program 62.2%
associate-/l*54.1%
associate-+l+54.1%
associate-/l*50.3%
Simplified50.3%
Taylor expanded in b around inf 44.3%
times-frac36.7%
+-commutative36.7%
associate-*r/36.7%
*-commutative36.7%
fma-udef36.7%
Simplified36.7%
Taylor expanded in t around 0 66.5%
if 9.9999999999999996e-39 < t < 9.0000000000000007e32Initial program 99.9%
associate-/l*99.9%
associate-+l+99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around inf 83.6%
Final simplification67.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ z b) (/ (* x t) (* y b))))
(t_2 (/ x (+ 1.0 (+ a (* y (/ b t)))))))
(if (<= t -2.35e-32)
t_2
(if (<= t 2.4e-35)
t_1
(if (<= t 1.6e+24)
(/ (+ x (/ y (/ t z))) a)
(if (<= t 1.55e+49) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + ((x * t) / (y * b));
double t_2 = x / (1.0 + (a + (y * (b / t))));
double tmp;
if (t <= -2.35e-32) {
tmp = t_2;
} else if (t <= 2.4e-35) {
tmp = t_1;
} else if (t <= 1.6e+24) {
tmp = (x + (y / (t / z))) / a;
} else if (t <= 1.55e+49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z / b) + ((x * t) / (y * b))
t_2 = x / (1.0d0 + (a + (y * (b / t))))
if (t <= (-2.35d-32)) then
tmp = t_2
else if (t <= 2.4d-35) then
tmp = t_1
else if (t <= 1.6d+24) then
tmp = (x + (y / (t / z))) / a
else if (t <= 1.55d+49) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + ((x * t) / (y * b));
double t_2 = x / (1.0 + (a + (y * (b / t))));
double tmp;
if (t <= -2.35e-32) {
tmp = t_2;
} else if (t <= 2.4e-35) {
tmp = t_1;
} else if (t <= 1.6e+24) {
tmp = (x + (y / (t / z))) / a;
} else if (t <= 1.55e+49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z / b) + ((x * t) / (y * b)) t_2 = x / (1.0 + (a + (y * (b / t)))) tmp = 0 if t <= -2.35e-32: tmp = t_2 elif t <= 2.4e-35: tmp = t_1 elif t <= 1.6e+24: tmp = (x + (y / (t / z))) / a elif t <= 1.55e+49: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))) t_2 = Float64(x / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))) tmp = 0.0 if (t <= -2.35e-32) tmp = t_2; elseif (t <= 2.4e-35) tmp = t_1; elseif (t <= 1.6e+24) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / a); elseif (t <= 1.55e+49) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z / b) + ((x * t) / (y * b)); t_2 = x / (1.0 + (a + (y * (b / t)))); tmp = 0.0; if (t <= -2.35e-32) tmp = t_2; elseif (t <= 2.4e-35) tmp = t_1; elseif (t <= 1.6e+24) tmp = (x + (y / (t / z))) / a; elseif (t <= 1.55e+49) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.35e-32], t$95$2, If[LessEqual[t, 2.4e-35], t$95$1, If[LessEqual[t, 1.6e+24], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 1.55e+49], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
t_2 := \frac{x}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{if}\;t \leq -2.35 \cdot 10^{-32}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+24}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.3500000000000001e-32 or 1.54999999999999996e49 < t Initial program 82.2%
associate-/l*89.9%
associate-+l+89.9%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in x around inf 71.0%
associate-*l/74.1%
Applied egg-rr74.1%
if -2.3500000000000001e-32 < t < 2.4000000000000001e-35 or 1.5999999999999999e24 < t < 1.54999999999999996e49Initial program 62.2%
associate-/l*54.1%
associate-+l+54.1%
associate-/l*50.3%
Simplified50.3%
Taylor expanded in b around inf 44.3%
times-frac36.7%
+-commutative36.7%
associate-*r/36.7%
*-commutative36.7%
fma-udef36.7%
Simplified36.7%
Taylor expanded in t around 0 66.5%
if 2.4000000000000001e-35 < t < 1.5999999999999999e24Initial program 99.9%
associate-/l*99.9%
associate-+l+99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around inf 83.6%
Final simplification71.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ z b) (/ (* x t) (* y b))))
(t_2 (/ x (+ 1.0 (+ a (* y (/ b t)))))))
(if (<= t -1.55e-32)
t_2
(if (<= t 1.3e-37)
t_1
(if (<= t 5.5e+26)
(/ (+ x (/ 1.0 (/ t (* y z)))) a)
(if (<= t 1.55e+49) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + ((x * t) / (y * b));
double t_2 = x / (1.0 + (a + (y * (b / t))));
double tmp;
if (t <= -1.55e-32) {
tmp = t_2;
} else if (t <= 1.3e-37) {
tmp = t_1;
} else if (t <= 5.5e+26) {
tmp = (x + (1.0 / (t / (y * z)))) / a;
} else if (t <= 1.55e+49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z / b) + ((x * t) / (y * b))
t_2 = x / (1.0d0 + (a + (y * (b / t))))
if (t <= (-1.55d-32)) then
tmp = t_2
else if (t <= 1.3d-37) then
tmp = t_1
else if (t <= 5.5d+26) then
tmp = (x + (1.0d0 / (t / (y * z)))) / a
else if (t <= 1.55d+49) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) + ((x * t) / (y * b));
double t_2 = x / (1.0 + (a + (y * (b / t))));
double tmp;
if (t <= -1.55e-32) {
tmp = t_2;
} else if (t <= 1.3e-37) {
tmp = t_1;
} else if (t <= 5.5e+26) {
tmp = (x + (1.0 / (t / (y * z)))) / a;
} else if (t <= 1.55e+49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z / b) + ((x * t) / (y * b)) t_2 = x / (1.0 + (a + (y * (b / t)))) tmp = 0 if t <= -1.55e-32: tmp = t_2 elif t <= 1.3e-37: tmp = t_1 elif t <= 5.5e+26: tmp = (x + (1.0 / (t / (y * z)))) / a elif t <= 1.55e+49: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))) t_2 = Float64(x / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))) tmp = 0.0 if (t <= -1.55e-32) tmp = t_2; elseif (t <= 1.3e-37) tmp = t_1; elseif (t <= 5.5e+26) tmp = Float64(Float64(x + Float64(1.0 / Float64(t / Float64(y * z)))) / a); elseif (t <= 1.55e+49) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z / b) + ((x * t) / (y * b)); t_2 = x / (1.0 + (a + (y * (b / t)))); tmp = 0.0; if (t <= -1.55e-32) tmp = t_2; elseif (t <= 1.3e-37) tmp = t_1; elseif (t <= 5.5e+26) tmp = (x + (1.0 / (t / (y * z)))) / a; elseif (t <= 1.55e+49) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.55e-32], t$95$2, If[LessEqual[t, 1.3e-37], t$95$1, If[LessEqual[t, 5.5e+26], N[(N[(x + N[(1.0 / N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 1.55e+49], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
t_2 := \frac{x}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{-32}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+26}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{t}{y \cdot z}}}{a}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.55000000000000005e-32 or 1.54999999999999996e49 < t Initial program 82.2%
associate-/l*89.9%
associate-+l+89.9%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in x around inf 71.0%
associate-*l/74.1%
Applied egg-rr74.1%
if -1.55000000000000005e-32 < t < 1.2999999999999999e-37 or 5.4999999999999997e26 < t < 1.54999999999999996e49Initial program 62.2%
associate-/l*54.1%
associate-+l+54.1%
associate-/l*50.3%
Simplified50.3%
Taylor expanded in b around inf 44.3%
times-frac36.7%
+-commutative36.7%
associate-*r/36.7%
*-commutative36.7%
fma-udef36.7%
Simplified36.7%
Taylor expanded in t around 0 66.5%
if 1.2999999999999999e-37 < t < 5.4999999999999997e26Initial program 99.9%
associate-/l*99.9%
associate-+l+99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around inf 83.6%
associate-/l*83.6%
clear-num83.7%
inv-pow83.7%
Applied egg-rr83.7%
unpow-183.7%
Simplified83.7%
Final simplification71.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.1e-36)
(/ x (+ 1.0 (+ a (* y (/ b t)))))
(if (<= t -3.8e-159)
(/ (* y z) (+ (* y b) (* t (+ a 1.0))))
(if (<= t 2.4e-39)
(+ (/ z b) (/ (* x t) (* y b)))
(/ (+ x (/ y (/ t z))) (+ a 1.0))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.1e-36) {
tmp = x / (1.0 + (a + (y * (b / t))));
} else if (t <= -3.8e-159) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 2.4e-39) {
tmp = (z / b) + ((x * t) / (y * b));
} else {
tmp = (x + (y / (t / z))) / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.1d-36)) then
tmp = x / (1.0d0 + (a + (y * (b / t))))
else if (t <= (-3.8d-159)) then
tmp = (y * z) / ((y * b) + (t * (a + 1.0d0)))
else if (t <= 2.4d-39) then
tmp = (z / b) + ((x * t) / (y * b))
else
tmp = (x + (y / (t / z))) / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.1e-36) {
tmp = x / (1.0 + (a + (y * (b / t))));
} else if (t <= -3.8e-159) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 2.4e-39) {
tmp = (z / b) + ((x * t) / (y * b));
} else {
tmp = (x + (y / (t / z))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.1e-36: tmp = x / (1.0 + (a + (y * (b / t)))) elif t <= -3.8e-159: tmp = (y * z) / ((y * b) + (t * (a + 1.0))) elif t <= 2.4e-39: tmp = (z / b) + ((x * t) / (y * b)) else: tmp = (x + (y / (t / z))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.1e-36) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))); elseif (t <= -3.8e-159) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif (t <= 2.4e-39) tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); else tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.1e-36) tmp = x / (1.0 + (a + (y * (b / t)))); elseif (t <= -3.8e-159) tmp = (y * z) / ((y * b) + (t * (a + 1.0))); elseif (t <= 2.4e-39) tmp = (z / b) + ((x * t) / (y * b)); else tmp = (x + (y / (t / z))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.1e-36], N[(x / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.8e-159], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-39], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{-36}:\\
\;\;\;\;\frac{x}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-159}:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-39}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\
\end{array}
\end{array}
if t < -1.1e-36Initial program 86.9%
associate-/l*91.2%
associate-+l+91.2%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in x around inf 75.1%
associate-*l/79.4%
Applied egg-rr79.4%
if -1.1e-36 < t < -3.8000000000000001e-159Initial program 76.0%
associate-/l*66.5%
associate-+l+66.5%
associate-/l*63.6%
Simplified63.6%
Taylor expanded in x around 0 80.3%
Taylor expanded in t around 0 80.5%
if -3.8000000000000001e-159 < t < 2.40000000000000016e-39Initial program 57.5%
associate-/l*49.1%
associate-+l+49.1%
associate-/l*44.8%
Simplified44.8%
Taylor expanded in b around inf 44.1%
times-frac32.2%
+-commutative32.2%
associate-*r/32.3%
*-commutative32.3%
fma-udef32.3%
Simplified32.3%
Taylor expanded in t around 0 68.6%
if 2.40000000000000016e-39 < t Initial program 81.2%
associate-/l*89.9%
associate-+l+89.9%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in y around 0 81.8%
Final simplification76.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -2.8e-32)
t_1
(if (<= t 2.45e-71)
(/ z b)
(if (<= t 1.1e+33)
(/ (+ x (/ y (/ t z))) a)
(if (<= t 1.55e+49) (/ z b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -2.8e-32) {
tmp = t_1;
} else if (t <= 2.45e-71) {
tmp = z / b;
} else if (t <= 1.1e+33) {
tmp = (x + (y / (t / z))) / a;
} else if (t <= 1.55e+49) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (a + 1.0d0)
if (t <= (-2.8d-32)) then
tmp = t_1
else if (t <= 2.45d-71) then
tmp = z / b
else if (t <= 1.1d+33) then
tmp = (x + (y / (t / z))) / a
else if (t <= 1.55d+49) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -2.8e-32) {
tmp = t_1;
} else if (t <= 2.45e-71) {
tmp = z / b;
} else if (t <= 1.1e+33) {
tmp = (x + (y / (t / z))) / a;
} else if (t <= 1.55e+49) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -2.8e-32: tmp = t_1 elif t <= 2.45e-71: tmp = z / b elif t <= 1.1e+33: tmp = (x + (y / (t / z))) / a elif t <= 1.55e+49: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -2.8e-32) tmp = t_1; elseif (t <= 2.45e-71) tmp = Float64(z / b); elseif (t <= 1.1e+33) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / a); elseif (t <= 1.55e+49) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (a + 1.0); tmp = 0.0; if (t <= -2.8e-32) tmp = t_1; elseif (t <= 2.45e-71) tmp = z / b; elseif (t <= 1.1e+33) tmp = (x + (y / (t / z))) / a; elseif (t <= 1.55e+49) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.8e-32], t$95$1, If[LessEqual[t, 2.45e-71], N[(z / b), $MachinePrecision], If[LessEqual[t, 1.1e+33], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 1.55e+49], N[(z / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.45 \cdot 10^{-71}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+33}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+49}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.7999999999999999e-32 or 1.54999999999999996e49 < t Initial program 82.2%
associate-/l*89.9%
associate-+l+89.9%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around 0 66.9%
if -2.7999999999999999e-32 < t < 2.4499999999999999e-71 or 1.09999999999999997e33 < t < 1.54999999999999996e49Initial program 61.4%
associate-/l*52.6%
associate-+l+52.6%
associate-/l*48.4%
Simplified48.4%
Taylor expanded in y around inf 61.5%
if 2.4499999999999999e-71 < t < 1.09999999999999997e33Initial program 86.9%
associate-/l*86.9%
associate-+l+86.9%
associate-/l*86.9%
Simplified86.9%
Taylor expanded in a around inf 69.1%
Final simplification64.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -1.15e-32)
t_1
(if (<= t 7.5e-71)
(/ z b)
(if (<= t 1.55e+31)
(/ (+ x (/ (* y z) t)) a)
(if (<= t 1.55e+49) (/ z b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -1.15e-32) {
tmp = t_1;
} else if (t <= 7.5e-71) {
tmp = z / b;
} else if (t <= 1.55e+31) {
tmp = (x + ((y * z) / t)) / a;
} else if (t <= 1.55e+49) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (a + 1.0d0)
if (t <= (-1.15d-32)) then
tmp = t_1
else if (t <= 7.5d-71) then
tmp = z / b
else if (t <= 1.55d+31) then
tmp = (x + ((y * z) / t)) / a
else if (t <= 1.55d+49) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -1.15e-32) {
tmp = t_1;
} else if (t <= 7.5e-71) {
tmp = z / b;
} else if (t <= 1.55e+31) {
tmp = (x + ((y * z) / t)) / a;
} else if (t <= 1.55e+49) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -1.15e-32: tmp = t_1 elif t <= 7.5e-71: tmp = z / b elif t <= 1.55e+31: tmp = (x + ((y * z) / t)) / a elif t <= 1.55e+49: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -1.15e-32) tmp = t_1; elseif (t <= 7.5e-71) tmp = Float64(z / b); elseif (t <= 1.55e+31) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / a); elseif (t <= 1.55e+49) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (a + 1.0); tmp = 0.0; if (t <= -1.15e-32) tmp = t_1; elseif (t <= 7.5e-71) tmp = z / b; elseif (t <= 1.55e+31) tmp = (x + ((y * z) / t)) / a; elseif (t <= 1.55e+49) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.15e-32], t$95$1, If[LessEqual[t, 7.5e-71], N[(z / b), $MachinePrecision], If[LessEqual[t, 1.55e+31], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 1.55e+49], N[(z / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-71}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+31}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+49}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.15e-32 or 1.54999999999999996e49 < t Initial program 82.2%
associate-/l*89.9%
associate-+l+89.9%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around 0 66.9%
if -1.15e-32 < t < 7.5000000000000004e-71 or 1.5500000000000001e31 < t < 1.54999999999999996e49Initial program 61.4%
associate-/l*52.6%
associate-+l+52.6%
associate-/l*48.4%
Simplified48.4%
Taylor expanded in y around inf 61.5%
if 7.5000000000000004e-71 < t < 1.5500000000000001e31Initial program 86.9%
associate-/l*86.9%
associate-+l+86.9%
associate-/l*86.9%
Simplified86.9%
Taylor expanded in a around inf 69.1%
Final simplification64.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.1e-32) (not (<= t 5.1e-39))) (/ (+ x (/ y (/ t z))) (+ a 1.0)) (+ (/ z b) (/ (* x t) (* y b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.1e-32) || !(t <= 5.1e-39)) {
tmp = (x + (y / (t / z))) / (a + 1.0);
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.1d-32)) .or. (.not. (t <= 5.1d-39))) then
tmp = (x + (y / (t / z))) / (a + 1.0d0)
else
tmp = (z / b) + ((x * t) / (y * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.1e-32) || !(t <= 5.1e-39)) {
tmp = (x + (y / (t / z))) / (a + 1.0);
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.1e-32) or not (t <= 5.1e-39): tmp = (x + (y / (t / z))) / (a + 1.0) else: tmp = (z / b) + ((x * t) / (y * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.1e-32) || !(t <= 5.1e-39)) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + 1.0)); else tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.1e-32) || ~((t <= 5.1e-39))) tmp = (x + (y / (t / z))) / (a + 1.0); else tmp = (z / b) + ((x * t) / (y * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.1e-32], N[Not[LessEqual[t, 5.1e-39]], $MachinePrecision]], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{-32} \lor \neg \left(t \leq 5.1 \cdot 10^{-39}\right):\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -1.1e-32 or 5.09999999999999988e-39 < t Initial program 83.7%
associate-/l*90.4%
associate-+l+90.4%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around 0 80.9%
if -1.1e-32 < t < 5.09999999999999988e-39Initial program 61.1%
associate-/l*52.6%
associate-+l+52.6%
associate-/l*48.6%
Simplified48.6%
Taylor expanded in b around inf 43.1%
times-frac35.0%
+-commutative35.0%
associate-*r/35.1%
*-commutative35.1%
fma-udef35.1%
Simplified35.1%
Taylor expanded in t around 0 65.6%
Final simplification74.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.2e-32) (not (<= t 1.6e-57))) (/ x (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.2e-32) || !(t <= 1.6e-57)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-2.2d-32)) .or. (.not. (t <= 1.6d-57))) then
tmp = x / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.2e-32) || !(t <= 1.6e-57)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.2e-32) or not (t <= 1.6e-57): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.2e-32) || !(t <= 1.6e-57)) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.2e-32) || ~((t <= 1.6e-57))) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.2e-32], N[Not[LessEqual[t, 1.6e-57]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-32} \lor \neg \left(t \leq 1.6 \cdot 10^{-57}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -2.2e-32 or 1.6e-57 < t Initial program 83.1%
associate-/l*89.5%
associate-+l+89.5%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in y around 0 63.2%
if -2.2e-32 < t < 1.6e-57Initial program 60.7%
associate-/l*51.7%
associate-+l+51.7%
associate-/l*47.5%
Simplified47.5%
Taylor expanded in y around inf 60.0%
Final simplification61.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.15e+55) (not (<= y 3.5e-46))) (/ z b) (/ x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.15e+55) || !(y <= 3.5e-46)) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.15d+55)) .or. (.not. (y <= 3.5d-46))) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.15e+55) || !(y <= 3.5e-46)) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.15e+55) or not (y <= 3.5e-46): tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.15e+55) || !(y <= 3.5e-46)) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.15e+55) || ~((y <= 3.5e-46))) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.15e+55], N[Not[LessEqual[y, 3.5e-46]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+55} \lor \neg \left(y \leq 3.5 \cdot 10^{-46}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if y < -1.14999999999999994e55 or 3.5000000000000002e-46 < y Initial program 55.5%
associate-/l*62.1%
associate-+l+62.1%
associate-/l*68.6%
Simplified68.6%
Taylor expanded in y around inf 49.4%
if -1.14999999999999994e55 < y < 3.5000000000000002e-46Initial program 92.9%
associate-/l*85.9%
associate-+l+85.9%
associate-/l*82.3%
Simplified82.3%
Taylor expanded in x around inf 73.5%
Taylor expanded in a around inf 42.5%
Final simplification46.0%
(FPCore (x y z t a b) :precision binary64 (/ x a))
double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x / a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
def code(x, y, z, t, a, b): return x / a
function code(x, y, z, t, a, b) return Float64(x / a) end
function tmp = code(x, y, z, t, a, b) tmp = x / a; end
code[x_, y_, z_, t_, a_, b_] := N[(x / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a}
\end{array}
Initial program 73.7%
associate-/l*73.7%
associate-+l+73.7%
associate-/l*75.3%
Simplified75.3%
Taylor expanded in x around inf 52.9%
Taylor expanded in a around inf 27.4%
Final simplification27.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(if (< t -1.3659085366310088e-271)
t_1
(if (< t 3.036967103737246e-130) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 * ((x + ((y / t) * z)) * (1.0d0 / ((a + 1.0d0) + ((y / t) * b))))
if (t < (-1.3659085366310088d-271)) then
tmp = t_1
else if (t < 3.036967103737246d-130) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))) tmp = 0 if t < -1.3659085366310088e-271: tmp = t_1 elif t < 3.036967103737246e-130: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 * Float64(Float64(x + Float64(Float64(y / t) * z)) * Float64(1.0 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b))))) tmp = 0.0 if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))); tmp = 0.0; if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 * N[(N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.3659085366310088e-271], t$95$1, If[Less[t, 3.036967103737246e-130], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\
\mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2024010
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(if (< t -1.3659085366310088e-271) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))