?

Average Accuracy: 99.9% → 99.9%
Time: 14.1s
Precision: binary64
Cost: 19648

?

\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
\[\mathsf{fma}\left(\log y, x, \left(\log t - z\right) - y\right) \]
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
(FPCore (x y z t) :precision binary64 (fma (log y) x (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
	return (((x * log(y)) - y) - z) + log(t);
}
double code(double x, double y, double z, double t) {
	return fma(log(y), x, ((log(t) - z) - y));
}
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t))
end
function code(x, y, z, t)
	return fma(log(y), x, Float64(Float64(log(t) - z) - y))
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[Log[y], $MachinePrecision] * x + N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\mathsf{fma}\left(\log y, x, \left(\log t - z\right) - y\right)

Error?

Derivation?

  1. Initial program 99.9%

    \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
  2. Simplified99.9%

    \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    Proof

    [Start]99.9

    \[ \left(\left(x \cdot \log y - y\right) - z\right) + \log t \]

    associate-+l- [=>]99.9

    \[ \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
  3. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, -\left(y + \left(z - \log t\right)\right)\right)} \]
    Proof

    [Start]99.9

    \[ \left(x \cdot \log y - y\right) - \left(z - \log t\right) \]

    associate--l- [=>]99.9

    \[ \color{blue}{x \cdot \log y - \left(y + \left(z - \log t\right)\right)} \]

    *-commutative [=>]99.9

    \[ \color{blue}{\log y \cdot x} - \left(y + \left(z - \log t\right)\right) \]

    fma-neg [=>]99.9

    \[ \color{blue}{\mathsf{fma}\left(\log y, x, -\left(y + \left(z - \log t\right)\right)\right)} \]
  4. Final simplification99.9%

    \[\leadsto \mathsf{fma}\left(\log y, x, \left(\log t - z\right) - y\right) \]

Alternatives

Alternative 1
Accuracy97.6%
Cost26953
\[\begin{array}{l} t_1 := \left(\log y \cdot x - y\right) - z\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+17} \lor \neg \left(t_1 \leq 5 \cdot 10^{-13}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\log \left(\frac{t}{e^{y + z}}\right)\\ \end{array} \]
Alternative 2
Accuracy98.5%
Cost26889
\[\begin{array}{l} t_1 := \log y \cdot x - y\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+17} \lor \neg \left(t_1 \leq 2 \cdot 10^{-18}\right):\\ \;\;\;\;t_1 - z\\ \mathbf{else}:\\ \;\;\;\;\left(\log \left(t \cdot {y}^{x}\right) - z\right) - y\\ \end{array} \]
Alternative 3
Accuracy98.7%
Cost20425
\[\begin{array}{l} t_1 := \log y \cdot x - y\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+17} \lor \neg \left(t_1 \leq 2 \cdot 10^{-18}\right):\\ \;\;\;\;t_1 - z\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \]
Alternative 4
Accuracy99.9%
Cost13376
\[\log t + \left(\left(\log y \cdot x - y\right) - z\right) \]
Alternative 5
Accuracy69.6%
Cost7912
\[\begin{array}{l} t_1 := \log y \cdot x\\ t_2 := \log t - y\\ t_3 := \left(-z\right) - y\\ \mathbf{if}\;x \leq -1.75 \cdot 10^{+149}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{+135}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{+106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-17}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-82}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2.8 \cdot 10^{-244}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-219}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-101}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-66}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{+119}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Accuracy68.6%
Cost7648
\[\begin{array}{l} t_1 := \log y \cdot x\\ t_2 := \left(-z\right) - y\\ \mathbf{if}\;x \leq -3.7 \cdot 10^{+147}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1 \cdot 10^{+137}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -6.3 \cdot 10^{+106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-18}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.1 \cdot 10^{-81}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-289}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-49}:\\ \;\;\;\;\log t - z\\ \mathbf{elif}\;x \leq 1.26 \cdot 10^{+120}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Accuracy70.6%
Cost7384
\[\begin{array}{l} t_1 := \log y \cdot x\\ t_2 := \left(-z\right) - y\\ \mathbf{if}\;x \leq -1.1 \cdot 10^{+148}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{+137}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{+106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-101}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-72}:\\ \;\;\;\;\log t\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+119}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Accuracy84.3%
Cost7249
\[\begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -3.4 \cdot 10^{+147}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.72 \cdot 10^{+137}:\\ \;\;\;\;\left(-z\right) - y\\ \mathbf{elif}\;x \leq -6.6 \cdot 10^{+106} \lor \neg \left(x \leq 3.6 \cdot 10^{+120}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \]
Alternative 9
Accuracy89.7%
Cost6985
\[\begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{+18} \lor \neg \left(x \leq 8.6 \cdot 10^{+86}\right):\\ \;\;\;\;\log y \cdot x - y\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \]
Alternative 10
Accuracy89.5%
Cost6985
\[\begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+41} \lor \neg \left(x \leq 1.5 \cdot 10^{+81}\right):\\ \;\;\;\;\log y \cdot x - z\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \]
Alternative 11
Accuracy57.1%
Cost6729
\[\begin{array}{l} \mathbf{if}\;x \leq 3.8 \cdot 10^{-102} \lor \neg \left(x \leq 8.2 \cdot 10^{-72}\right):\\ \;\;\;\;\left(-z\right) - y\\ \mathbf{else}:\\ \;\;\;\;\log t\\ \end{array} \]
Alternative 12
Accuracy47.8%
Cost260
\[\begin{array}{l} \mathbf{if}\;y \leq 7.4 \cdot 10^{+106}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \]
Alternative 13
Accuracy58.0%
Cost256
\[\left(-z\right) - y \]
Alternative 14
Accuracy30.4%
Cost128
\[-y \]

Error

Reproduce?

herbie shell --seed 2023138 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
  :precision binary64
  (+ (- (- (* x (log y)) y) z) (log t)))