
(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 13 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 -5e+302) (not (<= t_2 2e+287)))
(+ x (/ -1.0 (/ (/ (- z a) y) (- t z))))
(- 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 <= -5e+302) || !(t_2 <= 2e+287)) {
tmp = x + (-1.0 / (((z - a) / y) / (t - z)));
} else {
tmp = x - (t_1 / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (z - t)
t_2 = t_1 / (z - a)
if ((t_2 <= (-5d+302)) .or. (.not. (t_2 <= 2d+287))) then
tmp = x + ((-1.0d0) / (((z - a) / y) / (t - z)))
else
tmp = x - (t_1 / (a - z))
end if
code = tmp
end function
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 <= -5e+302) || !(t_2 <= 2e+287)) {
tmp = x + (-1.0 / (((z - a) / y) / (t - z)));
} 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 <= -5e+302) or not (t_2 <= 2e+287): tmp = x + (-1.0 / (((z - a) / y) / (t - z))) 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 <= -5e+302) || !(t_2 <= 2e+287)) tmp = Float64(x + Float64(-1.0 / Float64(Float64(Float64(z - a) / y) / Float64(t - z)))); 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 <= -5e+302) || ~((t_2 <= 2e+287))) tmp = x + (-1.0 / (((z - a) / y) / (t - z))); 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, -5e+302], N[Not[LessEqual[t$95$2, 2e+287]], $MachinePrecision]], N[(x + N[(-1.0 / N[(N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision] / N[(t - z), $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 -5 \cdot 10^{+302} \lor \neg \left(t\_2 \leq 2 \cdot 10^{+287}\right):\\
\;\;\;\;x + \frac{-1}{\frac{\frac{z - a}{y}}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t\_1}{a - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -5e302 or 2.0000000000000002e287 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 41.6%
clear-num41.6%
inv-pow41.6%
Applied egg-rr41.6%
unpow-141.6%
associate-/r*99.8%
Simplified99.8%
if -5e302 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000002e287Initial program 99.9%
Final simplification99.9%
(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.2%
+-commutative84.2%
associate-/l*98.1%
fma-define98.1%
Simplified98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (- z t))) (t_2 (/ t_1 (- z a))))
(if (or (<= t_2 -5e+302) (not (<= t_2 2e+287)))
(* (- 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 <= -5e+302) || !(t_2 <= 2e+287)) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = x - (t_1 / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (z - t)
t_2 = t_1 / (z - a)
if ((t_2 <= (-5d+302)) .or. (.not. (t_2 <= 2d+287))) then
tmp = (z - t) * (y / (z - a))
else
tmp = x - (t_1 / (a - z))
end if
code = tmp
end function
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 <= -5e+302) || !(t_2 <= 2e+287)) {
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 <= -5e+302) or not (t_2 <= 2e+287): 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 <= -5e+302) || !(t_2 <= 2e+287)) 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 <= -5e+302) || ~((t_2 <= 2e+287))) 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, -5e+302], N[Not[LessEqual[t$95$2, 2e+287]], $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 -5 \cdot 10^{+302} \lor \neg \left(t\_2 \leq 2 \cdot 10^{+287}\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)) < -5e302 or 2.0000000000000002e287 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 41.6%
+-commutative41.6%
associate-/l*98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in y around -inf 41.6%
*-commutative41.6%
associate-*r/87.7%
*-commutative87.7%
Applied egg-rr87.7%
if -5e302 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000002e287Initial program 99.9%
Final simplification96.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 -2e-53) (not (<= t_1 2e+185)))
(* (- z t) (/ y (- z a)))
(+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -2e-53) || !(t_1 <= 2e+185)) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = x + (y * (z / (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 = (y * (z - t)) / (z - a)
if ((t_1 <= (-2d-53)) .or. (.not. (t_1 <= 2d+185))) then
tmp = (z - t) * (y / (z - a))
else
tmp = x + (y * (z / (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 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -2e-53) || !(t_1 <= 2e+185)) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -2e-53) or not (t_1 <= 2e+185): tmp = (z - t) * (y / (z - a)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= -2e-53) || !(t_1 <= 2e+185)) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -2e-53) || ~((t_1 <= 2e+185))) tmp = (z - t) * (y / (z - a)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-53], N[Not[LessEqual[t$95$1, 2e+185]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-53} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+185}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -2.00000000000000006e-53 or 2e185 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 63.3%
+-commutative63.3%
associate-/l*97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in y around -inf 55.7%
*-commutative55.7%
associate-*r/82.1%
*-commutative82.1%
Applied egg-rr82.1%
if -2.00000000000000006e-53 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2e185Initial program 99.9%
Taylor expanded in t around 0 93.8%
associate-/l*93.9%
Simplified93.9%
Final simplification88.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (<= t_1 -2e-53)
(/ (- z t) (/ (- z a) y))
(if (<= t_1 2e+185)
(+ x (* y (/ z (- z a))))
(* (- z t) (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -2e-53) {
tmp = (z - t) / ((z - a) / y);
} else if (t_1 <= 2e+185) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = (z - t) * (y / (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 = (y * (z - t)) / (z - a)
if (t_1 <= (-2d-53)) then
tmp = (z - t) / ((z - a) / y)
else if (t_1 <= 2d+185) then
tmp = x + (y * (z / (z - a)))
else
tmp = (z - t) * (y / (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 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -2e-53) {
tmp = (z - t) / ((z - a) / y);
} else if (t_1 <= 2e+185) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = (z - t) * (y / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if t_1 <= -2e-53: tmp = (z - t) / ((z - a) / y) elif t_1 <= 2e+185: tmp = x + (y * (z / (z - a))) else: tmp = (z - t) * (y / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if (t_1 <= -2e-53) tmp = Float64(Float64(z - t) / Float64(Float64(z - a) / y)); elseif (t_1 <= 2e+185) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if (t_1 <= -2e-53) tmp = (z - t) / ((z - a) / y); elseif (t_1 <= 2e+185) tmp = x + (y * (z / (z - a))); else tmp = (z - t) * (y / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-53], N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+185], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-53}:\\
\;\;\;\;\frac{z - t}{\frac{z - a}{y}}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+185}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -2.00000000000000006e-53Initial program 70.4%
+-commutative70.4%
associate-/l*97.3%
fma-define97.3%
Simplified97.3%
Taylor expanded in y around -inf 60.6%
*-commutative60.6%
associate-*r/85.3%
*-commutative85.3%
Applied egg-rr85.3%
*-commutative85.3%
clear-num85.0%
un-div-inv85.5%
Applied egg-rr85.5%
if -2.00000000000000006e-53 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2e185Initial program 99.9%
Taylor expanded in t around 0 93.8%
associate-/l*93.9%
Simplified93.9%
if 2e185 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 47.6%
+-commutative47.6%
associate-/l*97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in y around -inf 44.9%
*-commutative44.9%
associate-*r/74.9%
*-commutative74.9%
Applied egg-rr74.9%
Final simplification88.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- z t) (/ y (- z a)))))
(if (<= y -4.4e-30)
t_1
(if (<= y -6e-137)
(+ x (/ (* y t) a))
(if (<= y 9.6e+111) (+ y x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * (y / (z - a));
double tmp;
if (y <= -4.4e-30) {
tmp = t_1;
} else if (y <= -6e-137) {
tmp = x + ((y * t) / a);
} else if (y <= 9.6e+111) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (z - t) * (y / (z - a))
if (y <= (-4.4d-30)) then
tmp = t_1
else if (y <= (-6d-137)) then
tmp = x + ((y * t) / a)
else if (y <= 9.6d+111) then
tmp = y + x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * (y / (z - a));
double tmp;
if (y <= -4.4e-30) {
tmp = t_1;
} else if (y <= -6e-137) {
tmp = x + ((y * t) / a);
} else if (y <= 9.6e+111) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) * (y / (z - a)) tmp = 0 if y <= -4.4e-30: tmp = t_1 elif y <= -6e-137: tmp = x + ((y * t) / a) elif y <= 9.6e+111: tmp = y + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) * Float64(y / Float64(z - a))) tmp = 0.0 if (y <= -4.4e-30) tmp = t_1; elseif (y <= -6e-137) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (y <= 9.6e+111) tmp = Float64(y + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) * (y / (z - a)); tmp = 0.0; if (y <= -4.4e-30) tmp = t_1; elseif (y <= -6e-137) tmp = x + ((y * t) / a); elseif (y <= 9.6e+111) tmp = y + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.4e-30], t$95$1, If[LessEqual[y, -6e-137], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.6e+111], N[(y + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-137}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{+111}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.39999999999999967e-30 or 9.60000000000000023e111 < y Initial program 65.3%
+-commutative65.3%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around -inf 52.3%
*-commutative52.3%
associate-*r/78.4%
*-commutative78.4%
Applied egg-rr78.4%
if -4.39999999999999967e-30 < y < -5.9999999999999996e-137Initial program 99.9%
Taylor expanded in z around 0 83.8%
if -5.9999999999999996e-137 < y < 9.60000000000000023e111Initial program 98.4%
+-commutative98.4%
associate-/l*96.9%
fma-define96.8%
Simplified96.8%
Taylor expanded in z around inf 86.2%
+-commutative86.2%
Simplified86.2%
Final simplification82.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.5e+79) (not (<= t 1.48e-12))) (+ x (* t (/ y (- a z)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.5e+79) || !(t <= 1.48e-12)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (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 <= (-7.5d+79)) .or. (.not. (t <= 1.48d-12))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y * (z / (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 <= -7.5e+79) || !(t <= 1.48e-12)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.5e+79) or not (t <= 1.48e-12): tmp = x + (t * (y / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.5e+79) || !(t <= 1.48e-12)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.5e+79) || ~((t <= 1.48e-12))) tmp = x + (t * (y / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.5e+79], N[Not[LessEqual[t, 1.48e-12]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+79} \lor \neg \left(t \leq 1.48 \cdot 10^{-12}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -7.49999999999999967e79 or 1.47999999999999995e-12 < t Initial program 84.9%
Taylor expanded in t around inf 82.9%
mul-1-neg82.9%
associate-/l*90.6%
distribute-rgt-neg-in90.6%
distribute-frac-neg290.6%
Simplified90.6%
if -7.49999999999999967e79 < t < 1.47999999999999995e-12Initial program 83.6%
Taylor expanded in t around 0 76.1%
associate-/l*91.9%
Simplified91.9%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e-57) (not (<= z 1.42e+76))) (+ y x) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e-57) || !(z <= 1.42e+76)) {
tmp = y + x;
} else {
tmp = x + (t / (a / 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 <= (-1.35d-57)) .or. (.not. (z <= 1.42d+76))) then
tmp = y + x
else
tmp = x + (t / (a / 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 <= -1.35e-57) || !(z <= 1.42e+76)) {
tmp = y + x;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e-57) or not (z <= 1.42e+76): tmp = y + x else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e-57) || !(z <= 1.42e+76)) tmp = Float64(y + x); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.35e-57) || ~((z <= 1.42e+76))) tmp = y + x; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e-57], N[Not[LessEqual[z, 1.42e+76]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-57} \lor \neg \left(z \leq 1.42 \cdot 10^{+76}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.3500000000000001e-57 or 1.41999999999999996e76 < z Initial program 73.7%
+-commutative73.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -1.3500000000000001e-57 < z < 1.41999999999999996e76Initial program 95.4%
+-commutative95.4%
associate-/l*96.1%
fma-define96.1%
Simplified96.1%
Taylor expanded in z around 0 83.0%
+-commutative83.0%
associate-/l*82.9%
Simplified82.9%
Taylor expanded in t around 0 83.0%
associate-*l/80.7%
associate-/r/83.2%
Simplified83.2%
Final simplification80.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e-57) (not (<= z 1.72e+77))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e-57) || !(z <= 1.72e+77)) {
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.35d-57)) .or. (.not. (z <= 1.72d+77))) 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.35e-57) || !(z <= 1.72e+77)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e-57) or not (z <= 1.72e+77): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e-57) || !(z <= 1.72e+77)) tmp = Float64(y + x); 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.35e-57) || ~((z <= 1.72e+77))) 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.35e-57], N[Not[LessEqual[z, 1.72e+77]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-57} \lor \neg \left(z \leq 1.72 \cdot 10^{+77}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.3500000000000001e-57 or 1.71999999999999991e77 < z Initial program 73.7%
+-commutative73.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -1.3500000000000001e-57 < z < 1.71999999999999991e77Initial program 95.4%
Taylor expanded in z around 0 83.0%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.6e+99) (not (<= y 1.4e+224))) (* y (/ (- z t) z)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.6e+99) || !(y <= 1.4e+224)) {
tmp = y * ((z - t) / z);
} 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 ((y <= (-1.6d+99)) .or. (.not. (y <= 1.4d+224))) then
tmp = y * ((z - t) / z)
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 ((y <= -1.6e+99) || !(y <= 1.4e+224)) {
tmp = y * ((z - t) / z);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.6e+99) or not (y <= 1.4e+224): tmp = y * ((z - t) / z) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.6e+99) || !(y <= 1.4e+224)) tmp = Float64(y * Float64(Float64(z - t) / z)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.6e+99) || ~((y <= 1.4e+224))) tmp = y * ((z - t) / z); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.6e+99], N[Not[LessEqual[y, 1.4e+224]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+99} \lor \neg \left(y \leq 1.4 \cdot 10^{+224}\right):\\
\;\;\;\;y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if y < -1.6e99 or 1.40000000000000004e224 < y Initial program 58.6%
+-commutative58.6%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around -inf 47.9%
Taylor expanded in a around 0 33.9%
associate-/l*60.3%
Simplified60.3%
if -1.6e99 < y < 1.40000000000000004e224Initial program 92.6%
+-commutative92.6%
associate-/l*97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in z around inf 71.5%
+-commutative71.5%
Simplified71.5%
Final simplification68.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.18e-57) (not (<= z 1.42e+76))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.18e-57) || !(z <= 1.42e+76)) {
tmp = y + x;
} 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 ((z <= (-1.18d-57)) .or. (.not. (z <= 1.42d+76))) then
tmp = y + x
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 ((z <= -1.18e-57) || !(z <= 1.42e+76)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.18e-57) or not (z <= 1.42e+76): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.18e-57) || !(z <= 1.42e+76)) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.18e-57) || ~((z <= 1.42e+76))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.18e-57], N[Not[LessEqual[z, 1.42e+76]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.18 \cdot 10^{-57} \lor \neg \left(z \leq 1.42 \cdot 10^{+76}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.18e-57 or 1.41999999999999996e76 < z Initial program 73.7%
+-commutative73.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -1.18e-57 < z < 1.41999999999999996e76Initial program 95.4%
+-commutative95.4%
associate-/l*96.1%
fma-define96.1%
Simplified96.1%
Taylor expanded in y around 0 55.2%
Final simplification66.7%
(FPCore (x y z t a) :precision binary64 (if (<= y 5.5e+211) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 5.5e+211) {
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 <= 5.5d+211) 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 <= 5.5e+211) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 5.5e+211: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 5.5e+211) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 5.5e+211) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 5.5e+211], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.5 \cdot 10^{+211}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 5.49999999999999988e211Initial program 86.7%
+-commutative86.7%
associate-/l*98.0%
fma-define97.9%
Simplified97.9%
Taylor expanded in y around 0 59.2%
if 5.49999999999999988e211 < y Initial program 44.8%
+-commutative44.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around -inf 44.8%
Taylor expanded in z around inf 56.0%
(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.2%
+-commutative84.2%
associate-/l*98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in y around 0 55.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 2024132
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))