
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
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))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
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))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ y (pow (- b y) 2.0))) (t_2 (/ (- a t) (- y b))))
(if (<= z -4.4e+20)
(- t_2 (/ (- (fma a t_1 (* (/ y (- b y)) x))) z))
(if (<= z 9e-17)
(/ (- (* y x) (* (- a t) z)) (+ (* (- b y) z) y))
(- t_2 (/ (fma (- y) (/ x (- b y)) (* t_1 (- t a))) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y / pow((b - y), 2.0);
double t_2 = (a - t) / (y - b);
double tmp;
if (z <= -4.4e+20) {
tmp = t_2 - (-fma(a, t_1, ((y / (b - y)) * x)) / z);
} else if (z <= 9e-17) {
tmp = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y);
} else {
tmp = t_2 - (fma(-y, (x / (b - y)), (t_1 * (t - a))) / z);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y / (Float64(b - y) ^ 2.0)) t_2 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -4.4e+20) tmp = Float64(t_2 - Float64(Float64(-fma(a, t_1, Float64(Float64(y / Float64(b - y)) * x))) / z)); elseif (z <= 9e-17) tmp = Float64(Float64(Float64(y * x) - Float64(Float64(a - t) * z)) / Float64(Float64(Float64(b - y) * z) + y)); else tmp = Float64(t_2 - Float64(fma(Float64(-y), Float64(x / Float64(b - y)), Float64(t_1 * Float64(t - a))) / z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e+20], N[(t$95$2 - N[((-N[(a * t$95$1 + N[(N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-17], N[(N[(N[(y * x), $MachinePrecision] - N[(N[(a - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - N[(N[((-y) * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{{\left(b - y\right)}^{2}}\\
t_2 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+20}:\\
\;\;\;\;t\_2 - \frac{-\mathsf{fma}\left(a, t\_1, \frac{y}{b - y} \cdot x\right)}{z}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-17}:\\
\;\;\;\;\frac{y \cdot x - \left(a - t\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_2 - \frac{\mathsf{fma}\left(-y, \frac{x}{b - y}, t\_1 \cdot \left(t - a\right)\right)}{z}\\
\end{array}
\end{array}
if z < -4.4e20Initial program 37.3%
Taylor expanded in z around inf
Applied rewrites94.7%
Taylor expanded in t around 0
Applied rewrites97.2%
if -4.4e20 < z < 8.99999999999999957e-17Initial program 91.8%
if 8.99999999999999957e-17 < z Initial program 39.8%
Taylor expanded in z around inf
Applied rewrites93.5%
Final simplification93.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (* y x) (* (- a t) z)) (+ (* (- b y) z) y)))
(t_2 (- (/ (- a t) (- y b)) (/ (- (- x)) z))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -4e-256)
t_1
(if (<= t_1 0.0)
(-
(-
(/ a (- y b))
(/ (/ (- (/ (* (- t a) y) (- b y)) (* y x)) (- b y)) z))
(/ t (- y b)))
(if (<= t_1 1e+274) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y);
double t_2 = ((a - t) / (y - b)) - (-(-x) / z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -4e-256) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((a / (y - b)) - ((((((t - a) * y) / (b - y)) - (y * x)) / (b - y)) / z)) - (t / (y - b));
} else if (t_1 <= 1e+274) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y);
double t_2 = ((a - t) / (y - b)) - (-(-x) / z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -4e-256) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((a / (y - b)) - ((((((t - a) * y) / (b - y)) - (y * x)) / (b - y)) / z)) - (t / (y - b));
} else if (t_1 <= 1e+274) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y) t_2 = ((a - t) / (y - b)) - (-(-x) / z) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -4e-256: tmp = t_1 elif t_1 <= 0.0: tmp = ((a / (y - b)) - ((((((t - a) * y) / (b - y)) - (y * x)) / (b - y)) / z)) - (t / (y - b)) elif t_1 <= 1e+274: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * x) - Float64(Float64(a - t) * z)) / Float64(Float64(Float64(b - y) * z) + y)) t_2 = Float64(Float64(Float64(a - t) / Float64(y - b)) - Float64(Float64(-Float64(-x)) / z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -4e-256) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(a / Float64(y - b)) - Float64(Float64(Float64(Float64(Float64(Float64(t - a) * y) / Float64(b - y)) - Float64(y * x)) / Float64(b - y)) / z)) - Float64(t / Float64(y - b))); elseif (t_1 <= 1e+274) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y); t_2 = ((a - t) / (y - b)) - (-(-x) / z); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= -4e-256) tmp = t_1; elseif (t_1 <= 0.0) tmp = ((a / (y - b)) - ((((((t - a) * y) / (b - y)) - (y * x)) / (b - y)) / z)) - (t / (y - b)); elseif (t_1 <= 1e+274) 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[(N[(y * x), $MachinePrecision] - N[(N[(a - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision] - N[((-(-x)) / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -4e-256], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(N[(N[(t - a), $MachinePrecision] * y), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(t / N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+274], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot x - \left(a - t\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
t_2 := \frac{a - t}{y - b} - \frac{-\left(-x\right)}{z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-256}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(\frac{a}{y - b} - \frac{\frac{\frac{\left(t - a\right) \cdot y}{b - y} - y \cdot x}{b - y}}{z}\right) - \frac{t}{y - b}\\
\mathbf{elif}\;t\_1 \leq 10^{+274}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 9.99999999999999921e273 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 13.9%
Taylor expanded in z around inf
Applied rewrites83.3%
Taylor expanded in t around 0
Applied rewrites84.4%
Taylor expanded in y around inf
Applied rewrites82.3%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999991e-256 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.99999999999999921e273Initial program 99.5%
if -3.99999999999999991e-256 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 32.0%
Taylor expanded in z around inf
Applied rewrites88.6%
Applied rewrites92.2%
Final simplification92.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(-
(/ (- a t) (- y b))
(/ (- (fma a (/ y (pow (- b y) 2.0)) (* (/ y (- b y)) x))) z))))
(if (<= z -4.4e+20)
t_1
(if (<= z 1.25e+105)
(/ (- (* y x) (* (- a t) z)) (+ (* (- b y) z) y))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a - t) / (y - b)) - (-fma(a, (y / pow((b - y), 2.0)), ((y / (b - y)) * x)) / z);
double tmp;
if (z <= -4.4e+20) {
tmp = t_1;
} else if (z <= 1.25e+105) {
tmp = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a - t) / Float64(y - b)) - Float64(Float64(-fma(a, Float64(y / (Float64(b - y) ^ 2.0)), Float64(Float64(y / Float64(b - y)) * x))) / z)) tmp = 0.0 if (z <= -4.4e+20) tmp = t_1; elseif (z <= 1.25e+105) tmp = Float64(Float64(Float64(y * x) - Float64(Float64(a - t) * z)) / Float64(Float64(Float64(b - y) * z) + y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision] - N[((-N[(a * N[(y / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]) / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e+20], t$95$1, If[LessEqual[z, 1.25e+105], N[(N[(N[(y * x), $MachinePrecision] - N[(N[(a - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b} - \frac{-\mathsf{fma}\left(a, \frac{y}{{\left(b - y\right)}^{2}}, \frac{y}{b - y} \cdot x\right)}{z}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+105}:\\
\;\;\;\;\frac{y \cdot x - \left(a - t\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.4e20 or 1.25000000000000011e105 < z Initial program 31.5%
Taylor expanded in z around inf
Applied rewrites95.9%
Taylor expanded in t around 0
Applied rewrites98.3%
if -4.4e20 < z < 1.25000000000000011e105Initial program 89.6%
Final simplification93.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* (- t a) z) (+ (* (- b y) z) y))) (t_2 (/ (- a t) (- y b))))
(if (<= z -5.5e+17)
t_2
(if (<= z -1e-98)
t_1
(if (<= z 8.5e-201)
(/ (fma (- t a) z (* y x)) (* 1.0 y))
(if (<= z 1000000000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - a) * z) / (((b - y) * z) + y);
double t_2 = (a - t) / (y - b);
double tmp;
if (z <= -5.5e+17) {
tmp = t_2;
} else if (z <= -1e-98) {
tmp = t_1;
} else if (z <= 8.5e-201) {
tmp = fma((t - a), z, (y * x)) / (1.0 * y);
} else if (z <= 1000000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - a) * z) / Float64(Float64(Float64(b - y) * z) + y)) t_2 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -5.5e+17) tmp = t_2; elseif (z <= -1e-98) tmp = t_1; elseif (z <= 8.5e-201) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) / Float64(1.0 * y)); elseif (z <= 1000000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+17], t$95$2, If[LessEqual[z, -1e-98], t$95$1, If[LessEqual[z, 8.5e-201], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1000000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(t - a\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
t_2 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-201}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{1 \cdot y}\\
\mathbf{elif}\;z \leq 1000000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -5.5e17 or 1e12 < z Initial program 37.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.8
Applied rewrites83.8%
if -5.5e17 < z < -9.99999999999999939e-99 or 8.5000000000000007e-201 < z < 1e12Initial program 88.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6461.6
Applied rewrites61.6%
if -9.99999999999999939e-99 < z < 8.5000000000000007e-201Initial program 91.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-rgt-identityN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
distribute-lft-inN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6476.1
Applied rewrites76.1%
Taylor expanded in z around 0
Applied rewrites76.1%
Final simplification76.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -2.5e+50)
t_1
(if (<= z 2.3e+71)
(/ (- (* y x) (* (- a t) z)) (+ (* (- b y) z) y))
(- t_1 (/ (- (- x)) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -2.5e+50) {
tmp = t_1;
} else if (z <= 2.3e+71) {
tmp = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y);
} else {
tmp = t_1 - (-(-x) / z);
}
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 = (a - t) / (y - b)
if (z <= (-2.5d+50)) then
tmp = t_1
else if (z <= 2.3d+71) then
tmp = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y)
else
tmp = t_1 - (-(-x) / z)
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 = (a - t) / (y - b);
double tmp;
if (z <= -2.5e+50) {
tmp = t_1;
} else if (z <= 2.3e+71) {
tmp = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y);
} else {
tmp = t_1 - (-(-x) / z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - t) / (y - b) tmp = 0 if z <= -2.5e+50: tmp = t_1 elif z <= 2.3e+71: tmp = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y) else: tmp = t_1 - (-(-x) / z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -2.5e+50) tmp = t_1; elseif (z <= 2.3e+71) tmp = Float64(Float64(Float64(y * x) - Float64(Float64(a - t) * z)) / Float64(Float64(Float64(b - y) * z) + y)); else tmp = Float64(t_1 - Float64(Float64(-Float64(-x)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - t) / (y - b); tmp = 0.0; if (z <= -2.5e+50) tmp = t_1; elseif (z <= 2.3e+71) tmp = ((y * x) - ((a - t) * z)) / (((b - y) * z) + y); else tmp = t_1 - (-(-x) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+50], t$95$1, If[LessEqual[z, 2.3e+71], N[(N[(N[(y * x), $MachinePrecision] - N[(N[(a - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(b - y), $MachinePrecision] * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[((-(-x)) / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+71}:\\
\;\;\;\;\frac{y \cdot x - \left(a - t\right) \cdot z}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \frac{-\left(-x\right)}{z}\\
\end{array}
\end{array}
if z < -2.5e50Initial program 30.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6489.4
Applied rewrites89.4%
if -2.5e50 < z < 2.3000000000000002e71Initial program 89.3%
if 2.3000000000000002e71 < z Initial program 28.0%
Taylor expanded in z around inf
Applied rewrites96.2%
Taylor expanded in t around 0
Applied rewrites98.0%
Taylor expanded in y around inf
Applied rewrites88.9%
Final simplification89.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -3.2e+33)
t_1
(if (<= z 9e-17)
(/ (fma (- z) a (* y x)) (fma (- b y) z y))
(- t_1 (/ (- (- x)) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -3.2e+33) {
tmp = t_1;
} else if (z <= 9e-17) {
tmp = fma(-z, a, (y * x)) / fma((b - y), z, y);
} else {
tmp = t_1 - (-(-x) / z);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -3.2e+33) tmp = t_1; elseif (z <= 9e-17) tmp = Float64(fma(Float64(-z), a, Float64(y * x)) / fma(Float64(b - y), z, y)); else tmp = Float64(t_1 - Float64(Float64(-Float64(-x)) / z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+33], t$95$1, If[LessEqual[z, 9e-17], N[(N[((-z) * a + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[((-(-x)) / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-17}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-z, a, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \frac{-\left(-x\right)}{z}\\
\end{array}
\end{array}
if z < -3.20000000000000017e33Initial program 36.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6487.7
Applied rewrites87.7%
if -3.20000000000000017e33 < z < 8.99999999999999957e-17Initial program 91.2%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6471.9
Applied rewrites71.9%
if 8.99999999999999957e-17 < z Initial program 39.8%
Taylor expanded in z around inf
Applied rewrites93.5%
Taylor expanded in t around 0
Applied rewrites91.6%
Taylor expanded in y around inf
Applied rewrites82.7%
Final simplification79.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -3.5e-44)
t_1
(if (<= z 5e-194)
(/ (fma (- t a) z (* y x)) (* 1.0 y))
(if (<= z 3e+16) (* (/ z (fma (- b y) z y)) (- t a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -3.5e-44) {
tmp = t_1;
} else if (z <= 5e-194) {
tmp = fma((t - a), z, (y * x)) / (1.0 * y);
} else if (z <= 3e+16) {
tmp = (z / fma((b - y), z, y)) * (t - a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -3.5e-44) tmp = t_1; elseif (z <= 5e-194) tmp = Float64(fma(Float64(t - a), z, Float64(y * x)) / Float64(1.0 * y)); elseif (z <= 3e+16) tmp = Float64(Float64(z / fma(Float64(b - y), z, y)) * Float64(t - a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e-44], t$95$1, If[LessEqual[z, 5e-194], N[(N[(N[(t - a), $MachinePrecision] * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+16], N[(N[(z / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-194}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - a, z, y \cdot x\right)}{1 \cdot y}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+16}:\\
\;\;\;\;\frac{z}{\mathsf{fma}\left(b - y, z, y\right)} \cdot \left(t - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.4999999999999998e-44 or 3e16 < z Initial program 40.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6482.0
Applied rewrites82.0%
if -3.4999999999999998e-44 < z < 5.0000000000000002e-194Initial program 89.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-rgt-identityN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
distribute-lft-inN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6467.0
Applied rewrites67.0%
Taylor expanded in z around 0
Applied rewrites67.0%
if 5.0000000000000002e-194 < z < 3e16Initial program 89.0%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6459.4
Applied rewrites59.4%
Final simplification73.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- a t) (- y b))))
(if (<= z -1.55e-44)
t_2
(if (<= z 5e-194)
(* (/ y t_1) x)
(if (<= z 3e+16) (* (/ z t_1) (- t a)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b - y), z, y);
double t_2 = (a - t) / (y - b);
double tmp;
if (z <= -1.55e-44) {
tmp = t_2;
} else if (z <= 5e-194) {
tmp = (y / t_1) * x;
} else if (z <= 3e+16) {
tmp = (z / t_1) * (t - a);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -1.55e-44) tmp = t_2; elseif (z <= 5e-194) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 3e+16) tmp = Float64(Float64(z / t_1) * Float64(t - a)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e-44], t$95$2, If[LessEqual[z, 5e-194], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 3e+16], N[(N[(z / t$95$1), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{-44}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-194}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+16}:\\
\;\;\;\;\frac{z}{t\_1} \cdot \left(t - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.54999999999999992e-44 or 3e16 < z Initial program 40.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6482.0
Applied rewrites82.0%
if -1.54999999999999992e-44 < z < 5.0000000000000002e-194Initial program 89.5%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6459.8
Applied rewrites59.8%
if 5.0000000000000002e-194 < z < 3e16Initial program 89.0%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6459.4
Applied rewrites59.4%
Final simplification71.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -3.2e+33)
t_1
(if (<= z 7.8e-22) (/ (fma (- z) a (* y x)) (fma (- b y) z y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -3.2e+33) {
tmp = t_1;
} else if (z <= 7.8e-22) {
tmp = fma(-z, a, (y * x)) / fma((b - y), z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -3.2e+33) tmp = t_1; elseif (z <= 7.8e-22) tmp = Float64(fma(Float64(-z), a, Float64(y * x)) / fma(Float64(b - y), z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+33], t$95$1, If[LessEqual[z, 7.8e-22], N[(N[((-z) * a + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-22}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-z, a, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.20000000000000017e33 or 7.79999999999999996e-22 < z Initial program 38.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6482.7
Applied rewrites82.7%
if -3.20000000000000017e33 < z < 7.79999999999999996e-22Initial program 91.0%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6473.0
Applied rewrites73.0%
Final simplification78.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -4.8e+43)
t_1
(if (<= z 1.85e+71) (/ (fma t z (* y x)) (fma (- b y) z y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -4.8e+43) {
tmp = t_1;
} else if (z <= 1.85e+71) {
tmp = fma(t, z, (y * x)) / fma((b - y), z, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -4.8e+43) tmp = t_1; elseif (z <= 1.85e+71) tmp = Float64(fma(t, z, Float64(y * x)) / fma(Float64(b - y), z, y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+43], t$95$1, If[LessEqual[z, 1.85e+71], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+71}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.80000000000000046e43 or 1.85e71 < z Initial program 31.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6487.0
Applied rewrites87.0%
if -4.80000000000000046e43 < z < 1.85e71Initial program 89.6%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6463.5
Applied rewrites63.5%
Final simplification74.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) (- y b))))
(if (<= z -1.55e-44)
t_1
(if (<= z 1.05e-86) (* (/ y (fma (- b y) z y)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -1.55e-44) {
tmp = t_1;
} else if (z <= 1.05e-86) {
tmp = (y / fma((b - y), z, y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -1.55e-44) tmp = t_1; elseif (z <= 1.05e-86) tmp = Float64(Float64(y / fma(Float64(b - y), z, y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e-44], t$95$1, If[LessEqual[z, 1.05e-86], N[(N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-86}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.54999999999999992e-44 or 1.05e-86 < z Initial program 46.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.0
Applied rewrites77.0%
if -1.54999999999999992e-44 < z < 1.05e-86Initial program 90.9%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6456.9
Applied rewrites56.9%
Final simplification69.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- a t) (- y b)))) (if (<= z -2.3e-101) t_1 (if (<= z 3.15e-193) (fma z x x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / (y - b);
double tmp;
if (z <= -2.3e-101) {
tmp = t_1;
} else if (z <= 3.15e-193) {
tmp = fma(z, x, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / Float64(y - b)) tmp = 0.0 if (z <= -2.3e-101) tmp = t_1; elseif (z <= 3.15e-193) tmp = fma(z, x, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e-101], t$95$1, If[LessEqual[z, 3.15e-193], N[(z * x + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y - b}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-193}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.2999999999999999e-101 or 3.1499999999999999e-193 < z Initial program 54.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6469.3
Applied rewrites69.3%
if -2.2999999999999999e-101 < z < 3.1499999999999999e-193Initial program 90.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6457.4
Applied rewrites57.4%
Taylor expanded in z around 0
Applied rewrites57.4%
Final simplification66.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -1.95e+89) t_1 (if (<= y 3.15e-24) (/ (- t a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.95e+89) {
tmp = t_1;
} else if (y <= 3.15e-24) {
tmp = (t - a) / 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 / (1.0d0 - z)
if (y <= (-1.95d+89)) then
tmp = t_1
else if (y <= 3.15d-24) then
tmp = (t - a) / 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 / (1.0 - z);
double tmp;
if (y <= -1.95e+89) {
tmp = t_1;
} else if (y <= 3.15e-24) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -1.95e+89: tmp = t_1 elif y <= 3.15e-24: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -1.95e+89) tmp = t_1; elseif (y <= 3.15e-24) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -1.95e+89) tmp = t_1; elseif (y <= 3.15e-24) tmp = (t - a) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.95e+89], t$95$1, If[LessEqual[y, 3.15e-24], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.15 \cdot 10^{-24}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.95000000000000005e89 or 3.1499999999999999e-24 < y Initial program 47.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6448.8
Applied rewrites48.8%
if -1.95000000000000005e89 < y < 3.1499999999999999e-24Initial program 74.2%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6458.5
Applied rewrites58.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -4.2e-77) t_1 (if (<= y 2.9e-24) (/ (- a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -4.2e-77) {
tmp = t_1;
} else if (y <= 2.9e-24) {
tmp = -a / 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 / (1.0d0 - z)
if (y <= (-4.2d-77)) then
tmp = t_1
else if (y <= 2.9d-24) then
tmp = -a / 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 / (1.0 - z);
double tmp;
if (y <= -4.2e-77) {
tmp = t_1;
} else if (y <= 2.9e-24) {
tmp = -a / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -4.2e-77: tmp = t_1 elif y <= 2.9e-24: tmp = -a / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -4.2e-77) tmp = t_1; elseif (y <= 2.9e-24) tmp = Float64(Float64(-a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -4.2e-77) tmp = t_1; elseif (y <= 2.9e-24) tmp = -a / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.2e-77], t$95$1, If[LessEqual[y, 2.9e-24], N[((-a) / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-24}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.20000000000000031e-77 or 2.8999999999999999e-24 < y Initial program 53.5%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6444.6
Applied rewrites44.6%
if -4.20000000000000031e-77 < y < 2.8999999999999999e-24Initial program 74.5%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6449.7
Applied rewrites49.7%
Taylor expanded in y around 0
Applied rewrites40.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.25e-74) (/ x 1.0) (if (<= y 7.5e-25) (/ (- a) b) (/ x 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.25e-74) {
tmp = x / 1.0;
} else if (y <= 7.5e-25) {
tmp = -a / b;
} else {
tmp = x / 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 (y <= (-1.25d-74)) then
tmp = x / 1.0d0
else if (y <= 7.5d-25) then
tmp = -a / b
else
tmp = x / 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 (y <= -1.25e-74) {
tmp = x / 1.0;
} else if (y <= 7.5e-25) {
tmp = -a / b;
} else {
tmp = x / 1.0;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.25e-74: tmp = x / 1.0 elif y <= 7.5e-25: tmp = -a / b else: tmp = x / 1.0 return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.25e-74) tmp = Float64(x / 1.0); elseif (y <= 7.5e-25) tmp = Float64(Float64(-a) / b); else tmp = Float64(x / 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.25e-74) tmp = x / 1.0; elseif (y <= 7.5e-25) tmp = -a / b; else tmp = x / 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.25e-74], N[(x / 1.0), $MachinePrecision], If[LessEqual[y, 7.5e-25], N[((-a) / b), $MachinePrecision], N[(x / 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{1}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-25}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1}\\
\end{array}
\end{array}
if y < -1.25e-74 or 7.49999999999999989e-25 < y Initial program 53.5%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6444.6
Applied rewrites44.6%
Taylor expanded in z around 0
Applied rewrites30.3%
if -1.25e-74 < y < 7.49999999999999989e-25Initial program 74.5%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6449.7
Applied rewrites49.7%
Taylor expanded in y around 0
Applied rewrites40.4%
(FPCore (x y z t a b) :precision binary64 (fma (fma x z x) z x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(fma(x, z, x), z, x);
}
function code(x, y, z, t, a, b) return fma(fma(x, z, x), z, x) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * z + x), $MachinePrecision] * z + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(x, z, x\right), z, x\right)
\end{array}
Initial program 62.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6429.1
Applied rewrites29.1%
Taylor expanded in z around 0
Applied rewrites20.4%
Taylor expanded in z around inf
Applied rewrites3.0%
Taylor expanded in z around 0
Applied rewrites20.8%
(FPCore (x y z t a b) :precision binary64 (/ x 1.0))
double code(double x, double y, double z, double t, double a, double b) {
return x / 1.0;
}
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 / 1.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / 1.0;
}
def code(x, y, z, t, a, b): return x / 1.0
function code(x, y, z, t, a, b) return Float64(x / 1.0) end
function tmp = code(x, y, z, t, a, b) tmp = x / 1.0; end
code[x_, y_, z_, t_, a_, b_] := N[(x / 1.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{1}
\end{array}
Initial program 62.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6429.1
Applied rewrites29.1%
Taylor expanded in z around 0
Applied rewrites20.7%
(FPCore (x y z t a b) :precision binary64 (fma z x x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(z, x, x);
}
function code(x, y, z, t, a, b) return fma(z, x, x) end
code[x_, y_, z_, t_, a_, b_] := N[(z * x + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, x, x\right)
\end{array}
Initial program 62.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6429.1
Applied rewrites29.1%
Taylor expanded in z around 0
Applied rewrites20.4%
(FPCore (x y z t a b) :precision binary64 (* x z))
double code(double x, double y, double z, double t, double a, double b) {
return x * z;
}
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 * z
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * z;
}
def code(x, y, z, t, a, b): return x * z
function code(x, y, z, t, a, b) return Float64(x * z) end
function tmp = code(x, y, z, t, a, b) tmp = x * z; end
code[x_, y_, z_, t_, a_, b_] := N[(x * z), $MachinePrecision]
\begin{array}{l}
\\
x \cdot z
\end{array}
Initial program 62.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6429.1
Applied rewrites29.1%
Taylor expanded in z around 0
Applied rewrites20.4%
Taylor expanded in z around inf
Applied rewrites3.0%
Final simplification3.0%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
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 = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2024332
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))