
(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 12 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 (/ (* y b) t))
(t_2 (/ (+ x (/ (* y z) t)) (+ t_1 (+ a 1.0))))
(t_3 (+ 1.0 (+ a t_1)))
(t_4 (+ 1.0 (fma b (/ y t) a))))
(if (<= t_2 -5e-286)
(+ (/ x t_3) (/ (* y z) (* t t_3)))
(if (or (<= t_2 0.0) (not (<= t_2 INFINITY)))
(/ (+ z (/ (* x t) y)) b)
(fma (/ y t) (/ z t_4) (/ x t_4))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
double t_3 = 1.0 + (a + t_1);
double t_4 = 1.0 + fma(b, (y / t), a);
double tmp;
if (t_2 <= -5e-286) {
tmp = (x / t_3) + ((y * z) / (t * t_3));
} else if ((t_2 <= 0.0) || !(t_2 <= ((double) INFINITY))) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = fma((y / t), (z / t_4), (x / t_4));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(t_1 + Float64(a + 1.0))) t_3 = Float64(1.0 + Float64(a + t_1)) t_4 = Float64(1.0 + fma(b, Float64(y / t), a)) tmp = 0.0 if (t_2 <= -5e-286) tmp = Float64(Float64(x / t_3) + Float64(Float64(y * z) / Float64(t * t_3))); elseif ((t_2 <= 0.0) || !(t_2 <= Inf)) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); else tmp = fma(Float64(y / t), Float64(z / t_4), Float64(x / t_4)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(1.0 + N[(b * N[(y / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-286], N[(N[(x / t$95$3), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] / N[(t * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$2, 0.0], N[Not[LessEqual[t$95$2, Infinity]], $MachinePrecision]], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * N[(z / t$95$4), $MachinePrecision] + N[(x / t$95$4), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t\_1 + \left(a + 1\right)}\\
t_3 := 1 + \left(a + t\_1\right)\\
t_4 := 1 + \mathsf{fma}\left(b, \frac{y}{t}, a\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-286}:\\
\;\;\;\;\frac{x}{t\_3} + \frac{y \cdot z}{t \cdot t\_3}\\
\mathbf{elif}\;t\_2 \leq 0 \lor \neg \left(t\_2 \leq \infty\right):\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, \frac{z}{t\_4}, \frac{x}{t\_4}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.00000000000000037e-286Initial program 85.0%
+-commutative85.0%
associate-/l*89.0%
fma-define89.0%
+-commutative89.0%
associate-/l*85.6%
fma-define85.6%
Simplified85.6%
Taylor expanded in z around 0 91.7%
if -5.00000000000000037e-286 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 30.6%
+-commutative30.6%
associate-/l*32.2%
fma-define32.2%
+-commutative32.2%
associate-/l*40.1%
fma-define40.1%
Simplified40.1%
Taylor expanded in z around 0 32.8%
+-commutative32.8%
times-frac25.9%
fma-define25.9%
associate-*r/32.1%
+-commutative32.1%
fma-define32.1%
associate-*r/36.8%
+-commutative36.8%
fma-define36.8%
Simplified36.8%
Taylor expanded in b around inf 82.7%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 85.6%
+-commutative85.6%
associate-/l*85.6%
fma-define85.6%
+-commutative85.6%
associate-/l*80.9%
fma-define80.9%
Simplified80.9%
Taylor expanded in z around 0 88.1%
+-commutative88.1%
times-frac93.8%
fma-define93.8%
associate-*r/92.4%
+-commutative92.4%
fma-define92.4%
associate-*r/92.4%
+-commutative92.4%
fma-define92.4%
Simplified92.4%
Final simplification89.7%
(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 z) (+ (* y b) (* t (+ a 1.0))))
(if (or (<= t_1 -5e-286) (and (not (<= t_1 0.0)) (<= t_1 4e+280)))
t_1
(/ (+ z (/ (* x t) y)) 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 * z) / ((y * b) + (t * (a + 1.0)));
} else if ((t_1 <= -5e-286) || (!(t_1 <= 0.0) && (t_1 <= 4e+280))) {
tmp = t_1;
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if ((t_1 <= -5e-286) || (!(t_1 <= 0.0) && (t_1 <= 4e+280))) {
tmp = t_1;
} else {
tmp = (z + ((x * t) / y)) / 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 <= -math.inf: tmp = (y * z) / ((y * b) + (t * (a + 1.0))) elif (t_1 <= -5e-286) or (not (t_1 <= 0.0) and (t_1 <= 4e+280)): tmp = t_1 else: tmp = (z + ((x * t) / y)) / 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 * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif ((t_1 <= -5e-286) || (!(t_1 <= 0.0) && (t_1 <= 4e+280))) tmp = t_1; else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / 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 <= -Inf) tmp = (y * z) / ((y * b) + (t * (a + 1.0))); elseif ((t_1 <= -5e-286) || (~((t_1 <= 0.0)) && (t_1 <= 4e+280))) tmp = t_1; else tmp = (z + ((x * t) / y)) / 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, (-Infinity)], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -5e-286], And[N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision], LessEqual[t$95$1, 4e+280]]], t$95$1, N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / 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 \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-286} \lor \neg \left(t\_1 \leq 0\right) \land t\_1 \leq 4 \cdot 10^{+280}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 30.2%
*-commutative30.2%
associate-/l*55.0%
Applied egg-rr55.0%
Taylor expanded in t around 0 55.0%
Taylor expanded in x around 0 63.0%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.00000000000000037e-286 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.0000000000000001e280Initial program 98.7%
if -5.00000000000000037e-286 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 4.0000000000000001e280 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 28.6%
+-commutative28.6%
associate-/l*36.4%
fma-define36.4%
+-commutative36.4%
associate-/l*42.9%
fma-define42.9%
Simplified42.9%
Taylor expanded in z around 0 32.9%
+-commutative32.9%
times-frac36.2%
fma-define36.2%
associate-*r/39.8%
+-commutative39.8%
fma-define39.8%
associate-*r/43.7%
+-commutative43.7%
fma-define43.7%
Simplified43.7%
Taylor expanded in b around inf 77.9%
Final simplification89.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* y b) t))
(t_2 (+ 1.0 (+ a t_1)))
(t_3 (/ (+ x (/ (* y z) t)) (+ t_1 (+ a 1.0)))))
(if (or (<= t_3 -5e-286) (and (not (<= t_3 0.0)) (<= t_3 4e+280)))
(+ (/ x t_2) (/ (* y z) (* t t_2)))
(/ (+ z (/ (* x t) y)) b))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = 1.0 + (a + t_1);
double t_3 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
double tmp;
if ((t_3 <= -5e-286) || (!(t_3 <= 0.0) && (t_3 <= 4e+280))) {
tmp = (x / t_2) + ((y * z) / (t * t_2));
} else {
tmp = (z + ((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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (y * b) / t
t_2 = 1.0d0 + (a + t_1)
t_3 = (x + ((y * z) / t)) / (t_1 + (a + 1.0d0))
if ((t_3 <= (-5d-286)) .or. (.not. (t_3 <= 0.0d0)) .and. (t_3 <= 4d+280)) then
tmp = (x / t_2) + ((y * z) / (t * t_2))
else
tmp = (z + ((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 t_1 = (y * b) / t;
double t_2 = 1.0 + (a + t_1);
double t_3 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
double tmp;
if ((t_3 <= -5e-286) || (!(t_3 <= 0.0) && (t_3 <= 4e+280))) {
tmp = (x / t_2) + ((y * z) / (t * t_2));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = 1.0 + (a + t_1) t_3 = (x + ((y * z) / t)) / (t_1 + (a + 1.0)) tmp = 0 if (t_3 <= -5e-286) or (not (t_3 <= 0.0) and (t_3 <= 4e+280)): tmp = (x / t_2) + ((y * z) / (t * t_2)) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(1.0 + Float64(a + t_1)) t_3 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(t_1 + Float64(a + 1.0))) tmp = 0.0 if ((t_3 <= -5e-286) || (!(t_3 <= 0.0) && (t_3 <= 4e+280))) tmp = Float64(Float64(x / t_2) + Float64(Float64(y * z) / Float64(t * t_2))); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = 1.0 + (a + t_1); t_3 = (x + ((y * z) / t)) / (t_1 + (a + 1.0)); tmp = 0.0; if ((t_3 <= -5e-286) || (~((t_3 <= 0.0)) && (t_3 <= 4e+280))) tmp = (x / t_2) + ((y * z) / (t * t_2)); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$3, -5e-286], And[N[Not[LessEqual[t$95$3, 0.0]], $MachinePrecision], LessEqual[t$95$3, 4e+280]]], N[(N[(x / t$95$2), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] / N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := 1 + \left(a + t\_1\right)\\
t_3 := \frac{x + \frac{y \cdot z}{t}}{t\_1 + \left(a + 1\right)}\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-286} \lor \neg \left(t\_3 \leq 0\right) \land t\_3 \leq 4 \cdot 10^{+280}:\\
\;\;\;\;\frac{x}{t\_2} + \frac{y \cdot z}{t \cdot t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.00000000000000037e-286 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.0000000000000001e280Initial program 90.0%
+-commutative90.0%
associate-/l*89.8%
fma-define89.8%
+-commutative89.8%
associate-/l*85.6%
fma-define85.6%
Simplified85.6%
Taylor expanded in z around 0 94.2%
if -5.00000000000000037e-286 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 4.0000000000000001e280 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 28.6%
+-commutative28.6%
associate-/l*36.4%
fma-define36.4%
+-commutative36.4%
associate-/l*42.9%
fma-define42.9%
Simplified42.9%
Taylor expanded in z around 0 32.9%
+-commutative32.9%
times-frac36.2%
fma-define36.2%
associate-*r/39.8%
+-commutative39.8%
fma-define39.8%
associate-*r/43.7%
+-commutative43.7%
fma-define43.7%
Simplified43.7%
Taylor expanded in b around inf 77.9%
Final simplification89.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.55e+207)
(/ (+ z (/ (* x t) y)) b)
(if (<= y -2e-17)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= y 6.8e+184)
(/ (+ x (* z (/ y t))) (+ (/ (* y b) t) (+ a 1.0)))
(/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.55e+207) {
tmp = (z + ((x * t) / y)) / b;
} else if (y <= -2e-17) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (y <= 6.8e+184) {
tmp = (x + (z * (y / t))) / (((y * b) / t) + (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 (y <= (-2.55d+207)) then
tmp = (z + ((x * t) / y)) / b
else if (y <= (-2d-17)) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else if (y <= 6.8d+184) then
tmp = (x + (z * (y / t))) / (((y * b) / t) + (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 (y <= -2.55e+207) {
tmp = (z + ((x * t) / y)) / b;
} else if (y <= -2e-17) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (y <= 6.8e+184) {
tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.55e+207: tmp = (z + ((x * t) / y)) / b elif y <= -2e-17: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif y <= 6.8e+184: tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.55e+207) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); elseif (y <= -2e-17) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (y <= 6.8e+184) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(Float64(y * b) / t) + 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 (y <= -2.55e+207) tmp = (z + ((x * t) / y)) / b; elseif (y <= -2e-17) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (y <= 6.8e+184) tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0)); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.55e+207], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, -2e-17], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+184], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.55 \cdot 10^{+207}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-17}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+184}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.5499999999999999e207Initial program 24.9%
+-commutative24.9%
associate-/l*38.5%
fma-define38.5%
+-commutative38.5%
associate-/l*47.0%
fma-define47.0%
Simplified47.0%
Taylor expanded in z around 0 25.0%
+-commutative25.0%
times-frac29.5%
fma-define29.5%
associate-*r/28.3%
+-commutative28.3%
fma-define28.3%
associate-*r/28.3%
+-commutative28.3%
fma-define28.3%
Simplified28.3%
Taylor expanded in b around inf 77.9%
if -2.5499999999999999e207 < y < -2.00000000000000014e-17Initial program 67.2%
associate-/l*71.4%
associate-/l*77.4%
Simplified77.4%
if -2.00000000000000014e-17 < y < 6.8000000000000003e184Initial program 86.8%
*-commutative86.8%
associate-/l*89.4%
Applied egg-rr89.4%
if 6.8000000000000003e184 < y Initial program 34.1%
+-commutative34.1%
associate-/l*40.7%
fma-define40.7%
+-commutative40.7%
associate-/l*41.0%
fma-define41.0%
Simplified41.0%
Taylor expanded in y around inf 79.0%
Final simplification85.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5.2e-73) (not (<= t 2.5e-200))) (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t)))) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.2e-73) || !(t <= 2.5e-200)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z + ((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 <= (-5.2d-73)) .or. (.not. (t <= 2.5d-200))) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else
tmp = (z + ((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 <= -5.2e-73) || !(t <= 2.5e-200)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -5.2e-73) or not (t <= 2.5e-200): tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5.2e-73) || !(t <= 2.5e-200)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -5.2e-73) || ~((t <= 2.5e-200))) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5.2e-73], N[Not[LessEqual[t, 2.5e-200]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-73} \lor \neg \left(t \leq 2.5 \cdot 10^{-200}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -5.2000000000000002e-73 or 2.49999999999999996e-200 < t Initial program 79.1%
associate-/l*83.8%
associate-/l*84.8%
Simplified84.8%
if -5.2000000000000002e-73 < t < 2.49999999999999996e-200Initial program 51.1%
+-commutative51.1%
associate-/l*45.9%
fma-define46.0%
+-commutative46.0%
associate-/l*38.6%
fma-define38.6%
Simplified38.6%
Taylor expanded in z around 0 62.0%
+-commutative62.0%
times-frac51.3%
fma-define51.3%
associate-*r/46.4%
+-commutative46.4%
fma-define46.4%
associate-*r/46.4%
+-commutative46.4%
fma-define46.4%
Simplified46.4%
Taylor expanded in b around inf 76.7%
Final simplification82.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -500000000000.0) (not (<= t 4.4e-98))) (/ (+ x (* z (/ y t))) (+ a 1.0)) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -500000000000.0) || !(t <= 4.4e-98)) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else {
tmp = (z + ((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 <= (-500000000000.0d0)) .or. (.not. (t <= 4.4d-98))) then
tmp = (x + (z * (y / t))) / (a + 1.0d0)
else
tmp = (z + ((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 <= -500000000000.0) || !(t <= 4.4e-98)) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -500000000000.0) or not (t <= 4.4e-98): tmp = (x + (z * (y / t))) / (a + 1.0) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -500000000000.0) || !(t <= 4.4e-98)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -500000000000.0) || ~((t <= 4.4e-98))) tmp = (x + (z * (y / t))) / (a + 1.0); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -500000000000.0], N[Not[LessEqual[t, 4.4e-98]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -500000000000 \lor \neg \left(t \leq 4.4 \cdot 10^{-98}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -5e11 or 4.39999999999999993e-98 < t Initial program 80.1%
*-commutative80.1%
associate-/l*87.4%
Applied egg-rr87.4%
Taylor expanded in y around 0 78.7%
if -5e11 < t < 4.39999999999999993e-98Initial program 61.1%
+-commutative61.1%
associate-/l*57.1%
fma-define57.2%
+-commutative57.2%
associate-/l*51.9%
fma-define51.9%
Simplified51.9%
Taylor expanded in z around 0 70.2%
+-commutative70.2%
times-frac58.5%
fma-define58.5%
associate-*r/53.6%
+-commutative53.6%
fma-define53.6%
associate-*r/53.6%
+-commutative53.6%
fma-define53.6%
Simplified53.6%
Taylor expanded in b around inf 69.1%
Final simplification74.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -31000000000000.0) (not (<= t 8.5e-56))) (/ x (+ 1.0 (+ a (/ (* y b) t)))) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -31000000000000.0) || !(t <= 8.5e-56)) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = (z + ((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 <= (-31000000000000.0d0)) .or. (.not. (t <= 8.5d-56))) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else
tmp = (z + ((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 <= -31000000000000.0) || !(t <= 8.5e-56)) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -31000000000000.0) or not (t <= 8.5e-56): tmp = x / (1.0 + (a + ((y * b) / t))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -31000000000000.0) || !(t <= 8.5e-56)) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -31000000000000.0) || ~((t <= 8.5e-56))) tmp = x / (1.0 + (a + ((y * b) / t))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -31000000000000.0], N[Not[LessEqual[t, 8.5e-56]], $MachinePrecision]], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -31000000000000 \lor \neg \left(t \leq 8.5 \cdot 10^{-56}\right):\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -3.1e13 or 8.49999999999999932e-56 < t Initial program 80.5%
+-commutative80.5%
associate-/l*88.4%
fma-define88.4%
+-commutative88.4%
associate-/l*92.0%
fma-define92.0%
Simplified92.0%
Taylor expanded in z around 0 69.0%
if -3.1e13 < t < 8.49999999999999932e-56Initial program 62.5%
+-commutative62.5%
associate-/l*58.2%
fma-define58.3%
+-commutative58.3%
associate-/l*51.9%
fma-define51.9%
Simplified51.9%
Taylor expanded in z around 0 71.5%
+-commutative71.5%
times-frac61.8%
fma-define61.8%
associate-*r/56.5%
+-commutative56.5%
fma-define56.5%
associate-*r/56.5%
+-commutative56.5%
fma-define56.5%
Simplified56.5%
Taylor expanded in b around inf 66.6%
Final simplification67.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -9000000000.0) (/ x (+ a 1.0)) (if (<= t 1.75e-47) (/ (+ z (/ (* x t) y)) b) (/ 1.0 (/ (+ a 1.0) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9000000000.0) {
tmp = x / (a + 1.0);
} else if (t <= 1.75e-47) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = 1.0 / ((a + 1.0) / x);
}
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 <= (-9000000000.0d0)) then
tmp = x / (a + 1.0d0)
else if (t <= 1.75d-47) then
tmp = (z + ((x * t) / y)) / b
else
tmp = 1.0d0 / ((a + 1.0d0) / x)
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 <= -9000000000.0) {
tmp = x / (a + 1.0);
} else if (t <= 1.75e-47) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = 1.0 / ((a + 1.0) / x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -9000000000.0: tmp = x / (a + 1.0) elif t <= 1.75e-47: tmp = (z + ((x * t) / y)) / b else: tmp = 1.0 / ((a + 1.0) / x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9000000000.0) tmp = Float64(x / Float64(a + 1.0)); elseif (t <= 1.75e-47) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); else tmp = Float64(1.0 / Float64(Float64(a + 1.0) / x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -9000000000.0) tmp = x / (a + 1.0); elseif (t <= 1.75e-47) tmp = (z + ((x * t) / y)) / b; else tmp = 1.0 / ((a + 1.0) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9000000000.0], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e-47], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9000000000:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-47}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a + 1}{x}}\\
\end{array}
\end{array}
if t < -9e9Initial program 80.5%
+-commutative80.5%
associate-/l*85.7%
fma-define85.7%
+-commutative85.7%
associate-/l*92.8%
fma-define92.8%
Simplified92.8%
Taylor expanded in y around 0 62.3%
if -9e9 < t < 1.7499999999999999e-47Initial program 63.1%
+-commutative63.1%
associate-/l*58.9%
fma-define58.9%
+-commutative58.9%
associate-/l*52.7%
fma-define52.7%
Simplified52.7%
Taylor expanded in z around 0 72.0%
+-commutative72.0%
times-frac62.4%
fma-define62.4%
associate-*r/57.2%
+-commutative57.2%
fma-define57.2%
associate-*r/57.2%
+-commutative57.2%
fma-define57.2%
Simplified57.2%
Taylor expanded in b around inf 66.4%
if 1.7499999999999999e-47 < t Initial program 80.1%
*-commutative80.1%
associate-/l*90.0%
Applied egg-rr90.0%
clear-num89.8%
inv-pow89.8%
+-commutative89.8%
*-commutative89.8%
associate-*r/92.4%
associate-+r+92.4%
+-commutative92.4%
associate-*r/89.8%
*-commutative89.8%
associate-/l*91.1%
fma-define91.1%
+-commutative91.1%
fma-define91.1%
Applied egg-rr91.1%
unpow-191.1%
Simplified91.1%
Taylor expanded in y around 0 65.9%
Final simplification65.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -29000000000000.0) (/ x (+ a 1.0)) (if (<= t 4e-49) (/ z b) (/ 1.0 (/ (+ a 1.0) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -29000000000000.0) {
tmp = x / (a + 1.0);
} else if (t <= 4e-49) {
tmp = z / b;
} else {
tmp = 1.0 / ((a + 1.0) / x);
}
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 <= (-29000000000000.0d0)) then
tmp = x / (a + 1.0d0)
else if (t <= 4d-49) then
tmp = z / b
else
tmp = 1.0d0 / ((a + 1.0d0) / x)
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 <= -29000000000000.0) {
tmp = x / (a + 1.0);
} else if (t <= 4e-49) {
tmp = z / b;
} else {
tmp = 1.0 / ((a + 1.0) / x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -29000000000000.0: tmp = x / (a + 1.0) elif t <= 4e-49: tmp = z / b else: tmp = 1.0 / ((a + 1.0) / x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -29000000000000.0) tmp = Float64(x / Float64(a + 1.0)); elseif (t <= 4e-49) tmp = Float64(z / b); else tmp = Float64(1.0 / Float64(Float64(a + 1.0) / x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -29000000000000.0) tmp = x / (a + 1.0); elseif (t <= 4e-49) tmp = z / b; else tmp = 1.0 / ((a + 1.0) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -29000000000000.0], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e-49], N[(z / b), $MachinePrecision], N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -29000000000000:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-49}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a + 1}{x}}\\
\end{array}
\end{array}
if t < -2.9e13Initial program 80.5%
+-commutative80.5%
associate-/l*85.7%
fma-define85.7%
+-commutative85.7%
associate-/l*92.8%
fma-define92.8%
Simplified92.8%
Taylor expanded in y around 0 62.3%
if -2.9e13 < t < 3.99999999999999975e-49Initial program 63.1%
+-commutative63.1%
associate-/l*58.9%
fma-define58.9%
+-commutative58.9%
associate-/l*52.7%
fma-define52.7%
Simplified52.7%
Taylor expanded in y around inf 57.4%
if 3.99999999999999975e-49 < t Initial program 80.1%
*-commutative80.1%
associate-/l*90.0%
Applied egg-rr90.0%
clear-num89.8%
inv-pow89.8%
+-commutative89.8%
*-commutative89.8%
associate-*r/92.4%
associate-+r+92.4%
+-commutative92.4%
associate-*r/89.8%
*-commutative89.8%
associate-/l*91.1%
fma-define91.1%
+-commutative91.1%
fma-define91.1%
Applied egg-rr91.1%
unpow-191.1%
Simplified91.1%
Taylor expanded in y around 0 65.9%
Final simplification61.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -210000000000.0) (not (<= t 9e-49))) (/ x (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -210000000000.0) || !(t <= 9e-49)) {
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 <= (-210000000000.0d0)) .or. (.not. (t <= 9d-49))) 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 <= -210000000000.0) || !(t <= 9e-49)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -210000000000.0) or not (t <= 9e-49): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -210000000000.0) || !(t <= 9e-49)) 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 <= -210000000000.0) || ~((t <= 9e-49))) 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, -210000000000.0], N[Not[LessEqual[t, 9e-49]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -210000000000 \lor \neg \left(t \leq 9 \cdot 10^{-49}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -2.1e11 or 9.0000000000000004e-49 < t Initial program 80.2%
+-commutative80.2%
associate-/l*88.3%
fma-define88.3%
+-commutative88.3%
associate-/l*91.9%
fma-define91.9%
Simplified91.9%
Taylor expanded in y around 0 64.0%
if -2.1e11 < t < 9.0000000000000004e-49Initial program 63.1%
+-commutative63.1%
associate-/l*58.9%
fma-define58.9%
+-commutative58.9%
associate-/l*52.7%
fma-define52.7%
Simplified52.7%
Taylor expanded in y around inf 57.4%
Final simplification60.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -48000000000.0) (not (<= t 2.9e+23))) (/ x a) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -48000000000.0) || !(t <= 2.9e+23)) {
tmp = x / a;
} 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 <= (-48000000000.0d0)) .or. (.not. (t <= 2.9d+23))) then
tmp = x / a
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 <= -48000000000.0) || !(t <= 2.9e+23)) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -48000000000.0) or not (t <= 2.9e+23): tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -48000000000.0) || !(t <= 2.9e+23)) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -48000000000.0) || ~((t <= 2.9e+23))) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -48000000000.0], N[Not[LessEqual[t, 2.9e+23]], $MachinePrecision]], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -48000000000 \lor \neg \left(t \leq 2.9 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -4.8e10 or 2.90000000000000013e23 < t Initial program 79.7%
+-commutative79.7%
associate-/l*88.6%
fma-define88.6%
+-commutative88.6%
associate-/l*93.4%
fma-define93.4%
Simplified93.4%
Taylor expanded in z around 0 79.7%
+-commutative79.7%
times-frac89.5%
fma-define89.5%
associate-*r/92.7%
+-commutative92.7%
fma-define92.7%
associate-*r/95.1%
+-commutative95.1%
fma-define95.1%
Simplified95.1%
Taylor expanded in z around inf 76.8%
associate-/r*74.2%
associate-/l*75.9%
associate-/r*76.7%
associate-/l*80.7%
Simplified80.7%
Taylor expanded in a around inf 35.3%
Taylor expanded in z around 0 35.5%
if -4.8e10 < t < 2.90000000000000013e23Initial program 65.2%
+-commutative65.2%
associate-/l*61.4%
fma-define61.4%
+-commutative61.4%
associate-/l*55.1%
fma-define55.1%
Simplified55.1%
Taylor expanded in y around inf 55.2%
Final simplification45.9%
(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 72.0%
+-commutative72.0%
associate-/l*74.2%
fma-define74.2%
+-commutative74.2%
associate-/l*73.1%
fma-define73.1%
Simplified73.1%
Taylor expanded in z around 0 76.3%
+-commutative76.3%
times-frac76.3%
fma-define76.3%
associate-*r/75.3%
+-commutative75.3%
fma-define75.3%
associate-*r/76.4%
+-commutative76.4%
fma-define76.4%
Simplified76.4%
Taylor expanded in z around inf 75.5%
associate-/r*72.8%
associate-/l*73.5%
associate-/r*68.0%
associate-/l*67.3%
Simplified67.3%
Taylor expanded in a around inf 26.0%
Taylor expanded in z around 0 22.8%
(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 2024167
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1707385670788761/12500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 1518483551868623/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))