
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - 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 - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - 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 - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (- z t))) (t_2 (/ t_1 (- z a))))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 1e+276)))
(+ x (* (- z t) (/ y (- z a))))
(- x (/ t_1 (- a z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double t_2 = t_1 / (z - a);
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 1e+276)) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x - (t_1 / (a - z));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double t_2 = t_1 / (z - a);
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 1e+276)) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x - (t_1 / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z - t) t_2 = t_1 / (z - a) tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 1e+276): tmp = x + ((z - t) * (y / (z - a))) else: tmp = x - (t_1 / (a - z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) t_2 = Float64(t_1 / Float64(z - a)) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 1e+276)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); else tmp = Float64(x - Float64(t_1 / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z - t); t_2 = t_1 / (z - a); tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 1e+276))) tmp = x + ((z - t) * (y / (z - a))); else tmp = x - (t_1 / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 1e+276]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t$95$1 / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
t_2 := \frac{t\_1}{z - a}\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 10^{+276}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t\_1}{a - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 1.0000000000000001e276 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 35.8%
+-commutative35.8%
associate-/l*99.9%
fma-define99.8%
Simplified99.8%
fma-undefine99.9%
associate-/l*35.8%
div-inv35.8%
*-commutative35.8%
associate-*r*99.8%
div-inv99.9%
Applied egg-rr99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.0000000000000001e276Initial program 99.5%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 84.6%
+-commutative84.6%
associate-/l*99.5%
fma-define99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (- z t))) (t_2 (/ t_1 (- z a))))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 1e+276)))
(* (- z t) (/ y (- z a)))
(- x (/ t_1 (- a z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double t_2 = t_1 / (z - a);
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 1e+276)) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = x - (t_1 / (a - z));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double t_2 = t_1 / (z - a);
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 1e+276)) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = x - (t_1 / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z - t) t_2 = t_1 / (z - a) tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 1e+276): tmp = (z - t) * (y / (z - a)) else: tmp = x - (t_1 / (a - z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) t_2 = Float64(t_1 / Float64(z - a)) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 1e+276)) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); else tmp = Float64(x - Float64(t_1 / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z - t); t_2 = t_1 / (z - a); tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 1e+276))) tmp = (z - t) * (y / (z - a)); else tmp = x - (t_1 / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 1e+276]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t$95$1 / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
t_2 := \frac{t\_1}{z - a}\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 10^{+276}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t\_1}{a - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 1.0000000000000001e276 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 35.8%
Taylor expanded in x around 0 35.8%
*-commutative35.8%
associate-*r/86.3%
*-commutative86.3%
Applied egg-rr86.3%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.0000000000000001e276Initial program 99.5%
Final simplification96.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -1e-9)
t_1
(if (<= z -2.9e-80)
(* (- z t) (/ y (- z a)))
(if (<= z -2.1e-106)
(+ y x)
(if (<= z 7.6e-23) (+ x (* y (/ t a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -1e-9) {
tmp = t_1;
} else if (z <= -2.9e-80) {
tmp = (z - t) * (y / (z - a));
} else if (z <= -2.1e-106) {
tmp = y + x;
} else if (z <= 7.6e-23) {
tmp = x + (y * (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 + (y * (z / (z - a)))
if (z <= (-1d-9)) then
tmp = t_1
else if (z <= (-2.9d-80)) then
tmp = (z - t) * (y / (z - a))
else if (z <= (-2.1d-106)) then
tmp = y + x
else if (z <= 7.6d-23) then
tmp = x + (y * (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 + (y * (z / (z - a)));
double tmp;
if (z <= -1e-9) {
tmp = t_1;
} else if (z <= -2.9e-80) {
tmp = (z - t) * (y / (z - a));
} else if (z <= -2.1e-106) {
tmp = y + x;
} else if (z <= 7.6e-23) {
tmp = x + (y * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -1e-9: tmp = t_1 elif z <= -2.9e-80: tmp = (z - t) * (y / (z - a)) elif z <= -2.1e-106: tmp = y + x elif z <= 7.6e-23: tmp = x + (y * (t / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -1e-9) tmp = t_1; elseif (z <= -2.9e-80) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); elseif (z <= -2.1e-106) tmp = Float64(y + x); elseif (z <= 7.6e-23) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -1e-9) tmp = t_1; elseif (z <= -2.9e-80) tmp = (z - t) * (y / (z - a)); elseif (z <= -2.1e-106) tmp = y + x; elseif (z <= 7.6e-23) tmp = x + (y * (t / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e-9], t$95$1, If[LessEqual[z, -2.9e-80], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e-106], N[(y + x), $MachinePrecision], If[LessEqual[z, 7.6e-23], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -1 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-80}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-106}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-23}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.00000000000000006e-9 or 7.60000000000000023e-23 < z Initial program 76.4%
Taylor expanded in t around 0 69.2%
+-commutative69.2%
associate-/l*88.2%
Simplified88.2%
if -1.00000000000000006e-9 < z < -2.89999999999999998e-80Initial program 96.1%
Taylor expanded in x around 0 84.1%
*-commutative84.1%
associate-*r/84.1%
*-commutative84.1%
Applied egg-rr84.1%
if -2.89999999999999998e-80 < z < -2.10000000000000003e-106Initial program 100.0%
Taylor expanded in z around inf 100.0%
+-commutative100.0%
Simplified100.0%
if -2.10000000000000003e-106 < z < 7.60000000000000023e-23Initial program 93.8%
+-commutative93.8%
div-inv93.8%
fma-define93.8%
Applied egg-rr93.8%
Taylor expanded in z around 0 81.0%
*-commutative81.0%
associate-*r/87.1%
Simplified87.1%
Final simplification87.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (- 1.0 (/ t z)))))
(if (<= y -3.2e+209)
t_1
(if (<= y -2.4e+156)
(* t (/ y a))
(if (or (<= y -1.45e+109) (not (<= y 9.4e+182))) t_1 (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (1.0 - (t / z));
double tmp;
if (y <= -3.2e+209) {
tmp = t_1;
} else if (y <= -2.4e+156) {
tmp = t * (y / a);
} else if ((y <= -1.45e+109) || !(y <= 9.4e+182)) {
tmp = t_1;
} else {
tmp = y + x;
}
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 = y * (1.0d0 - (t / z))
if (y <= (-3.2d+209)) then
tmp = t_1
else if (y <= (-2.4d+156)) then
tmp = t * (y / a)
else if ((y <= (-1.45d+109)) .or. (.not. (y <= 9.4d+182))) then
tmp = t_1
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (1.0 - (t / z));
double tmp;
if (y <= -3.2e+209) {
tmp = t_1;
} else if (y <= -2.4e+156) {
tmp = t * (y / a);
} else if ((y <= -1.45e+109) || !(y <= 9.4e+182)) {
tmp = t_1;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (1.0 - (t / z)) tmp = 0 if y <= -3.2e+209: tmp = t_1 elif y <= -2.4e+156: tmp = t * (y / a) elif (y <= -1.45e+109) or not (y <= 9.4e+182): tmp = t_1 else: tmp = y + x return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(1.0 - Float64(t / z))) tmp = 0.0 if (y <= -3.2e+209) tmp = t_1; elseif (y <= -2.4e+156) tmp = Float64(t * Float64(y / a)); elseif ((y <= -1.45e+109) || !(y <= 9.4e+182)) tmp = t_1; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (1.0 - (t / z)); tmp = 0.0; if (y <= -3.2e+209) tmp = t_1; elseif (y <= -2.4e+156) tmp = t * (y / a); elseif ((y <= -1.45e+109) || ~((y <= 9.4e+182))) tmp = t_1; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e+209], t$95$1, If[LessEqual[y, -2.4e+156], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.45e+109], N[Not[LessEqual[y, 9.4e+182]], $MachinePrecision]], t$95$1, N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+209}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{+156}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{+109} \lor \neg \left(y \leq 9.4 \cdot 10^{+182}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if y < -3.1999999999999999e209 or -2.4000000000000001e156 < y < -1.45e109 or 9.39999999999999966e182 < y Initial program 59.2%
Taylor expanded in x around 0 49.0%
Taylor expanded in a around 0 28.3%
associate-/l*59.9%
div-sub60.0%
*-inverses60.0%
Simplified60.0%
if -3.1999999999999999e209 < y < -2.4000000000000001e156Initial program 76.1%
Taylor expanded in x around 0 68.6%
Taylor expanded in z around 0 51.4%
associate-/l*67.2%
Simplified67.2%
if -1.45e109 < y < 9.39999999999999966e182Initial program 92.8%
Taylor expanded in z around inf 70.0%
+-commutative70.0%
Simplified70.0%
Final simplification67.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -1.9e+35)
t_1
(if (<= z 1.12e-178)
(+ x (* y (/ (- t z) a)))
(if (<= z 1.6e+37) (+ x (* t (/ y (- a z)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -1.9e+35) {
tmp = t_1;
} else if (z <= 1.12e-178) {
tmp = x + (y * ((t - z) / a));
} else if (z <= 1.6e+37) {
tmp = x + (t * (y / (a - z)));
} 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 + (y * (z / (z - a)))
if (z <= (-1.9d+35)) then
tmp = t_1
else if (z <= 1.12d-178) then
tmp = x + (y * ((t - z) / a))
else if (z <= 1.6d+37) then
tmp = x + (t * (y / (a - z)))
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 + (y * (z / (z - a)));
double tmp;
if (z <= -1.9e+35) {
tmp = t_1;
} else if (z <= 1.12e-178) {
tmp = x + (y * ((t - z) / a));
} else if (z <= 1.6e+37) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -1.9e+35: tmp = t_1 elif z <= 1.12e-178: tmp = x + (y * ((t - z) / a)) elif z <= 1.6e+37: tmp = x + (t * (y / (a - z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -1.9e+35) tmp = t_1; elseif (z <= 1.12e-178) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); elseif (z <= 1.6e+37) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -1.9e+35) tmp = t_1; elseif (z <= 1.12e-178) tmp = x + (y * ((t - z) / a)); elseif (z <= 1.6e+37) tmp = x + (t * (y / (a - z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+35], t$95$1, If[LessEqual[z, 1.12e-178], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+37], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-178}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+37}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.9e35 or 1.60000000000000007e37 < z Initial program 71.7%
Taylor expanded in t around 0 68.8%
+-commutative68.8%
associate-/l*92.2%
Simplified92.2%
if -1.9e35 < z < 1.12e-178Initial program 96.0%
Taylor expanded in a around inf 84.9%
mul-1-neg84.9%
unsub-neg84.9%
associate-/l*87.7%
Simplified87.7%
if 1.12e-178 < z < 1.60000000000000007e37Initial program 92.6%
Taylor expanded in t around inf 87.2%
mul-1-neg87.2%
associate-/l*91.0%
distribute-rgt-neg-in91.0%
distribute-frac-neg291.0%
sub-neg91.0%
mul-1-neg91.0%
distribute-neg-in91.0%
mul-1-neg91.0%
remove-double-neg91.0%
Simplified91.0%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3e-24) (not (<= z 3.2e-40))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3e-24) || !(z <= 3.2e-40)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / 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 <= (-3d-24)) .or. (.not. (z <= 3.2d-40))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (y * (t / 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 <= -3e-24) || !(z <= 3.2e-40)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3e-24) or not (z <= 3.2e-40): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3e-24) || !(z <= 3.2e-40)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3e-24) || ~((z <= 3.2e-40))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3e-24], N[Not[LessEqual[z, 3.2e-40]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-24} \lor \neg \left(z \leq 3.2 \cdot 10^{-40}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.99999999999999995e-24 or 3.20000000000000002e-40 < z Initial program 77.2%
Taylor expanded in a around 0 65.4%
associate-/l*38.7%
div-sub38.7%
*-inverses38.7%
Simplified84.7%
if -2.99999999999999995e-24 < z < 3.20000000000000002e-40Initial program 94.2%
+-commutative94.2%
div-inv94.1%
fma-define94.1%
Applied egg-rr94.1%
Taylor expanded in z around 0 79.0%
*-commutative79.0%
associate-*r/84.1%
Simplified84.1%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.5e+35) (not (<= z 1.3e-31))) (+ x (* y (/ z (- z a)))) (+ x (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.5e+35) || !(z <= 1.3e-31)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * ((t - z) / 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.5d+35)) .or. (.not. (z <= 1.3d-31))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (y * ((t - z) / 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.5e+35) || !(z <= 1.3e-31)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * ((t - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.5e+35) or not (z <= 1.3e-31): tmp = x + (y * (z / (z - a))) else: tmp = x + (y * ((t - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.5e+35) || !(z <= 1.3e-31)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.5e+35) || ~((z <= 1.3e-31))) tmp = x + (y * (z / (z - a))); else tmp = x + (y * ((t - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e+35], N[Not[LessEqual[z, 1.3e-31]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+35} \lor \neg \left(z \leq 1.3 \cdot 10^{-31}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if z < -5.50000000000000001e35 or 1.29999999999999998e-31 < z Initial program 75.5%
Taylor expanded in t around 0 69.4%
+-commutative69.4%
associate-/l*89.6%
Simplified89.6%
if -5.50000000000000001e35 < z < 1.29999999999999998e-31Initial program 94.0%
Taylor expanded in a around inf 81.1%
mul-1-neg81.1%
unsub-neg81.1%
associate-/l*86.1%
Simplified86.1%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.65e+38) (not (<= z 4e+14))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.65e+38) || !(z <= 4e+14)) {
tmp = y + x;
} else {
tmp = x + (y * (t / 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.65d+38)) .or. (.not. (z <= 4d+14))) then
tmp = y + x
else
tmp = x + (y * (t / 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.65e+38) || !(z <= 4e+14)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.65e+38) or not (z <= 4e+14): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.65e+38) || !(z <= 4e+14)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.65e+38) || ~((z <= 4e+14))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.65e+38], N[Not[LessEqual[z, 4e+14]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+38} \lor \neg \left(z \leq 4 \cdot 10^{+14}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.65e38 or 4e14 < z Initial program 73.3%
Taylor expanded in z around inf 82.2%
+-commutative82.2%
Simplified82.2%
if -1.65e38 < z < 4e14Initial program 94.5%
+-commutative94.5%
div-inv94.5%
fma-define94.5%
Applied egg-rr94.5%
Taylor expanded in z around 0 75.1%
*-commutative75.1%
associate-*r/79.9%
Simplified79.9%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -6.8e-113) (not (<= x 3.2e-165))) (+ y x) (* y (/ t a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -6.8e-113) || !(x <= 3.2e-165)) {
tmp = y + x;
} else {
tmp = y * (t / 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 ((x <= (-6.8d-113)) .or. (.not. (x <= 3.2d-165))) then
tmp = y + x
else
tmp = y * (t / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -6.8e-113) || !(x <= 3.2e-165)) {
tmp = y + x;
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -6.8e-113) or not (x <= 3.2e-165): tmp = y + x else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -6.8e-113) || !(x <= 3.2e-165)) tmp = Float64(y + x); else tmp = Float64(y * Float64(t / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -6.8e-113) || ~((x <= 3.2e-165))) tmp = y + x; else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -6.8e-113], N[Not[LessEqual[x, 3.2e-165]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-113} \lor \neg \left(x \leq 3.2 \cdot 10^{-165}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if x < -6.8000000000000005e-113 or 3.20000000000000013e-165 < x Initial program 83.0%
Taylor expanded in z around inf 72.7%
+-commutative72.7%
Simplified72.7%
if -6.8000000000000005e-113 < x < 3.20000000000000013e-165Initial program 88.9%
+-commutative88.9%
associate-/l*99.7%
fma-define99.7%
Simplified99.7%
clear-num99.7%
inv-pow99.7%
Applied egg-rr99.7%
unpow-199.7%
Applied egg-rr99.7%
Taylor expanded in t around inf 54.9%
mul-1-neg54.9%
associate-/l*45.9%
distribute-lft-neg-in45.9%
Simplified45.9%
Taylor expanded in z around 0 41.5%
*-commutative41.5%
associate-*r/41.6%
Simplified41.6%
Final simplification64.6%
(FPCore (x y z t a) :precision binary64 (if (<= y -7e+70) y (if (<= y 2.06e+108) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -7e+70) {
tmp = y;
} else if (y <= 2.06e+108) {
tmp = x;
} else {
tmp = 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 (y <= (-7d+70)) then
tmp = y
else if (y <= 2.06d+108) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -7e+70) {
tmp = y;
} else if (y <= 2.06e+108) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -7e+70: tmp = y elif y <= 2.06e+108: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -7e+70) tmp = y; elseif (y <= 2.06e+108) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -7e+70) tmp = y; elseif (y <= 2.06e+108) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -7e+70], y, If[LessEqual[y, 2.06e+108], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+70}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.06 \cdot 10^{+108}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -7.00000000000000005e70 or 2.06000000000000009e108 < y Initial program 65.6%
Taylor expanded in x around 0 53.9%
Taylor expanded in z around inf 34.7%
if -7.00000000000000005e70 < y < 2.06000000000000009e108Initial program 94.8%
Taylor expanded in x around inf 64.9%
Final simplification54.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.5e+244) (* t (/ y a)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e+244) {
tmp = t * (y / a);
} else {
tmp = y + x;
}
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 (t <= (-6.5d+244)) then
tmp = t * (y / a)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e+244) {
tmp = t * (y / a);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.5e+244: tmp = t * (y / a) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.5e+244) tmp = Float64(t * Float64(y / a)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.5e+244) tmp = t * (y / a); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.5e+244], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+244}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -6.50000000000000011e244Initial program 64.3%
Taylor expanded in x around 0 58.1%
Taylor expanded in z around 0 51.6%
associate-/l*52.7%
Simplified52.7%
if -6.50000000000000011e244 < t Initial program 85.9%
Taylor expanded in z around inf 62.8%
+-commutative62.8%
Simplified62.8%
Final simplification62.2%
(FPCore (x y z t a) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a) {
return y + 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a) {
return y + x;
}
def code(x, y, z, t, a): return y + x
function code(x, y, z, t, a) return Float64(y + x) end
function tmp = code(x, y, z, t, a) tmp = y + x; end
code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 84.6%
Taylor expanded in z around inf 60.4%
+-commutative60.4%
Simplified60.4%
Final simplification60.4%
(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 84.6%
Taylor expanded in x around inf 48.0%
Final simplification48.0%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (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) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024039
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))