
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ (- y z) (+ -1.0 (- z t))) a x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / (-1.0 + (z - t))), a, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(-1.0 + Float64(z - t))), a, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{-1 + \left(z - t\right)}, a, x\right)
\end{array}
Initial program 95.2%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) (- t)) a x)))
(if (<= t -4.5e+89)
t_1
(if (<= t 6.4e+41) (fma (/ (- y z) (+ z -1.0)) a x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - z) / -t), a, x);
double tmp;
if (t <= -4.5e+89) {
tmp = t_1;
} else if (t <= 6.4e+41) {
tmp = fma(((y - z) / (z + -1.0)), a, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - z) / Float64(-t)), a, x) tmp = 0.0 if (t <= -4.5e+89) tmp = t_1; elseif (t <= 6.4e+41) tmp = fma(Float64(Float64(y - z) / Float64(z + -1.0)), a, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / (-t)), $MachinePrecision] * a + x), $MachinePrecision]}, If[LessEqual[t, -4.5e+89], t$95$1, If[LessEqual[t, 6.4e+41], N[(N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - z}{-t}, a, x\right)\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{z + -1}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.5e89 or 6.40000000000000019e41 < t Initial program 96.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6488.6
Applied rewrites88.6%
if -4.5e89 < t < 6.40000000000000019e41Initial program 93.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in t around 0
sub-negN/A
metadata-evalN/A
lower-+.f6496.2
Applied rewrites96.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -1e+80) (fma a (/ z (+ t (- 1.0 z))) x) (if (<= z 130000000.0) (fma a (/ y (- -1.0 t)) x) (fma (/ a z) (- y z) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+80) {
tmp = fma(a, (z / (t + (1.0 - z))), x);
} else if (z <= 130000000.0) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = fma((a / z), (y - z), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+80) tmp = fma(a, Float64(z / Float64(t + Float64(1.0 - z))), x); elseif (z <= 130000000.0) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = fma(Float64(a / z), Float64(y - z), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+80], N[(a * N[(z / N[(t + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 130000000.0], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(a / z), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+80}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{t + \left(1 - z\right)}, x\right)\\
\mathbf{elif}\;z \leq 130000000:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{z}, y - z, x\right)\\
\end{array}
\end{array}
if z < -1e80Initial program 93.0%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6490.9
Applied rewrites90.9%
if -1e80 < z < 1.3e8Initial program 98.3%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6491.5
Applied rewrites91.5%
if 1.3e8 < z Initial program 87.1%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
distribute-lft-neg-inN/A
clear-numN/A
lift-/.f64N/A
distribute-frac-neg2N/A
lower-fma.f64N/A
Applied rewrites87.9%
Taylor expanded in z around inf
lower-/.f6480.7
Applied rewrites80.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ a z) (- y z) x)))
(if (<= z -2.5e+76)
t_1
(if (<= z 130000000.0) (fma a (/ y (- -1.0 t)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((a / z), (y - z), x);
double tmp;
if (z <= -2.5e+76) {
tmp = t_1;
} else if (z <= 130000000.0) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(a / z), Float64(y - z), x) tmp = 0.0 if (z <= -2.5e+76) tmp = t_1; elseif (z <= 130000000.0) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a / z), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -2.5e+76], t$95$1, If[LessEqual[z, 130000000.0], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{a}{z}, y - z, x\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 130000000:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.49999999999999996e76 or 1.3e8 < z Initial program 90.4%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
distribute-lft-neg-inN/A
clear-numN/A
lift-/.f64N/A
distribute-frac-neg2N/A
lower-fma.f64N/A
Applied rewrites91.3%
Taylor expanded in z around inf
lower-/.f6480.5
Applied rewrites80.5%
if -2.49999999999999996e76 < z < 1.3e8Initial program 98.2%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6492.0
Applied rewrites92.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e+118) (- x a) (if (<= z 240000000.0) (fma a (/ y (- -1.0 t)) x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+118) {
tmp = x - a;
} else if (z <= 240000000.0) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+118) tmp = Float64(x - a); elseif (z <= 240000000.0) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+118], N[(x - a), $MachinePrecision], If[LessEqual[z, 240000000.0], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+118}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 240000000:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.60000000000000008e118 or 2.4e8 < z Initial program 89.3%
Taylor expanded in z around inf
lower--.f6476.8
Applied rewrites76.8%
if -1.60000000000000008e118 < z < 2.4e8Initial program 98.3%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6490.2
Applied rewrites90.2%
(FPCore (x y z t a) :precision binary64 (if (<= z 1.85e+161) (fma (/ a (+ -1.0 (- z t))) (- y z) x) (fma (* (- y z) (/ 1.0 z)) a x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.85e+161) {
tmp = fma((a / (-1.0 + (z - t))), (y - z), x);
} else {
tmp = fma(((y - z) * (1.0 / z)), a, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.85e+161) tmp = fma(Float64(a / Float64(-1.0 + Float64(z - t))), Float64(y - z), x); else tmp = fma(Float64(Float64(y - z) * Float64(1.0 / z)), a, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1.85e+161], N[(N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.85 \cdot 10^{+161}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{-1 + \left(z - t\right)}, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y - z\right) \cdot \frac{1}{z}, a, x\right)\\
\end{array}
\end{array}
if z < 1.8499999999999999e161Initial program 96.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
distribute-lft-neg-inN/A
clear-numN/A
lift-/.f64N/A
distribute-frac-neg2N/A
lower-fma.f64N/A
Applied rewrites97.2%
if 1.8499999999999999e161 < z Initial program 76.0%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6499.8
lift--.f64N/A
lift--.f64N/A
associate--r-N/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
lower-/.f6499.8
Applied rewrites99.8%
Final simplification97.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (* a (/ y t))))) (if (<= t -6.0) t_1 (if (<= t 3.1e-19) (- x (* y (- a (* t a)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (y / t));
double tmp;
if (t <= -6.0) {
tmp = t_1;
} else if (t <= 3.1e-19) {
tmp = x - (y * (a - (t * a)));
} 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 = x - (a * (y / t))
if (t <= (-6.0d0)) then
tmp = t_1
else if (t <= 3.1d-19) then
tmp = x - (y * (a - (t * a)))
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 = x - (a * (y / t));
double tmp;
if (t <= -6.0) {
tmp = t_1;
} else if (t <= 3.1e-19) {
tmp = x - (y * (a - (t * a)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / t)) tmp = 0 if t <= -6.0: tmp = t_1 elif t <= 3.1e-19: tmp = x - (y * (a - (t * a))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(y / t))) tmp = 0.0 if (t <= -6.0) tmp = t_1; elseif (t <= 3.1e-19) tmp = Float64(x - Float64(y * Float64(a - Float64(t * a)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * (y / t)); tmp = 0.0; if (t <= -6.0) tmp = t_1; elseif (t <= 3.1e-19) tmp = x - (y * (a - (t * a))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.0], t$95$1, If[LessEqual[t, 3.1e-19], N[(x - N[(y * N[(a - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -6:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-19}:\\
\;\;\;\;x - y \cdot \left(a - t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6 or 3.0999999999999999e-19 < t Initial program 96.1%
Taylor expanded in z around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6475.8
Applied rewrites75.8%
Taylor expanded in t around inf
Applied rewrites77.2%
if -6 < t < 3.0999999999999999e-19Initial program 94.1%
Taylor expanded in z around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6469.2
Applied rewrites69.2%
Taylor expanded in t around 0
Applied rewrites69.2%
Final simplification73.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -14.5) (- x a) (if (<= z 4.6e-13) (- x (* y a)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -14.5) {
tmp = x - a;
} else if (z <= 4.6e-13) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
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 <= (-14.5d0)) then
tmp = x - a
else if (z <= 4.6d-13) then
tmp = x - (y * a)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -14.5) {
tmp = x - a;
} else if (z <= 4.6e-13) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -14.5: tmp = x - a elif z <= 4.6e-13: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -14.5) tmp = Float64(x - a); elseif (z <= 4.6e-13) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -14.5) tmp = x - a; elseif (z <= 4.6e-13) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -14.5], N[(x - a), $MachinePrecision], If[LessEqual[z, 4.6e-13], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -14.5:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-13}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -14.5 or 4.59999999999999958e-13 < z Initial program 92.1%
Taylor expanded in z around inf
lower--.f6473.8
Applied rewrites73.8%
if -14.5 < z < 4.59999999999999958e-13Initial program 98.0%
Taylor expanded in z around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6490.6
Applied rewrites90.6%
Taylor expanded in t around 0
Applied rewrites68.9%
Final simplification71.2%
(FPCore (x y z t a) :precision binary64 (- x a))
double code(double x, double y, double z, double t, double a) {
return x - a;
}
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 - a
end function
public static double code(double x, double y, double z, double t, double a) {
return x - a;
}
def code(x, y, z, t, a): return x - a
function code(x, y, z, t, a) return Float64(x - a) end
function tmp = code(x, y, z, t, a) tmp = x - a; end
code[x_, y_, z_, t_, a_] := N[(x - a), $MachinePrecision]
\begin{array}{l}
\\
x - a
\end{array}
Initial program 95.2%
Taylor expanded in z around inf
lower--.f6456.3
Applied rewrites56.3%
(FPCore (x y z t a) :precision binary64 (- a))
double code(double x, double y, double z, double t, double a) {
return -a;
}
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 = -a
end function
public static double code(double x, double y, double z, double t, double a) {
return -a;
}
def code(x, y, z, t, a): return -a
function code(x, y, z, t, a) return Float64(-a) end
function tmp = code(x, y, z, t, a) tmp = -a; end
code[x_, y_, z_, t_, a_] := (-a)
\begin{array}{l}
\\
-a
\end{array}
Initial program 95.2%
Taylor expanded in z around inf
lower--.f6456.3
Applied rewrites56.3%
Taylor expanded in x around 0
Applied rewrites13.0%
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- y z) (+ (- t z) 1.0)) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
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 - z) + 1.0d0)) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
def code(x, y, z, t, a): return x - (((y - z) / ((t - z) + 1.0)) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(y - z) / Float64(Float64(t - z) + 1.0)) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((y - z) / ((t - z) + 1.0)) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
\end{array}
herbie shell --seed 2024219
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))