
(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 16 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
(-
(/ (- t a) (- b y))
(/
(fma (- y) (/ x (- b y)) (* (/ y (pow (- b y) 2.0)) (- t a)))
z))))
(if (<= z -8.8e+15)
t_1
(if (<= z 2500000000.0)
(/ (fma y x (* (- t a) z)) (+ (* (- b y) z) y))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - a) / (b - y)) - (fma(-y, (x / (b - y)), ((y / pow((b - y), 2.0)) * (t - a))) / z);
double tmp;
if (z <= -8.8e+15) {
tmp = t_1;
} else if (z <= 2500000000.0) {
tmp = fma(y, x, ((t - a) * z)) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - a) / Float64(b - y)) - Float64(fma(Float64(-y), Float64(x / Float64(b - y)), Float64(Float64(y / (Float64(b - y) ^ 2.0)) * Float64(t - a))) / z)) tmp = 0.0 if (z <= -8.8e+15) tmp = t_1; elseif (z <= 2500000000.0) tmp = Float64(fma(y, x, Float64(Float64(t - a) * 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(N[((-y) * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(y / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e+15], t$95$1, If[LessEqual[z, 2500000000.0], N[(N[(y * x + N[(N[(t - a), $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{t - a}{b - y} - \frac{\mathsf{fma}\left(-y, \frac{x}{b - y}, \frac{y}{{\left(b - y\right)}^{2}} \cdot \left(t - a\right)\right)}{z}\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2500000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.8e15 or 2.5e9 < z Initial program 40.6%
Taylor expanded in z around inf
Applied rewrites94.3%
if -8.8e15 < z < 2.5e9Initial program 93.2%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6493.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.3
Applied rewrites93.3%
Final simplification93.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -62000000000.0)
t_2
(if (<= z -1.5e-207)
(/ (* (- t a) z) t_1)
(if (<= z 3.2e-177)
(* (/ y t_1) x)
(if (<= z 15000000000.0) (* (/ 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 = (t - a) / (b - y);
double tmp;
if (z <= -62000000000.0) {
tmp = t_2;
} else if (z <= -1.5e-207) {
tmp = ((t - a) * z) / t_1;
} else if (z <= 3.2e-177) {
tmp = (y / t_1) * x;
} else if (z <= 15000000000.0) {
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(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -62000000000.0) tmp = t_2; elseif (z <= -1.5e-207) tmp = Float64(Float64(Float64(t - a) * z) / t_1); elseif (z <= 3.2e-177) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 15000000000.0) 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -62000000000.0], t$95$2, If[LessEqual[z, -1.5e-207], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 3.2e-177], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 15000000000.0], 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{t - a}{b - y}\\
\mathbf{if}\;z \leq -62000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-207}:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{t\_1}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-177}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 15000000000:\\
\;\;\;\;\frac{z}{t\_1} \cdot \left(t - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -6.2e10 or 1.5e10 < z Initial program 40.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.9
Applied rewrites83.9%
if -6.2e10 < z < -1.5e-207Initial program 92.2%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6492.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.3
Applied rewrites92.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6468.3
Applied rewrites68.3%
if -1.5e-207 < z < 3.1999999999999998e-177Initial program 94.3%
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--.f6473.5
Applied rewrites73.5%
if 3.1999999999999998e-177 < z < 1.5e10Initial program 93.1%
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--.f6476.5
Applied rewrites76.5%
Final simplification78.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -4e+22)
t_2
(if (<= z -1.7e-168)
(* (/ (- t a) t_1) z)
(if (<= z 3.2e-177)
(* (/ y t_1) x)
(if (<= z 15000000000.0) (* (/ 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 = (t - a) / (b - y);
double tmp;
if (z <= -4e+22) {
tmp = t_2;
} else if (z <= -1.7e-168) {
tmp = ((t - a) / t_1) * z;
} else if (z <= 3.2e-177) {
tmp = (y / t_1) * x;
} else if (z <= 15000000000.0) {
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(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4e+22) tmp = t_2; elseif (z <= -1.7e-168) tmp = Float64(Float64(Float64(t - a) / t_1) * z); elseif (z <= 3.2e-177) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 15000000000.0) 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+22], t$95$2, If[LessEqual[z, -1.7e-168], N[(N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 3.2e-177], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 15000000000.0], 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{t - a}{b - y}\\
\mathbf{if}\;z \leq -4 \cdot 10^{+22}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-168}:\\
\;\;\;\;\frac{t - a}{t\_1} \cdot z\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-177}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 15000000000:\\
\;\;\;\;\frac{z}{t\_1} \cdot \left(t - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4e22 or 1.5e10 < z Initial program 40.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.7
Applied rewrites83.7%
if -4e22 < z < -1.70000000000000011e-168Initial program 91.7%
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--.f6468.0
Applied rewrites68.0%
Applied rewrites70.3%
if -1.70000000000000011e-168 < z < 3.1999999999999998e-177Initial program 93.1%
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--.f6470.7
Applied rewrites70.7%
if 3.1999999999999998e-177 < z < 1.5e10Initial program 93.1%
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--.f6476.5
Applied rewrites76.5%
Final simplification77.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y))
(t_2 (* (/ (- t a) t_1) z))
(t_3 (/ (- t a) (- b y))))
(if (<= z -4e+22)
t_3
(if (<= z -1.7e-168)
t_2
(if (<= z 7.5e-177) (* (/ y t_1) x) (if (<= z 2.4e+19) t_2 t_3))))))
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 = ((t - a) / t_1) * z;
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -4e+22) {
tmp = t_3;
} else if (z <= -1.7e-168) {
tmp = t_2;
} else if (z <= 7.5e-177) {
tmp = (y / t_1) * x;
} else if (z <= 2.4e+19) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(b - y), z, y) t_2 = Float64(Float64(Float64(t - a) / t_1) * z) t_3 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4e+22) tmp = t_3; elseif (z <= -1.7e-168) tmp = t_2; elseif (z <= 7.5e-177) tmp = Float64(Float64(y / t_1) * x); elseif (z <= 2.4e+19) tmp = t_2; else tmp = t_3; 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[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+22], t$95$3, If[LessEqual[z, -1.7e-168], t$95$2, If[LessEqual[z, 7.5e-177], N[(N[(y / t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 2.4e+19], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{t - a}{t\_1} \cdot z\\
t_3 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4 \cdot 10^{+22}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-168}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-177}:\\
\;\;\;\;\frac{y}{t\_1} \cdot x\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -4e22 or 2.4e19 < z Initial program 40.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.9
Applied rewrites83.9%
if -4e22 < z < -1.70000000000000011e-168 or 7.5e-177 < z < 2.4e19Initial program 90.3%
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--.f6471.4
Applied rewrites71.4%
Applied rewrites71.8%
if -1.70000000000000011e-168 < z < 7.5e-177Initial program 93.1%
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--.f6470.7
Applied rewrites70.7%
Final simplification77.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -6.6e+16)
t_1
(if (<= z 6.2e+71) (/ (fma y x (* (- t a) z)) (+ (* (- b y) z) y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -6.6e+16) {
tmp = t_1;
} else if (z <= 6.2e+71) {
tmp = fma(y, x, ((t - a) * z)) / (((b - y) * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -6.6e+16) tmp = t_1; elseif (z <= 6.2e+71) tmp = Float64(fma(y, x, Float64(Float64(t - a) * 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+16], t$95$1, If[LessEqual[z, 6.2e+71], N[(N[(y * x + N[(N[(t - a), $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{t - a}{b - y}\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+71}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{\left(b - y\right) \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.6e16 or 6.20000000000000036e71 < z Initial program 35.5%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.7
Applied rewrites84.7%
if -6.6e16 < z < 6.20000000000000036e71Initial program 92.5%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6492.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.5
Applied rewrites92.5%
Final simplification89.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- b y) z y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -36.0)
t_2
(if (<= z 1.18e-173)
(/ (fma t z (* y x)) t_1)
(if (<= z 15000000000.0) (* (/ 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 = (t - a) / (b - y);
double tmp;
if (z <= -36.0) {
tmp = t_2;
} else if (z <= 1.18e-173) {
tmp = fma(t, z, (y * x)) / t_1;
} else if (z <= 15000000000.0) {
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(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -36.0) tmp = t_2; elseif (z <= 1.18e-173) tmp = Float64(fma(t, z, Float64(y * x)) / t_1); elseif (z <= 15000000000.0) 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -36.0], t$95$2, If[LessEqual[z, 1.18e-173], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 15000000000.0], 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{t - a}{b - y}\\
\mathbf{if}\;z \leq -36:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-173}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{t\_1}\\
\mathbf{elif}\;z \leq 15000000000:\\
\;\;\;\;\frac{z}{t\_1} \cdot \left(t - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -36 or 1.5e10 < z Initial program 41.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.2
Applied rewrites84.2%
if -36 < z < 1.1800000000000001e-173Initial program 93.1%
Taylor expanded in a around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6472.2
Applied rewrites72.2%
if 1.1800000000000001e-173 < z < 1.5e10Initial program 93.1%
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--.f6476.5
Applied rewrites76.5%
Final simplification78.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -3700000000.0)
t_1
(if (<= z 9000.0) (/ (fma y x (* (- t a) z)) (+ (* b z) y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -3700000000.0) {
tmp = t_1;
} else if (z <= 9000.0) {
tmp = fma(y, x, ((t - a) * z)) / ((b * z) + y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -3700000000.0) tmp = t_1; elseif (z <= 9000.0) tmp = Float64(fma(y, x, Float64(Float64(t - a) * z)) / Float64(Float64(b * z) + y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3700000000.0], t$95$1, If[LessEqual[z, 9000.0], N[(N[(y * x + N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(N[(b * z), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3700000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9000:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, \left(t - a\right) \cdot z\right)}{b \cdot z + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.7e9 or 9e3 < z Initial program 40.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.9
Applied rewrites83.9%
if -3.7e9 < z < 9e3Initial program 93.2%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6493.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.3
Applied rewrites93.3%
Taylor expanded in b around inf
lower-*.f6492.1
Applied rewrites92.1%
Final simplification88.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4.9e-63)
t_1
(if (<= z 4.4e-135) (* (/ 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 = (t - a) / (b - y);
double tmp;
if (z <= -4.9e-63) {
tmp = t_1;
} else if (z <= 4.4e-135) {
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(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.9e-63) tmp = t_1; elseif (z <= 4.4e-135) 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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e-63], t$95$1, If[LessEqual[z, 4.4e-135], 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{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-135}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(b - y, z, y\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.90000000000000015e-63 or 4.3999999999999999e-135 < z Initial program 54.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6476.6
Applied rewrites76.6%
if -4.90000000000000015e-63 < z < 4.3999999999999999e-135Initial program 92.1%
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.0
Applied rewrites59.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -5.7e-75)
t_1
(if (<= z -2.65e-207)
(/ (* (- t a) z) y)
(if (<= z 1.8e-135) (* 1.0 x) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -5.7e-75) {
tmp = t_1;
} else if (z <= -2.65e-207) {
tmp = ((t - a) * z) / y;
} else if (z <= 1.8e-135) {
tmp = 1.0 * x;
} 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 = (t - a) / (b - y)
if (z <= (-5.7d-75)) then
tmp = t_1
else if (z <= (-2.65d-207)) then
tmp = ((t - a) * z) / y
else if (z <= 1.8d-135) then
tmp = 1.0d0 * x
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 = (t - a) / (b - y);
double tmp;
if (z <= -5.7e-75) {
tmp = t_1;
} else if (z <= -2.65e-207) {
tmp = ((t - a) * z) / y;
} else if (z <= 1.8e-135) {
tmp = 1.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -5.7e-75: tmp = t_1 elif z <= -2.65e-207: tmp = ((t - a) * z) / y elif z <= 1.8e-135: tmp = 1.0 * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -5.7e-75) tmp = t_1; elseif (z <= -2.65e-207) tmp = Float64(Float64(Float64(t - a) * z) / y); elseif (z <= 1.8e-135) tmp = Float64(1.0 * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -5.7e-75) tmp = t_1; elseif (z <= -2.65e-207) tmp = ((t - a) * z) / y; elseif (z <= 1.8e-135) tmp = 1.0 * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.7e-75], t$95$1, If[LessEqual[z, -2.65e-207], N[(N[(N[(t - a), $MachinePrecision] * z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.8e-135], N[(1.0 * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -5.7 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.65 \cdot 10^{-207}:\\
\;\;\;\;\frac{\left(t - a\right) \cdot z}{y}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-135}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.69999999999999966e-75 or 1.79999999999999989e-135 < z Initial program 55.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6475.6
Applied rewrites75.6%
if -5.69999999999999966e-75 < z < -2.65e-207Initial program 91.6%
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--.f6461.4
Applied rewrites61.4%
Taylor expanded in z around 0
Applied rewrites48.9%
if -2.65e-207 < z < 1.79999999999999989e-135Initial program 93.3%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6493.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.3
Applied rewrites93.3%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6468.3
Applied rewrites68.3%
Taylor expanded in z around 0
Applied rewrites58.7%
Final simplification69.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -4.8e-63) t_1 (if (<= z 1.8e-135) (* 1.0 x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4.8e-63) {
tmp = t_1;
} else if (z <= 1.8e-135) {
tmp = 1.0 * x;
} 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 = (t - a) / (b - y)
if (z <= (-4.8d-63)) then
tmp = t_1
else if (z <= 1.8d-135) then
tmp = 1.0d0 * x
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 = (t - a) / (b - y);
double tmp;
if (z <= -4.8e-63) {
tmp = t_1;
} else if (z <= 1.8e-135) {
tmp = 1.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -4.8e-63: tmp = t_1 elif z <= 1.8e-135: tmp = 1.0 * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.8e-63) tmp = t_1; elseif (z <= 1.8e-135) tmp = Float64(1.0 * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -4.8e-63) tmp = t_1; elseif (z <= 1.8e-135) tmp = 1.0 * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-63], t$95$1, If[LessEqual[z, 1.8e-135], N[(1.0 * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-135}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.8000000000000001e-63 or 1.79999999999999989e-135 < z Initial program 54.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6476.6
Applied rewrites76.6%
if -4.8000000000000001e-63 < z < 1.79999999999999989e-135Initial program 92.1%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6492.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.1
Applied rewrites92.1%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6459.0
Applied rewrites59.0%
Taylor expanded in z around 0
Applied rewrites50.3%
Final simplification67.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -1.3e+52) t_1 (if (<= y 6.5e+103) (/ (- 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.3e+52) {
tmp = t_1;
} else if (y <= 6.5e+103) {
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.3d+52)) then
tmp = t_1
else if (y <= 6.5d+103) 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.3e+52) {
tmp = t_1;
} else if (y <= 6.5e+103) {
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.3e+52: tmp = t_1 elif y <= 6.5e+103: 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.3e+52) tmp = t_1; elseif (y <= 6.5e+103) 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.3e+52) tmp = t_1; elseif (y <= 6.5e+103) 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.3e+52], t$95$1, If[LessEqual[y, 6.5e+103], 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.3 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+103}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.3e52 or 6.50000000000000001e103 < y Initial program 52.4%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6454.7
Applied rewrites54.7%
if -1.3e52 < y < 6.50000000000000001e103Initial program 74.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6454.5
Applied rewrites54.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -1.6e-122) t_1 (if (<= y 1.65e-36) (/ t 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.6e-122) {
tmp = t_1;
} else if (y <= 1.65e-36) {
tmp = t / 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.6d-122)) then
tmp = t_1
else if (y <= 1.65d-36) then
tmp = t / 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.6e-122) {
tmp = t_1;
} else if (y <= 1.65e-36) {
tmp = t / 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.6e-122: tmp = t_1 elif y <= 1.65e-36: tmp = t / 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.6e-122) tmp = t_1; elseif (y <= 1.65e-36) tmp = Float64(t / 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.6e-122) tmp = t_1; elseif (y <= 1.65e-36) tmp = t / 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.6e-122], t$95$1, If[LessEqual[y, 1.65e-36], N[(t / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-36}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.6000000000000001e-122 or 1.64999999999999995e-36 < y Initial program 61.1%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6440.4
Applied rewrites40.4%
if -1.6000000000000001e-122 < y < 1.64999999999999995e-36Initial program 77.8%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6477.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6477.8
Applied rewrites77.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6459.7
Applied rewrites59.7%
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--.f6446.5
Applied rewrites46.5%
Taylor expanded in y around 0
Applied rewrites40.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.45e-55) (/ t b) (if (<= z 7.8e-129) (* 1.0 x) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.45e-55) {
tmp = t / b;
} else if (z <= 7.8e-129) {
tmp = 1.0 * x;
} else {
tmp = t / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.45d-55)) then
tmp = t / b
else if (z <= 7.8d-129) then
tmp = 1.0d0 * x
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.45e-55) {
tmp = t / b;
} else if (z <= 7.8e-129) {
tmp = 1.0 * x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.45e-55: tmp = t / b elif z <= 7.8e-129: tmp = 1.0 * x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.45e-55) tmp = Float64(t / b); elseif (z <= 7.8e-129) tmp = Float64(1.0 * x); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.45e-55) tmp = t / b; elseif (z <= 7.8e-129) tmp = 1.0 * x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.45e-55], N[(t / b), $MachinePrecision], If[LessEqual[z, 7.8e-129], N[(1.0 * x), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-55}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-129}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -1.45e-55 or 7.80000000000000019e-129 < z Initial program 54.5%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6454.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6454.6
Applied rewrites54.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6441.9
Applied rewrites41.9%
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--.f6436.1
Applied rewrites36.1%
Taylor expanded in y around 0
Applied rewrites27.2%
if -1.45e-55 < z < 7.80000000000000019e-129Initial program 92.2%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
Applied rewrites92.2%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6458.4
Applied rewrites58.4%
Taylor expanded in z around 0
Applied rewrites49.8%
Final simplification34.9%
(FPCore (x y z t a b) :precision binary64 (fma x z x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(x, z, x);
}
function code(x, y, z, t, a, b) return fma(x, z, x) end
code[x_, y_, z_, t_, a_, b_] := N[(x * z + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, z, x\right)
\end{array}
Initial program 67.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6428.4
Applied rewrites28.4%
Taylor expanded in z around 0
Applied rewrites21.6%
(FPCore (x y z t a b) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a, double b) {
return 1.0 * x;
}
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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return 1.0 * x;
}
def code(x, y, z, t, a, b): return 1.0 * x
function code(x, y, z, t, a, b) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a, b) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_, b_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 67.3%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6467.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.4
Applied rewrites67.4%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6431.2
Applied rewrites31.2%
Taylor expanded in z around 0
Applied rewrites21.4%
Final simplification21.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 67.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6428.4
Applied rewrites28.4%
Taylor expanded in z around 0
Applied rewrites21.6%
Taylor expanded in z around inf
Applied rewrites3.5%
Final simplification3.5%
(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 2024248
(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)))))