
(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 (+ x (/ a (/ (+ (- t z) 1.0) (- z y)))))
double code(double x, double y, double z, double t, double a) {
return x + (a / (((t - z) + 1.0) / (z - y)));
}
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 / (((t - z) + 1.0d0) / (z - y)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a / (((t - z) + 1.0) / (z - y)));
}
def code(x, y, z, t, a): return x + (a / (((t - z) + 1.0) / (z - y)))
function code(x, y, z, t, a) return Float64(x + Float64(a / Float64(Float64(Float64(t - z) + 1.0) / Float64(z - y)))) end
function tmp = code(x, y, z, t, a) tmp = x + (a / (((t - z) + 1.0) / (z - y))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{a}{\frac{\left(t - z\right) + 1}{z - y}}
\end{array}
Initial program 96.3%
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.8e+17)
(+ x (* z (/ a (+ t (- 1.0 z)))))
(if (<= z 2.5e+42)
(+ x (* y (/ a (- -1.0 t))))
(+ x (/ a (/ (- 1.0 z) (- z y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+17) {
tmp = x + (z * (a / (t + (1.0 - z))));
} else if (z <= 2.5e+42) {
tmp = x + (y * (a / (-1.0 - t)));
} else {
tmp = x + (a / ((1.0 - z) / (z - y)));
}
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 <= (-4.8d+17)) then
tmp = x + (z * (a / (t + (1.0d0 - z))))
else if (z <= 2.5d+42) then
tmp = x + (y * (a / ((-1.0d0) - t)))
else
tmp = x + (a / ((1.0d0 - z) / (z - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+17) {
tmp = x + (z * (a / (t + (1.0 - z))));
} else if (z <= 2.5e+42) {
tmp = x + (y * (a / (-1.0 - t)));
} else {
tmp = x + (a / ((1.0 - z) / (z - y)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e+17: tmp = x + (z * (a / (t + (1.0 - z)))) elif z <= 2.5e+42: tmp = x + (y * (a / (-1.0 - t))) else: tmp = x + (a / ((1.0 - z) / (z - y))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e+17) tmp = Float64(x + Float64(z * Float64(a / Float64(t + Float64(1.0 - z))))); elseif (z <= 2.5e+42) tmp = Float64(x + Float64(y * Float64(a / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(a / Float64(Float64(1.0 - z) / Float64(z - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.8e+17) tmp = x + (z * (a / (t + (1.0 - z)))); elseif (z <= 2.5e+42) tmp = x + (y * (a / (-1.0 - t))); else tmp = x + (a / ((1.0 - z) / (z - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e+17], N[(x + N[(z * N[(a / N[(t + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e+42], N[(x + N[(y * N[(a / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a / N[(N[(1.0 - z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+17}:\\
\;\;\;\;x + z \cdot \frac{a}{t + \left(1 - z\right)}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+42}:\\
\;\;\;\;x + y \cdot \frac{a}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z - y}}\\
\end{array}
\end{array}
if z < -4.8e17Initial program 98.4%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6491.5%
Simplified91.5%
if -4.8e17 < z < 2.50000000000000003e42Initial program 97.1%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6486.7%
Simplified86.7%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6490.6%
Applied egg-rr90.6%
if 2.50000000000000003e42 < z Initial program 92.1%
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6490.6%
Simplified90.6%
Final simplification90.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.8e+50)
(- x a)
(if (<= z -1.4e-154)
(- x (/ y (/ t a)))
(if (<= z 2600000000.0) (- x (* a y)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e+50) {
tmp = x - a;
} else if (z <= -1.4e-154) {
tmp = x - (y / (t / a));
} else if (z <= 2600000000.0) {
tmp = x - (a * y);
} 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 <= (-6.8d+50)) then
tmp = x - a
else if (z <= (-1.4d-154)) then
tmp = x - (y / (t / a))
else if (z <= 2600000000.0d0) then
tmp = x - (a * y)
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 <= -6.8e+50) {
tmp = x - a;
} else if (z <= -1.4e-154) {
tmp = x - (y / (t / a));
} else if (z <= 2600000000.0) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.8e+50: tmp = x - a elif z <= -1.4e-154: tmp = x - (y / (t / a)) elif z <= 2600000000.0: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.8e+50) tmp = Float64(x - a); elseif (z <= -1.4e-154) tmp = Float64(x - Float64(y / Float64(t / a))); elseif (z <= 2600000000.0) tmp = Float64(x - Float64(a * y)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.8e+50) tmp = x - a; elseif (z <= -1.4e-154) tmp = x - (y / (t / a)); elseif (z <= 2600000000.0) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e+50], N[(x - a), $MachinePrecision], If[LessEqual[z, -1.4e-154], N[(x - N[(y / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2600000000.0], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+50}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-154}:\\
\;\;\;\;x - \frac{y}{\frac{t}{a}}\\
\mathbf{elif}\;z \leq 2600000000:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -6.7999999999999997e50 or 2.6e9 < z Initial program 95.2%
Taylor expanded in z around inf
--lowering--.f6480.9%
Simplified80.9%
if -6.7999999999999997e50 < z < -1.40000000000000006e-154Initial program 99.8%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6475.0%
Simplified75.0%
Taylor expanded in t around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6457.9%
Simplified57.9%
--lowering--.f64N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f6466.0%
Applied egg-rr66.0%
if -1.40000000000000006e-154 < z < 2.6e9Initial program 95.9%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6488.9%
Simplified88.9%
Taylor expanded in t around 0
--lowering--.f64N/A
*-lowering-*.f6472.9%
Simplified72.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -8e+17) (+ x (* z (/ a (+ t (- 1.0 z))))) (if (<= z 1e+50) (+ x (* y (/ a (- -1.0 t)))) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e+17) {
tmp = x + (z * (a / (t + (1.0 - z))));
} else if (z <= 1e+50) {
tmp = x + (y * (a / (-1.0 - t)));
} 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 <= (-8d+17)) then
tmp = x + (z * (a / (t + (1.0d0 - z))))
else if (z <= 1d+50) then
tmp = x + (y * (a / ((-1.0d0) - t)))
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 <= -8e+17) {
tmp = x + (z * (a / (t + (1.0 - z))));
} else if (z <= 1e+50) {
tmp = x + (y * (a / (-1.0 - t)));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e+17: tmp = x + (z * (a / (t + (1.0 - z)))) elif z <= 1e+50: tmp = x + (y * (a / (-1.0 - t))) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e+17) tmp = Float64(x + Float64(z * Float64(a / Float64(t + Float64(1.0 - z))))); elseif (z <= 1e+50) tmp = Float64(x + Float64(y * Float64(a / Float64(-1.0 - t)))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8e+17) tmp = x + (z * (a / (t + (1.0 - z)))); elseif (z <= 1e+50) tmp = x + (y * (a / (-1.0 - t))); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e+17], N[(x + N[(z * N[(a / N[(t + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+50], N[(x + N[(y * N[(a / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+17}:\\
\;\;\;\;x + z \cdot \frac{a}{t + \left(1 - z\right)}\\
\mathbf{elif}\;z \leq 10^{+50}:\\
\;\;\;\;x + y \cdot \frac{a}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -8e17Initial program 98.4%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6491.5%
Simplified91.5%
if -8e17 < z < 1.0000000000000001e50Initial program 97.1%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6486.7%
Simplified86.7%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6490.6%
Applied egg-rr90.6%
if 1.0000000000000001e50 < z Initial program 92.1%
Taylor expanded in z around inf
--lowering--.f6477.6%
Simplified77.6%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.2e+53) (- x a) (if (<= z 1.3e+45) (+ x (* y (/ a (- -1.0 t)))) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+53) {
tmp = x - a;
} else if (z <= 1.3e+45) {
tmp = x + (y * (a / (-1.0 - t)));
} 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 <= (-5.2d+53)) then
tmp = x - a
else if (z <= 1.3d+45) then
tmp = x + (y * (a / ((-1.0d0) - t)))
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 <= -5.2e+53) {
tmp = x - a;
} else if (z <= 1.3e+45) {
tmp = x + (y * (a / (-1.0 - t)));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e+53: tmp = x - a elif z <= 1.3e+45: tmp = x + (y * (a / (-1.0 - t))) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+53) tmp = Float64(x - a); elseif (z <= 1.3e+45) tmp = Float64(x + Float64(y * Float64(a / Float64(-1.0 - t)))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.2e+53) tmp = x - a; elseif (z <= 1.3e+45) tmp = x + (y * (a / (-1.0 - t))); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+53], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.3e+45], N[(x + N[(y * N[(a / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+53}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+45}:\\
\;\;\;\;x + y \cdot \frac{a}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -5.19999999999999996e53 or 1.30000000000000004e45 < z Initial program 95.0%
Taylor expanded in z around inf
--lowering--.f6482.3%
Simplified82.3%
if -5.19999999999999996e53 < z < 1.30000000000000004e45Initial program 97.3%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6483.5%
Simplified83.5%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6488.6%
Applied egg-rr88.6%
Final simplification85.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.5e-16) (- x a) (if (<= z 3200000000.0) (- x (* a y)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e-16) {
tmp = x - a;
} else if (z <= 3200000000.0) {
tmp = x - (a * y);
} 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 <= (-7.5d-16)) then
tmp = x - a
else if (z <= 3200000000.0d0) then
tmp = x - (a * y)
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 <= -7.5e-16) {
tmp = x - a;
} else if (z <= 3200000000.0) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e-16: tmp = x - a elif z <= 3200000000.0: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e-16) tmp = Float64(x - a); elseif (z <= 3200000000.0) tmp = Float64(x - Float64(a * y)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.5e-16) tmp = x - a; elseif (z <= 3200000000.0) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e-16], N[(x - a), $MachinePrecision], If[LessEqual[z, 3200000000.0], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-16}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 3200000000:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -7.5e-16 or 3.2e9 < z Initial program 95.8%
Taylor expanded in z around inf
--lowering--.f6478.1%
Simplified78.1%
if -7.5e-16 < z < 3.2e9Initial program 96.8%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6486.7%
Simplified86.7%
Taylor expanded in t around 0
--lowering--.f64N/A
*-lowering-*.f6468.8%
Simplified68.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.1e+19) (- x a) (if (<= z 114000000000.0) x (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+19) {
tmp = x - a;
} else if (z <= 114000000000.0) {
tmp = x;
} 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 <= (-1.1d+19)) then
tmp = x - a
else if (z <= 114000000000.0d0) then
tmp = x
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 <= -1.1e+19) {
tmp = x - a;
} else if (z <= 114000000000.0) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+19: tmp = x - a elif z <= 114000000000.0: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+19) tmp = Float64(x - a); elseif (z <= 114000000000.0) tmp = x; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e+19) tmp = x - a; elseif (z <= 114000000000.0) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+19], N[(x - a), $MachinePrecision], If[LessEqual[z, 114000000000.0], x, N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+19}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 114000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.1e19 or 1.14e11 < z Initial program 95.5%
Taylor expanded in z around inf
--lowering--.f6479.1%
Simplified79.1%
if -1.1e19 < z < 1.14e11Initial program 97.0%
Taylor expanded in x around inf
Simplified58.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.22e+231) (- 0.0 a) (if (<= a 5e+203) x (- 0.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.22e+231) {
tmp = 0.0 - a;
} else if (a <= 5e+203) {
tmp = x;
} else {
tmp = 0.0 - 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 (a <= (-1.22d+231)) then
tmp = 0.0d0 - a
else if (a <= 5d+203) then
tmp = x
else
tmp = 0.0d0 - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.22e+231) {
tmp = 0.0 - a;
} else if (a <= 5e+203) {
tmp = x;
} else {
tmp = 0.0 - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.22e+231: tmp = 0.0 - a elif a <= 5e+203: tmp = x else: tmp = 0.0 - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.22e+231) tmp = Float64(0.0 - a); elseif (a <= 5e+203) tmp = x; else tmp = Float64(0.0 - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.22e+231) tmp = 0.0 - a; elseif (a <= 5e+203) tmp = x; else tmp = 0.0 - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.22e+231], N[(0.0 - a), $MachinePrecision], If[LessEqual[a, 5e+203], x, N[(0.0 - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.22 \cdot 10^{+231}:\\
\;\;\;\;0 - a\\
\mathbf{elif}\;a \leq 5 \cdot 10^{+203}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0 - a\\
\end{array}
\end{array}
if a < -1.21999999999999998e231 or 4.99999999999999994e203 < a Initial program 99.7%
Taylor expanded in z around inf
--lowering--.f6451.7%
Simplified51.7%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f6449.2%
Simplified49.2%
sub0-negN/A
neg-lowering-neg.f6449.2%
Applied egg-rr49.2%
if -1.21999999999999998e231 < a < 4.99999999999999994e203Initial program 95.6%
Taylor expanded in x around inf
Simplified58.1%
Final simplification56.6%
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ a (+ -1.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (a / (-1.0 + (z - 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 = x + ((y - z) * (a / ((-1.0d0) + (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (a / (-1.0 + (z - t))));
}
def code(x, y, z, t, a): return x + ((y - z) * (a / (-1.0 + (z - t))))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(a / Float64(-1.0 + Float64(z - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * (a / (-1.0 + (z - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{a}{-1 + \left(z - t\right)}
\end{array}
Initial program 96.3%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
--lowering--.f6496.7%
Applied egg-rr96.7%
Final simplification96.7%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.3%
Taylor expanded in x around inf
Simplified50.1%
(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 2024138
(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))))