
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
real(8) function code(x, y, z, t, a)
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
code = x + (((y - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
real(8) function code(x, y, z, t, a)
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
code = x + (((y - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y a) z) (- x t) t)))
(if (<= z -2.25e+111)
t_1
(if (<= z 2.6e-8) (+ x (* (- t x) (/ (- y z) (- a z)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - a) / z), (x - t), t);
double tmp;
if (z <= -2.25e+111) {
tmp = t_1;
} else if (z <= 2.6e-8) {
tmp = x + ((t - x) * ((y - z) / (a - z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - a) / z), Float64(x - t), t) tmp = 0.0 if (z <= -2.25e+111) tmp = t_1; elseif (z <= 2.6e-8) tmp = Float64(x + Float64(Float64(t - x) * Float64(Float64(y - z) / Float64(a - z)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -2.25e+111], t$95$1, If[LessEqual[z, 2.6e-8], N[(x + N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-8}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.25e111 or 2.6000000000000001e-8 < z Initial program 38.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites87.3%
lift-neg.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6487.3
lift-+.f64N/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6487.3
Applied rewrites87.3%
if -2.25e111 < z < 2.6000000000000001e-8Initial program 87.1%
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6493.3
Applied rewrites93.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma x (/ z a) x)))
(if (<= z -6.8e+118)
t
(if (<= z -5.2e-296)
t_1
(if (<= z 7.2e-134)
(* t (/ y a))
(if (<= z 4.8e-76) t_1 (if (<= z 5e-7) (* t (/ y (- a z))) t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(x, (z / a), x);
double tmp;
if (z <= -6.8e+118) {
tmp = t;
} else if (z <= -5.2e-296) {
tmp = t_1;
} else if (z <= 7.2e-134) {
tmp = t * (y / a);
} else if (z <= 4.8e-76) {
tmp = t_1;
} else if (z <= 5e-7) {
tmp = t * (y / (a - z));
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(x, Float64(z / a), x) tmp = 0.0 if (z <= -6.8e+118) tmp = t; elseif (z <= -5.2e-296) tmp = t_1; elseif (z <= 7.2e-134) tmp = Float64(t * Float64(y / a)); elseif (z <= 4.8e-76) tmp = t_1; elseif (z <= 5e-7) tmp = Float64(t * Float64(y / Float64(a - z))); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(z / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -6.8e+118], t, If[LessEqual[z, -5.2e-296], t$95$1, If[LessEqual[z, 7.2e-134], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e-76], t$95$1, If[LessEqual[z, 5e-7], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \frac{z}{a}, x\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+118}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-296}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-134}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -6.79999999999999973e118 or 4.99999999999999977e-7 < z Initial program 37.7%
Taylor expanded in z around inf
lower--.f6434.0
Applied rewrites34.0%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6448.5
Applied rewrites48.5%
+-inversesN/A
--rgt-identity48.5
Applied rewrites48.5%
if -6.79999999999999973e118 < z < -5.2000000000000001e-296 or 7.1999999999999998e-134 < z < 4.80000000000000026e-76Initial program 83.8%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower--.f6455.7
Applied rewrites55.7%
Taylor expanded in y around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6442.2
Applied rewrites42.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6441.2
Applied rewrites41.2%
if -5.2000000000000001e-296 < z < 7.1999999999999998e-134Initial program 93.2%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
lower-/.f6495.3
Applied rewrites95.3%
Taylor expanded in t around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6458.6
Applied rewrites58.6%
if 4.80000000000000026e-76 < z < 4.99999999999999977e-7Initial program 84.1%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6459.5
Applied rewrites59.5%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6467.2
Applied rewrites67.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.2e+57)
t
(if (<= z 8e-75)
(- x (/ (* y x) a))
(if (<= z 56000000000000.0)
(* t (/ y (- a z)))
(if (<= z 1.45e+124) (/ (* (- y a) x) z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e+57) {
tmp = t;
} else if (z <= 8e-75) {
tmp = x - ((y * x) / a);
} else if (z <= 56000000000000.0) {
tmp = t * (y / (a - z));
} else if (z <= 1.45e+124) {
tmp = ((y - a) * x) / z;
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if (z <= (-8.2d+57)) then
tmp = t
else if (z <= 8d-75) then
tmp = x - ((y * x) / a)
else if (z <= 56000000000000.0d0) then
tmp = t * (y / (a - z))
else if (z <= 1.45d+124) then
tmp = ((y - a) * x) / z
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e+57) {
tmp = t;
} else if (z <= 8e-75) {
tmp = x - ((y * x) / a);
} else if (z <= 56000000000000.0) {
tmp = t * (y / (a - z));
} else if (z <= 1.45e+124) {
tmp = ((y - a) * x) / z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.2e+57: tmp = t elif z <= 8e-75: tmp = x - ((y * x) / a) elif z <= 56000000000000.0: tmp = t * (y / (a - z)) elif z <= 1.45e+124: tmp = ((y - a) * x) / z else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.2e+57) tmp = t; elseif (z <= 8e-75) tmp = Float64(x - Float64(Float64(y * x) / a)); elseif (z <= 56000000000000.0) tmp = Float64(t * Float64(y / Float64(a - z))); elseif (z <= 1.45e+124) tmp = Float64(Float64(Float64(y - a) * x) / z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.2e+57) tmp = t; elseif (z <= 8e-75) tmp = x - ((y * x) / a); elseif (z <= 56000000000000.0) tmp = t * (y / (a - z)); elseif (z <= 1.45e+124) tmp = ((y - a) * x) / z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.2e+57], t, If[LessEqual[z, 8e-75], N[(x - N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 56000000000000.0], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+124], N[(N[(N[(y - a), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+57}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-75}:\\
\;\;\;\;x - \frac{y \cdot x}{a}\\
\mathbf{elif}\;z \leq 56000000000000:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+124}:\\
\;\;\;\;\frac{\left(y - a\right) \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -8.2e57 or 1.45000000000000011e124 < z Initial program 36.4%
Taylor expanded in z around inf
lower--.f6434.0
Applied rewrites34.0%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6449.7
Applied rewrites49.7%
+-inversesN/A
--rgt-identity49.7
Applied rewrites49.7%
if -8.2e57 < z < 7.9999999999999997e-75Initial program 90.8%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower--.f6457.8
Applied rewrites57.8%
Taylor expanded in z around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6451.8
Applied rewrites51.8%
if 7.9999999999999997e-75 < z < 5.6e13Initial program 76.0%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6487.8
Applied rewrites87.8%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6463.7
Applied rewrites63.7%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.0
Applied rewrites58.0%
if 5.6e13 < z < 1.45000000000000011e124Initial program 59.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites84.6%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6458.9
Applied rewrites58.9%
Final simplification51.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma x (/ z a) x)))
(if (<= z -6.8e+118)
t
(if (<= z -5.2e-296)
t_1
(if (<= z 7.2e-134) (* t (/ y a)) (if (<= z 3.9e-7) t_1 t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(x, (z / a), x);
double tmp;
if (z <= -6.8e+118) {
tmp = t;
} else if (z <= -5.2e-296) {
tmp = t_1;
} else if (z <= 7.2e-134) {
tmp = t * (y / a);
} else if (z <= 3.9e-7) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(x, Float64(z / a), x) tmp = 0.0 if (z <= -6.8e+118) tmp = t; elseif (z <= -5.2e-296) tmp = t_1; elseif (z <= 7.2e-134) tmp = Float64(t * Float64(y / a)); elseif (z <= 3.9e-7) tmp = t_1; else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(z / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -6.8e+118], t, If[LessEqual[z, -5.2e-296], t$95$1, If[LessEqual[z, 7.2e-134], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e-7], t$95$1, t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \frac{z}{a}, x\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+118}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-296}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-134}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -6.79999999999999973e118 or 3.90000000000000025e-7 < z Initial program 37.7%
Taylor expanded in z around inf
lower--.f6434.0
Applied rewrites34.0%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6448.5
Applied rewrites48.5%
+-inversesN/A
--rgt-identity48.5
Applied rewrites48.5%
if -6.79999999999999973e118 < z < -5.2000000000000001e-296 or 7.1999999999999998e-134 < z < 3.90000000000000025e-7Initial program 83.8%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower--.f6452.8
Applied rewrites52.8%
Taylor expanded in y around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6441.1
Applied rewrites41.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6440.2
Applied rewrites40.2%
if -5.2000000000000001e-296 < z < 7.1999999999999998e-134Initial program 93.2%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
lower-/.f6495.3
Applied rewrites95.3%
Taylor expanded in t around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6458.6
Applied rewrites58.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y a) z) (- x t) t)))
(if (<= z -2.25e+111)
t_1
(if (<= z 2.6e-8) (fma (- t x) (/ (- y z) (- a z)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - a) / z), (x - t), t);
double tmp;
if (z <= -2.25e+111) {
tmp = t_1;
} else if (z <= 2.6e-8) {
tmp = fma((t - x), ((y - z) / (a - z)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - a) / z), Float64(x - t), t) tmp = 0.0 if (z <= -2.25e+111) tmp = t_1; elseif (z <= 2.6e-8) tmp = fma(Float64(t - x), Float64(Float64(y - z) / Float64(a - z)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -2.25e+111], t$95$1, If[LessEqual[z, 2.6e-8], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.25e111 or 2.6000000000000001e-8 < z Initial program 38.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites87.3%
lift-neg.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6487.3
lift-+.f64N/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6487.3
Applied rewrites87.3%
if -2.25e111 < z < 2.6000000000000001e-8Initial program 87.1%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6493.3
Applied rewrites93.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1e+119)
t
(if (<= z 1.85e-8)
(fma y (/ (- t x) a) x)
(if (<= z 1.45e+124) (/ (* (- y a) x) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+119) {
tmp = t;
} else if (z <= 1.85e-8) {
tmp = fma(y, ((t - x) / a), x);
} else if (z <= 1.45e+124) {
tmp = ((y - a) * x) / z;
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+119) tmp = t; elseif (z <= 1.85e-8) tmp = fma(y, Float64(Float64(t - x) / a), x); elseif (z <= 1.45e+124) tmp = Float64(Float64(Float64(y - a) * x) / z); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+119], t, If[LessEqual[z, 1.85e-8], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.45e+124], N[(N[(N[(y - a), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+119}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+124}:\\
\;\;\;\;\frac{\left(y - a\right) \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -9.99999999999999944e118 or 1.45000000000000011e124 < z Initial program 33.4%
Taylor expanded in z around inf
lower--.f6437.6
Applied rewrites37.6%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6454.0
Applied rewrites54.0%
+-inversesN/A
--rgt-identity54.0
Applied rewrites54.0%
if -9.99999999999999944e118 < z < 1.85e-8Initial program 86.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6470.9
Applied rewrites70.9%
if 1.85e-8 < z < 1.45000000000000011e124Initial program 60.3%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites83.2%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6448.8
Applied rewrites48.8%
Final simplification64.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.8e+127)
t
(if (<= z 4.05e-7)
(fma (- x) (/ y a) x)
(if (<= z 1.45e+124) (/ (* (- y a) x) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e+127) {
tmp = t;
} else if (z <= 4.05e-7) {
tmp = fma(-x, (y / a), x);
} else if (z <= 1.45e+124) {
tmp = ((y - a) * x) / z;
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.8e+127) tmp = t; elseif (z <= 4.05e-7) tmp = fma(Float64(-x), Float64(y / a), x); elseif (z <= 1.45e+124) tmp = Float64(Float64(Float64(y - a) * x) / z); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e+127], t, If[LessEqual[z, 4.05e-7], N[((-x) * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.45e+124], N[(N[(N[(y - a), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+127}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 4.05 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{y}{a}, x\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+124}:\\
\;\;\;\;\frac{\left(y - a\right) \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -6.79999999999999955e127 or 1.45000000000000011e124 < z Initial program 33.0%
Taylor expanded in z around inf
lower--.f6438.5
Applied rewrites38.5%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6454.1
Applied rewrites54.1%
+-inversesN/A
--rgt-identity54.1
Applied rewrites54.1%
if -6.79999999999999955e127 < z < 4.04999999999999987e-7Initial program 85.9%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6491.8
Applied rewrites91.8%
Taylor expanded in z around 0
lower-/.f6470.2
Applied rewrites70.2%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6450.3
Applied rewrites50.3%
if 4.04999999999999987e-7 < z < 1.45000000000000011e124Initial program 57.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites82.3%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Final simplification51.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.2e+57)
t
(if (<= z 8e-75)
(- x (/ (* y x) a))
(if (<= z 5e-7) (* t (/ y (- a z))) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e+57) {
tmp = t;
} else if (z <= 8e-75) {
tmp = x - ((y * x) / a);
} else if (z <= 5e-7) {
tmp = t * (y / (a - z));
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if (z <= (-8.2d+57)) then
tmp = t
else if (z <= 8d-75) then
tmp = x - ((y * x) / a)
else if (z <= 5d-7) then
tmp = t * (y / (a - z))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e+57) {
tmp = t;
} else if (z <= 8e-75) {
tmp = x - ((y * x) / a);
} else if (z <= 5e-7) {
tmp = t * (y / (a - z));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.2e+57: tmp = t elif z <= 8e-75: tmp = x - ((y * x) / a) elif z <= 5e-7: tmp = t * (y / (a - z)) else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.2e+57) tmp = t; elseif (z <= 8e-75) tmp = Float64(x - Float64(Float64(y * x) / a)); elseif (z <= 5e-7) tmp = Float64(t * Float64(y / Float64(a - z))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.2e+57) tmp = t; elseif (z <= 8e-75) tmp = x - ((y * x) / a); elseif (z <= 5e-7) tmp = t * (y / (a - z)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.2e+57], t, If[LessEqual[z, 8e-75], N[(x - N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-7], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+57}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-75}:\\
\;\;\;\;x - \frac{y \cdot x}{a}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -8.2e57 or 4.99999999999999977e-7 < z Initial program 39.6%
Taylor expanded in z around inf
lower--.f6431.4
Applied rewrites31.4%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6445.6
Applied rewrites45.6%
+-inversesN/A
--rgt-identity45.6
Applied rewrites45.6%
if -8.2e57 < z < 7.9999999999999997e-75Initial program 90.8%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower--.f6457.8
Applied rewrites57.8%
Taylor expanded in z around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6451.8
Applied rewrites51.8%
if 7.9999999999999997e-75 < z < 4.99999999999999977e-7Initial program 84.1%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6459.5
Applied rewrites59.5%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6467.2
Applied rewrites67.2%
Final simplification49.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y a) z) (- x t) t)))
(if (<= z -1e-40)
t_1
(if (<= z 1.9e-8) (fma (- t x) (/ (- y z) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - a) / z), (x - t), t);
double tmp;
if (z <= -1e-40) {
tmp = t_1;
} else if (z <= 1.9e-8) {
tmp = fma((t - x), ((y - z) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - a) / z), Float64(x - t), t) tmp = 0.0 if (z <= -1e-40) tmp = t_1; elseif (z <= 1.9e-8) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1e-40], t$95$1, If[LessEqual[z, 1.9e-8], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
\mathbf{if}\;z \leq -1 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.9999999999999993e-41 or 1.90000000000000014e-8 < z Initial program 43.7%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites81.5%
lift-neg.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-fma.f6481.5
lift-+.f64N/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6481.5
Applied rewrites81.5%
if -9.9999999999999993e-41 < z < 1.90000000000000014e-8Initial program 91.7%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6495.4
Applied rewrites95.4%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6484.3
Applied rewrites84.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x t) z) (- y a) t)))
(if (<= z -1.2e-39)
t_1
(if (<= z 1.9e-8) (fma (- t x) (/ (- y z) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - t) / z), (y - a), t);
double tmp;
if (z <= -1.2e-39) {
tmp = t_1;
} else if (z <= 1.9e-8) {
tmp = fma((t - x), ((y - z) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - t) / z), Float64(y - a), t) tmp = 0.0 if (z <= -1.2e-39) tmp = t_1; elseif (z <= 1.9e-8) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.2e-39], t$95$1, If[LessEqual[z, 1.9e-8], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - t}{z}, y - a, t\right)\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.20000000000000008e-39 or 1.90000000000000014e-8 < z Initial program 43.7%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites81.5%
lift-neg.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
Applied rewrites80.3%
if -1.20000000000000008e-39 < z < 1.90000000000000014e-8Initial program 91.7%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6495.4
Applied rewrites95.4%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6484.3
Applied rewrites84.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- x t) z) t)))
(if (<= z -1.2e-39)
t_1
(if (<= z 2.15e-16) (fma (- t x) (/ (- y z) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((x - t) / z), t);
double tmp;
if (z <= -1.2e-39) {
tmp = t_1;
} else if (z <= 2.15e-16) {
tmp = fma((t - x), ((y - z) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(x - t) / z), t) tmp = 0.0 if (z <= -1.2e-39) tmp = t_1; elseif (z <= 2.15e-16) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.2e-39], t$95$1, If[LessEqual[z, 2.15e-16], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-16}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.20000000000000008e-39 or 2.1499999999999999e-16 < z Initial program 43.7%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites81.5%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
div-subN/A
lower-fma.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f6471.2
Applied rewrites71.2%
if -1.20000000000000008e-39 < z < 2.1499999999999999e-16Initial program 91.7%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6495.4
Applied rewrites95.4%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6484.3
Applied rewrites84.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ (- x t) z) t))) (if (<= z -1.08e-82) t_1 (if (<= z 3.9e-17) (fma (- t x) (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((x - t) / z), t);
double tmp;
if (z <= -1.08e-82) {
tmp = t_1;
} else if (z <= 3.9e-17) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(x - t) / z), t) tmp = 0.0 if (z <= -1.08e-82) tmp = t_1; elseif (z <= 3.9e-17) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.08e-82], t$95$1, If[LessEqual[z, 3.9e-17], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{if}\;z \leq -1.08 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.07999999999999996e-82 or 3.89999999999999989e-17 < z Initial program 46.0%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites79.2%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
div-subN/A
lower-fma.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f6468.9
Applied rewrites68.9%
if -1.07999999999999996e-82 < z < 3.89999999999999989e-17Initial program 92.7%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6496.7
Applied rewrites96.7%
Taylor expanded in z around 0
lower-/.f6483.2
Applied rewrites83.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ (- x t) z) t))) (if (<= z -1.08e-82) t_1 (if (<= z 3.9e-17) (fma y (/ (- t x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((x - t) / z), t);
double tmp;
if (z <= -1.08e-82) {
tmp = t_1;
} else if (z <= 3.9e-17) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(x - t) / z), t) tmp = 0.0 if (z <= -1.08e-82) tmp = t_1; elseif (z <= 3.9e-17) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.08e-82], t$95$1, If[LessEqual[z, 3.9e-17], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{if}\;z \leq -1.08 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.07999999999999996e-82 or 3.89999999999999989e-17 < z Initial program 46.0%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites79.2%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
div-subN/A
lower-fma.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f6468.9
Applied rewrites68.9%
if -1.07999999999999996e-82 < z < 3.89999999999999989e-17Initial program 92.7%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6483.1
Applied rewrites83.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.45e-75) t (if (<= z 2.3e+50) (* t (/ y a)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e-75) {
tmp = t;
} else if (z <= 2.3e+50) {
tmp = t * (y / a);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if (z <= (-1.45d-75)) then
tmp = t
else if (z <= 2.3d+50) then
tmp = t * (y / a)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e-75) {
tmp = t;
} else if (z <= 2.3e+50) {
tmp = t * (y / a);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.45e-75: tmp = t elif z <= 2.3e+50: tmp = t * (y / a) else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.45e-75) tmp = t; elseif (z <= 2.3e+50) tmp = Float64(t * Float64(y / a)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.45e-75) tmp = t; elseif (z <= 2.3e+50) tmp = t * (y / a); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.45e-75], t, If[LessEqual[z, 2.3e+50], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-75}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+50}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.4500000000000001e-75 or 2.29999999999999997e50 < z Initial program 44.3%
Taylor expanded in z around inf
lower--.f6429.5
Applied rewrites29.5%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6441.7
Applied rewrites41.7%
+-inversesN/A
--rgt-identity41.7
Applied rewrites41.7%
if -1.4500000000000001e-75 < z < 2.29999999999999997e50Initial program 90.0%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6493.7
Applied rewrites93.7%
Taylor expanded in z around 0
lower-/.f6478.0
Applied rewrites78.0%
Taylor expanded in t around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6433.5
Applied rewrites33.5%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return t;
}
real(8) function code(x, y, z, t, a)
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
code = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 67.7%
Taylor expanded in z around inf
lower--.f6417.6
Applied rewrites17.6%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6424.1
Applied rewrites24.1%
+-inversesN/A
--rgt-identity24.1
Applied rewrites24.1%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
real(8) function code(x, y, z, t, a)
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
code = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 67.7%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower--.f6437.5
Applied rewrites37.5%
Taylor expanded in z around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lft2.9
Applied rewrites2.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* (/ y z) (- t x)))))
(if (< z -1.2536131056095036e+188)
t_1
(if (< z 4.446702369113811e+64)
(+ x (/ (- y z) (/ (- a z) (- t x))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = t - ((y / z) * (t - x))
if (z < (-1.2536131056095036d+188)) then
tmp = t_1
else if (z < 4.446702369113811d+64) then
tmp = x + ((y - z) / ((a - z) / (t - 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 t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - ((y / z) * (t - x)) tmp = 0 if z < -1.2536131056095036e+188: tmp = t_1 elif z < 4.446702369113811e+64: tmp = x + ((y - z) / ((a - z) / (t - x))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y / z) * Float64(t - x))) tmp = 0.0 if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - ((y / z) * (t - x)); tmp = 0.0; if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = x + ((y - z) / ((a - z) / (t - x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y / z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -1.2536131056095036e+188], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\
\mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024219
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))
(+ x (/ (* (- y z) (- t x)) (- a z))))