
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) z)))))
(if (<= z -4.5e-22)
t_1
(if (<= z -2.1e-75)
(+ x (* y (/ t a)))
(if (or (<= z -2.7e-154) (not (<= z 3.5e-58)))
t_1
(+ x (* y (/ (- t z) a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / z));
double tmp;
if (z <= -4.5e-22) {
tmp = t_1;
} else if (z <= -2.1e-75) {
tmp = x + (y * (t / a));
} else if ((z <= -2.7e-154) || !(z <= 3.5e-58)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (y * ((z - t) / z))
if (z <= (-4.5d-22)) then
tmp = t_1
else if (z <= (-2.1d-75)) then
tmp = x + (y * (t / a))
else if ((z <= (-2.7d-154)) .or. (.not. (z <= 3.5d-58))) then
tmp = t_1
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 t_1 = x + (y * ((z - t) / z));
double tmp;
if (z <= -4.5e-22) {
tmp = t_1;
} else if (z <= -2.1e-75) {
tmp = x + (y * (t / a));
} else if ((z <= -2.7e-154) || !(z <= 3.5e-58)) {
tmp = t_1;
} else {
tmp = x + (y * ((t - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / z)) tmp = 0 if z <= -4.5e-22: tmp = t_1 elif z <= -2.1e-75: tmp = x + (y * (t / a)) elif (z <= -2.7e-154) or not (z <= 3.5e-58): tmp = t_1 else: tmp = x + (y * ((t - z) / a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / z))) tmp = 0.0 if (z <= -4.5e-22) tmp = t_1; elseif (z <= -2.1e-75) tmp = Float64(x + Float64(y * Float64(t / a))); elseif ((z <= -2.7e-154) || !(z <= 3.5e-58)) tmp = t_1; else tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / z)); tmp = 0.0; if (z <= -4.5e-22) tmp = t_1; elseif (z <= -2.1e-75) tmp = x + (y * (t / a)); elseif ((z <= -2.7e-154) || ~((z <= 3.5e-58))) tmp = t_1; else tmp = x + (y * ((t - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e-22], t$95$1, If[LessEqual[z, -2.1e-75], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.7e-154], N[Not[LessEqual[z, 3.5e-58]], $MachinePrecision]], t$95$1, N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{z}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-75}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-154} \lor \neg \left(z \leq 3.5 \cdot 10^{-58}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if z < -4.49999999999999987e-22 or -2.1000000000000001e-75 < z < -2.69999999999999989e-154 or 3.4999999999999999e-58 < z Initial program 99.3%
Taylor expanded in a around 0 85.4%
if -4.49999999999999987e-22 < z < -2.1000000000000001e-75Initial program 99.9%
associate-*r/99.9%
Simplified99.9%
associate-/l*99.7%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 90.8%
*-commutative90.8%
associate-*r/90.8%
Simplified90.8%
if -2.69999999999999989e-154 < z < 3.4999999999999999e-58Initial program 96.4%
Taylor expanded in a around inf 91.3%
associate-*r/91.3%
neg-mul-191.3%
Simplified91.3%
Taylor expanded in z around 0 91.3%
+-commutative91.3%
mul-1-neg91.3%
sub-neg91.3%
div-sub91.3%
Simplified91.3%
Final simplification87.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) z)))))
(if (<= z -3.1e-24)
t_1
(if (<= z -7.6e-112)
(+ x (/ (* y t) a))
(if (<= z -2.7e-154)
(+ x (* (- z t) (/ y z)))
(if (<= z 2.45e-58) (+ x (* y (/ (- t z) a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / z));
double tmp;
if (z <= -3.1e-24) {
tmp = t_1;
} else if (z <= -7.6e-112) {
tmp = x + ((y * t) / a);
} else if (z <= -2.7e-154) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 2.45e-58) {
tmp = x + (y * ((t - z) / 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 - t) / z))
if (z <= (-3.1d-24)) then
tmp = t_1
else if (z <= (-7.6d-112)) then
tmp = x + ((y * t) / a)
else if (z <= (-2.7d-154)) then
tmp = x + ((z - t) * (y / z))
else if (z <= 2.45d-58) then
tmp = x + (y * ((t - z) / 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 - t) / z));
double tmp;
if (z <= -3.1e-24) {
tmp = t_1;
} else if (z <= -7.6e-112) {
tmp = x + ((y * t) / a);
} else if (z <= -2.7e-154) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 2.45e-58) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / z)) tmp = 0 if z <= -3.1e-24: tmp = t_1 elif z <= -7.6e-112: tmp = x + ((y * t) / a) elif z <= -2.7e-154: tmp = x + ((z - t) * (y / z)) elif z <= 2.45e-58: tmp = x + (y * ((t - z) / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / z))) tmp = 0.0 if (z <= -3.1e-24) tmp = t_1; elseif (z <= -7.6e-112) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (z <= -2.7e-154) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); elseif (z <= 2.45e-58) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / z)); tmp = 0.0; if (z <= -3.1e-24) tmp = t_1; elseif (z <= -7.6e-112) tmp = x + ((y * t) / a); elseif (z <= -2.7e-154) tmp = x + ((z - t) * (y / z)); elseif (z <= 2.45e-58) tmp = x + (y * ((t - z) / 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[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e-24], t$95$1, If[LessEqual[z, -7.6e-112], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.7e-154], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e-58], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{z}\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-112}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-154}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-58}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.1e-24 or 2.45000000000000015e-58 < z Initial program 99.9%
Taylor expanded in a around 0 88.5%
if -3.1e-24 < z < -7.59999999999999989e-112Initial program 99.8%
Taylor expanded in z around 0 72.6%
if -7.59999999999999989e-112 < z < -2.69999999999999989e-154Initial program 92.7%
+-commutative92.7%
fma-def92.7%
Simplified92.7%
Taylor expanded in a around 0 77.4%
+-commutative77.4%
associate-/l*70.3%
associate-/r/77.5%
Simplified77.5%
if -2.69999999999999989e-154 < z < 2.45000000000000015e-58Initial program 96.4%
Taylor expanded in a around inf 91.3%
associate-*r/91.3%
neg-mul-191.3%
Simplified91.3%
Taylor expanded in z around 0 91.3%
+-commutative91.3%
mul-1-neg91.3%
sub-neg91.3%
div-sub91.3%
Simplified91.3%
Final simplification87.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) z)))))
(if (<= z -4.4e-24)
t_1
(if (<= z -7.6e-112)
(+ x (/ 1.0 (/ a (* y t))))
(if (<= z -2.7e-154)
(+ x (* (- z t) (/ y z)))
(if (<= z 1.45e-57) (+ x (* y (/ (- t z) a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / z));
double tmp;
if (z <= -4.4e-24) {
tmp = t_1;
} else if (z <= -7.6e-112) {
tmp = x + (1.0 / (a / (y * t)));
} else if (z <= -2.7e-154) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 1.45e-57) {
tmp = x + (y * ((t - z) / 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 - t) / z))
if (z <= (-4.4d-24)) then
tmp = t_1
else if (z <= (-7.6d-112)) then
tmp = x + (1.0d0 / (a / (y * t)))
else if (z <= (-2.7d-154)) then
tmp = x + ((z - t) * (y / z))
else if (z <= 1.45d-57) then
tmp = x + (y * ((t - z) / 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 - t) / z));
double tmp;
if (z <= -4.4e-24) {
tmp = t_1;
} else if (z <= -7.6e-112) {
tmp = x + (1.0 / (a / (y * t)));
} else if (z <= -2.7e-154) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 1.45e-57) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / z)) tmp = 0 if z <= -4.4e-24: tmp = t_1 elif z <= -7.6e-112: tmp = x + (1.0 / (a / (y * t))) elif z <= -2.7e-154: tmp = x + ((z - t) * (y / z)) elif z <= 1.45e-57: tmp = x + (y * ((t - z) / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / z))) tmp = 0.0 if (z <= -4.4e-24) tmp = t_1; elseif (z <= -7.6e-112) tmp = Float64(x + Float64(1.0 / Float64(a / Float64(y * t)))); elseif (z <= -2.7e-154) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); elseif (z <= 1.45e-57) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / z)); tmp = 0.0; if (z <= -4.4e-24) tmp = t_1; elseif (z <= -7.6e-112) tmp = x + (1.0 / (a / (y * t))); elseif (z <= -2.7e-154) tmp = x + ((z - t) * (y / z)); elseif (z <= 1.45e-57) tmp = x + (y * ((t - z) / 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[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e-24], t$95$1, If[LessEqual[z, -7.6e-112], N[(x + N[(1.0 / N[(a / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.7e-154], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e-57], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{z}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-112}:\\
\;\;\;\;x + \frac{1}{\frac{a}{y \cdot t}}\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-154}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-57}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.40000000000000003e-24 or 1.45000000000000013e-57 < z Initial program 99.9%
Taylor expanded in a around 0 88.5%
if -4.40000000000000003e-24 < z < -7.59999999999999989e-112Initial program 99.8%
+-commutative99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in z around 0 72.6%
+-commutative72.6%
associate-/l*72.3%
Simplified72.3%
clear-num72.4%
inv-pow72.4%
associate-/l/72.7%
Applied egg-rr72.7%
unpow-172.7%
Simplified72.7%
if -7.59999999999999989e-112 < z < -2.69999999999999989e-154Initial program 92.7%
+-commutative92.7%
fma-def92.7%
Simplified92.7%
Taylor expanded in a around 0 77.4%
+-commutative77.4%
associate-/l*70.3%
associate-/r/77.5%
Simplified77.5%
if -2.69999999999999989e-154 < z < 1.45000000000000013e-57Initial program 96.4%
Taylor expanded in a around inf 91.3%
associate-*r/91.3%
neg-mul-191.3%
Simplified91.3%
Taylor expanded in z around 0 91.3%
+-commutative91.3%
mul-1-neg91.3%
sub-neg91.3%
div-sub91.3%
Simplified91.3%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.56e+15) (not (<= z 7.6e-61))) (+ x y) (+ x (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.56e+15) || !(z <= 7.6e-61)) {
tmp = x + y;
} 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 <= (-1.56d+15)) .or. (.not. (z <= 7.6d-61))) then
tmp = x + y
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 <= -1.56e+15) || !(z <= 7.6e-61)) {
tmp = x + y;
} else {
tmp = x + (y * ((t - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.56e+15) or not (z <= 7.6e-61): tmp = x + y else: tmp = x + (y * ((t - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.56e+15) || !(z <= 7.6e-61)) tmp = Float64(x + y); 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 <= -1.56e+15) || ~((z <= 7.6e-61))) tmp = x + y; else tmp = x + (y * ((t - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.56e+15], N[Not[LessEqual[z, 7.6e-61]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.56 \cdot 10^{+15} \lor \neg \left(z \leq 7.6 \cdot 10^{-61}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if z < -1.56e15 or 7.59999999999999961e-61 < z Initial program 99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around inf 83.9%
+-commutative83.9%
Simplified83.9%
if -1.56e15 < z < 7.59999999999999961e-61Initial program 96.7%
Taylor expanded in a around inf 82.4%
associate-*r/82.4%
neg-mul-182.4%
Simplified82.4%
Taylor expanded in z around 0 82.4%
+-commutative82.4%
mul-1-neg82.4%
sub-neg82.4%
div-sub82.4%
Simplified82.4%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e+46) (not (<= t 3e-56))) (- x (* t (/ y (- z a)))) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+46) || !(t <= 3e-56)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y / ((z - a) / z));
}
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 <= (-2.2d+46)) .or. (.not. (t <= 3d-56))) then
tmp = x - (t * (y / (z - a)))
else
tmp = x + (y / ((z - a) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+46) || !(t <= 3e-56)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e+46) or not (t <= 3e-56): tmp = x - (t * (y / (z - a))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e+46) || !(t <= 3e-56)) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.2e+46) || ~((t <= 3e-56))) tmp = x - (t * (y / (z - a))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e+46], N[Not[LessEqual[t, 3e-56]], $MachinePrecision]], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+46} \lor \neg \left(t \leq 3 \cdot 10^{-56}\right):\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -2.2e46 or 2.99999999999999989e-56 < t Initial program 97.0%
associate-*r/86.9%
Simplified86.9%
associate-/l*97.0%
associate-/r/98.0%
Applied egg-rr98.0%
Taylor expanded in t around inf 85.1%
*-commutative85.1%
associate-*l/88.7%
neg-mul-188.7%
distribute-rgt-neg-out88.7%
Simplified88.7%
if -2.2e46 < t < 2.99999999999999989e-56Initial program 99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around 0 81.1%
+-commutative81.1%
associate-/l*97.0%
Simplified97.0%
Final simplification92.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.8e+132) (+ x (* t (/ y a))) (if (<= t 3.1e+107) (+ x (/ y (/ (- z a) z))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8e+132) {
tmp = x + (t * (y / a));
} else if (t <= 3.1e+107) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x + (y * ((z - t) / z));
}
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 <= (-2.8d+132)) then
tmp = x + (t * (y / a))
else if (t <= 3.1d+107) then
tmp = x + (y / ((z - a) / z))
else
tmp = x + (y * ((z - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8e+132) {
tmp = x + (t * (y / a));
} else if (t <= 3.1e+107) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.8e+132: tmp = x + (t * (y / a)) elif t <= 3.1e+107: tmp = x + (y / ((z - a) / z)) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.8e+132) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (t <= 3.1e+107) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.8e+132) tmp = x + (t * (y / a)); elseif (t <= 3.1e+107) tmp = x + (y / ((z - a) / z)); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.8e+132], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e+107], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+132}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+107}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if t < -2.7999999999999999e132Initial program 92.3%
+-commutative92.3%
fma-def92.3%
Simplified92.3%
Taylor expanded in z around 0 66.5%
+-commutative66.5%
associate-/l*79.3%
Simplified79.3%
clear-num79.2%
associate-/r/79.2%
clear-num79.3%
Applied egg-rr79.3%
if -2.7999999999999999e132 < t < 3.10000000000000026e107Initial program 99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around 0 74.4%
+-commutative74.4%
associate-/l*89.8%
Simplified89.8%
if 3.10000000000000026e107 < t Initial program 97.7%
Taylor expanded in a around 0 81.7%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.6e+46) (- x (* t (/ y (- z a)))) (if (<= t 2.8e-56) (+ x (/ y (/ (- z a) z))) (- x (/ (* y t) (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.6e+46) {
tmp = x - (t * (y / (z - a)));
} else if (t <= 2.8e-56) {
tmp = x + (y / ((z - a) / z));
} 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 (t <= (-2.6d+46)) then
tmp = x - (t * (y / (z - a)))
else if (t <= 2.8d-56) then
tmp = x + (y / ((z - a) / z))
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 (t <= -2.6e+46) {
tmp = x - (t * (y / (z - a)));
} else if (t <= 2.8e-56) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x - ((y * t) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.6e+46: tmp = x - (t * (y / (z - a))) elif t <= 2.8e-56: tmp = x + (y / ((z - a) / z)) else: tmp = x - ((y * t) / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.6e+46) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); elseif (t <= 2.8e-56) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); else tmp = Float64(x - Float64(Float64(y * t) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.6e+46) tmp = x - (t * (y / (z - a))); elseif (t <= 2.8e-56) tmp = x + (y / ((z - a) / z)); else tmp = x - ((y * t) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.6e+46], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e-56], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+46}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-56}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot t}{z - a}\\
\end{array}
\end{array}
if t < -2.60000000000000013e46Initial program 94.3%
associate-*r/77.6%
Simplified77.6%
associate-/l*94.3%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 81.3%
*-commutative81.3%
associate-*l/92.7%
neg-mul-192.7%
distribute-rgt-neg-out92.7%
Simplified92.7%
if -2.60000000000000013e46 < t < 2.79999999999999993e-56Initial program 99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around 0 81.1%
+-commutative81.1%
associate-/l*97.0%
Simplified97.0%
if 2.79999999999999993e-56 < t Initial program 98.8%
Taylor expanded in t around inf 87.5%
associate-*r/87.5%
mul-1-neg87.5%
distribute-lft-neg-out87.5%
*-commutative87.5%
Simplified87.5%
Final simplification93.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.4e+15) (not (<= z 7.2e-68))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e+15) || !(z <= 7.2e-68)) {
tmp = x + y;
} 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 <= (-3.4d+15)) .or. (.not. (z <= 7.2d-68))) then
tmp = x + y
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 <= -3.4e+15) || !(z <= 7.2e-68)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.4e+15) or not (z <= 7.2e-68): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.4e+15) || !(z <= 7.2e-68)) tmp = Float64(x + y); 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 <= -3.4e+15) || ~((z <= 7.2e-68))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.4e+15], N[Not[LessEqual[z, 7.2e-68]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+15} \lor \neg \left(z \leq 7.2 \cdot 10^{-68}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.4e15 or 7.20000000000000015e-68 < z Initial program 99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around inf 82.9%
+-commutative82.9%
Simplified82.9%
if -3.4e15 < z < 7.20000000000000015e-68Initial program 96.7%
associate-*r/96.6%
Simplified96.6%
associate-/l*96.6%
associate-/r/95.2%
Applied egg-rr95.2%
Taylor expanded in z around 0 81.8%
*-commutative81.8%
associate-*r/80.5%
Simplified80.5%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.95e+14) (not (<= z 1e-67))) (+ x y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.95e+14) || !(z <= 1e-67)) {
tmp = x + y;
} 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.95d+14)) .or. (.not. (z <= 1d-67))) then
tmp = x + y
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.95e+14) || !(z <= 1e-67)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.95e+14) or not (z <= 1e-67): tmp = x + y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.95e+14) || !(z <= 1e-67)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.95e+14) || ~((z <= 1e-67))) tmp = x + y; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.95e+14], N[Not[LessEqual[z, 1e-67]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+14} \lor \neg \left(z \leq 10^{-67}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.95e14 or 9.99999999999999943e-68 < z Initial program 99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around inf 82.9%
+-commutative82.9%
Simplified82.9%
if -1.95e14 < z < 9.99999999999999943e-68Initial program 96.7%
Taylor expanded in z around 0 81.8%
Final simplification82.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -3e+203) x (if (<= a 1.5e+134) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3e+203) {
tmp = x;
} else if (a <= 1.5e+134) {
tmp = x + y;
} else {
tmp = 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 (a <= (-3d+203)) then
tmp = x
else if (a <= 1.5d+134) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3e+203) {
tmp = x;
} else if (a <= 1.5e+134) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3e+203: tmp = x elif a <= 1.5e+134: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3e+203) tmp = x; elseif (a <= 1.5e+134) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3e+203) tmp = x; elseif (a <= 1.5e+134) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3e+203], x, If[LessEqual[a, 1.5e+134], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+203}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+134}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3e203 or 1.49999999999999998e134 < a Initial program 100.0%
+-commutative100.0%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around 0 82.1%
if -3e203 < a < 1.49999999999999998e134Initial program 98.0%
+-commutative98.0%
fma-def98.0%
Simplified98.0%
Taylor expanded in z around inf 66.4%
+-commutative66.4%
Simplified66.4%
Final simplification69.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 98.4%
+-commutative98.4%
fma-def98.4%
Simplified98.4%
Taylor expanded in y around 0 54.9%
Final simplification54.9%
(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 2023334
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))