
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - 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 - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - 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 - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (- y) (* (- z t) (/ 1.0 (- t a))) x))
double code(double x, double y, double z, double t, double a) {
return fma(-y, ((z - t) * (1.0 / (t - a))), x);
}
function code(x, y, z, t, a) return fma(Float64(-y), Float64(Float64(z - t) * Float64(1.0 / Float64(t - a))), x) end
code[x_, y_, z_, t_, a_] := N[((-y) * N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-y, \left(z - t\right) \cdot \frac{1}{t - a}, x\right)
\end{array}
Initial program 86.2%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lower-fma.f64N/A
Applied egg-rr97.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -6.4e-7)
(fma (- z t) (/ y a) x)
(if (<= a 2.1e-137)
(fma y (- 1.0 (/ z t)) x)
(if (<= a 1.7e+138) (fma y (/ t (- t a)) x) (fma y (/ (- z t) a) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.4e-7) {
tmp = fma((z - t), (y / a), x);
} else if (a <= 2.1e-137) {
tmp = fma(y, (1.0 - (z / t)), x);
} else if (a <= 1.7e+138) {
tmp = fma(y, (t / (t - a)), x);
} else {
tmp = fma(y, ((z - t) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.4e-7) tmp = fma(Float64(z - t), Float64(y / a), x); elseif (a <= 2.1e-137) tmp = fma(y, Float64(1.0 - Float64(z / t)), x); elseif (a <= 1.7e+138) tmp = fma(y, Float64(t / Float64(t - a)), x); else tmp = fma(y, Float64(Float64(z - t) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.4e-7], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 2.1e-137], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.7e+138], N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.4 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\mathbf{elif}\;a \leq 2.1 \cdot 10^{-137}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+138}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{t - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\end{array}
\end{array}
if a < -6.4000000000000001e-7Initial program 86.2%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lower-fma.f64N/A
Applied egg-rr99.8%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6487.8
Simplified87.8%
if -6.4000000000000001e-7 < a < 2.09999999999999992e-137Initial program 87.8%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6486.0
Simplified86.0%
if 2.09999999999999992e-137 < a < 1.70000000000000006e138Initial program 84.1%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lower-fma.f64N/A
Applied egg-rr96.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6480.8
Simplified80.8%
if 1.70000000000000006e138 < a Initial program 84.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6497.0
Simplified97.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- z t) a) x)))
(if (<= a -6.2e-7)
t_1
(if (<= a 3.9e-138)
(fma y (- 1.0 (/ z t)) x)
(if (<= a 3e+133) (fma y (/ t (- t a)) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((z - t) / a), x);
double tmp;
if (a <= -6.2e-7) {
tmp = t_1;
} else if (a <= 3.9e-138) {
tmp = fma(y, (1.0 - (z / t)), x);
} else if (a <= 3e+133) {
tmp = fma(y, (t / (t - a)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(z - t) / a), x) tmp = 0.0 if (a <= -6.2e-7) tmp = t_1; elseif (a <= 3.9e-138) tmp = fma(y, Float64(1.0 - Float64(z / t)), x); elseif (a <= 3e+133) tmp = fma(y, Float64(t / Float64(t - a)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -6.2e-7], t$95$1, If[LessEqual[a, 3.9e-138], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 3e+133], N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{if}\;a \leq -6.2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.9 \cdot 10^{-138}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{elif}\;a \leq 3 \cdot 10^{+133}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{t - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.1999999999999999e-7 or 3.00000000000000007e133 < a Initial program 85.7%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6490.8
Simplified90.8%
if -6.1999999999999999e-7 < a < 3.8999999999999999e-138Initial program 87.8%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6486.0
Simplified86.0%
if 3.8999999999999999e-138 < a < 3.00000000000000007e133Initial program 84.1%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lower-fma.f64N/A
Applied egg-rr96.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6480.8
Simplified80.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ t (- t a)) x))) (if (<= t -4.5e-57) t_1 (if (<= t 7.2e-36) (fma z (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (t / (t - a)), x);
double tmp;
if (t <= -4.5e-57) {
tmp = t_1;
} else if (t <= 7.2e-36) {
tmp = fma(z, (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(t / Float64(t - a)), x) tmp = 0.0 if (t <= -4.5e-57) tmp = t_1; elseif (t <= 7.2e-36) tmp = fma(z, Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -4.5e-57], t$95$1, If[LessEqual[t, 7.2e-36], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{t}{t - a}, x\right)\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-36}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.49999999999999973e-57 or 7.20000000000000064e-36 < t Initial program 80.0%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lower-fma.f64N/A
Applied egg-rr99.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6485.4
Simplified85.4%
if -4.49999999999999973e-57 < t < 7.20000000000000064e-36Initial program 95.2%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lower-fma.f64N/A
Applied egg-rr93.3%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6480.2
Simplified80.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (- 1.0 (/ z t)) x))) (if (<= t -3.8e-59) t_1 (if (<= t 1.85e-29) (fma z (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (1.0 - (z / t)), x);
double tmp;
if (t <= -3.8e-59) {
tmp = t_1;
} else if (t <= 1.85e-29) {
tmp = fma(z, (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(1.0 - Float64(z / t)), x) tmp = 0.0 if (t <= -3.8e-59) tmp = t_1; elseif (t <= 1.85e-29) tmp = fma(z, Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -3.8e-59], t$95$1, If[LessEqual[t, 1.85e-29], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.79999999999999983e-59 or 1.8499999999999999e-29 < t Initial program 79.6%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6484.1
Simplified84.1%
if -3.79999999999999983e-59 < t < 1.8499999999999999e-29Initial program 95.4%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lower-fma.f64N/A
Applied egg-rr93.5%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6479.9
Simplified79.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.55e+15) (+ y x) (if (<= t 3e-28) (fma z (/ y a) x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.55e+15) {
tmp = y + x;
} else if (t <= 3e-28) {
tmp = fma(z, (y / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.55e+15) tmp = Float64(y + x); elseif (t <= 3e-28) tmp = fma(z, Float64(y / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.55e+15], N[(y + x), $MachinePrecision], If[LessEqual[t, 3e-28], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+15}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.55e15 or 3.00000000000000003e-28 < t Initial program 76.0%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6478.7
Simplified78.7%
if -1.55e15 < t < 3.00000000000000003e-28Initial program 96.1%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lower-fma.f64N/A
Applied egg-rr94.6%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6478.2
Simplified78.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.8e+14) (+ y x) (if (<= t 4.2e-27) (fma y (/ z a) x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8e+14) {
tmp = y + x;
} else if (t <= 4.2e-27) {
tmp = fma(y, (z / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.8e+14) tmp = Float64(y + x); elseif (t <= 4.2e-27) tmp = fma(y, Float64(z / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.8e+14], N[(y + x), $MachinePrecision], If[LessEqual[t, 4.2e-27], N[(y * N[(z / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+14}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-27}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.8e14 or 4.20000000000000031e-27 < t Initial program 76.0%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6478.7
Simplified78.7%
if -2.8e14 < t < 4.20000000000000031e-27Initial program 96.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6476.5
Simplified76.5%
(FPCore (x y z t a) :precision binary64 (fma (/ y (- a t)) (- z t) x))
double code(double x, double y, double z, double t, double a) {
return fma((y / (a - t)), (z - t), x);
}
function code(x, y, z, t, a) return fma(Float64(y / Float64(a - t)), Float64(z - t), x) end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)
\end{array}
Initial program 86.2%
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6496.7
Applied egg-rr96.7%
(FPCore (x y z t a) :precision binary64 (if (<= z 5.2e+237) (+ y x) (* y (/ z a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 5.2e+237) {
tmp = y + x;
} else {
tmp = 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) :: tmp
if (z <= 5.2d+237) then
tmp = y + x
else
tmp = y * (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.2e+237) {
tmp = y + x;
} else {
tmp = y * (z / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 5.2e+237: tmp = y + x else: tmp = y * (z / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 5.2e+237) tmp = Float64(y + x); else tmp = Float64(y * Float64(z / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 5.2e+237) tmp = y + x; else tmp = y * (z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 5.2e+237], N[(y + x), $MachinePrecision], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.2 \cdot 10^{+237}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if z < 5.20000000000000005e237Initial program 86.3%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6464.5
Simplified64.5%
if 5.20000000000000005e237 < z Initial program 82.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6473.1
Simplified73.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f6455.5
Simplified55.5%
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6464.1
Applied egg-rr64.1%
Final simplification64.5%
(FPCore (x y z t a) :precision binary64 (if (<= z 3.45e+242) (+ y x) (* z (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 3.45e+242) {
tmp = y + x;
} else {
tmp = z * (y / 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.45d+242) then
tmp = y + x
else
tmp = z * (y / 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.45e+242) {
tmp = y + x;
} else {
tmp = z * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 3.45e+242: tmp = y + x else: tmp = z * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 3.45e+242) tmp = Float64(y + x); else tmp = Float64(z * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 3.45e+242) tmp = y + x; else tmp = z * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 3.45e+242], N[(y + x), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.45 \cdot 10^{+242}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < 3.45000000000000009e242Initial program 86.3%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6464.5
Simplified64.5%
if 3.45000000000000009e242 < z Initial program 82.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6473.1
Simplified73.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f6455.5
Simplified55.5%
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
lift-*.f64N/A
associate-*r*N/A
associate-/r/N/A
clear-numN/A
lift-/.f64N/A
lower-*.f6455.5
Applied egg-rr55.5%
Final simplification64.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 86.2%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6462.5
Simplified62.5%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024207
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
(+ x (/ (* y (- z t)) (- a t))))