
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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 - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\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 x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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 - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x t) (/ (- y a) z) t)))
(if (<= z -9.5e+228)
t_1
(if (<= z 7.4e+164) (fma (- t x) (/ (- y z) (- a z)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x - t), ((y - a) / z), t);
double tmp;
if (z <= -9.5e+228) {
tmp = t_1;
} else if (z <= 7.4e+164) {
tmp = fma((t - x), ((y - z) / (a - z)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x - t), Float64(Float64(y - a) / z), t) tmp = 0.0 if (z <= -9.5e+228) tmp = t_1; elseif (z <= 7.4e+164) tmp = fma(Float64(t - x), Float64(Float64(y - z) / Float64(a - z)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -9.5e+228], t$95$1, If[LessEqual[z, 7.4e+164], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+228}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+164}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.50000000000000046e228 or 7.4000000000000001e164 < z Initial program 18.3%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified95.0%
if -9.50000000000000046e228 < z < 7.4000000000000001e164Initial program 79.3%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6492.3
Applied egg-rr92.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma t (/ (- y z) (- a z)) x)) (t_2 (fma x (/ (- y a) z) t)))
(if (<= z -9.5e+228)
t_2
(if (<= z -2.75e-129)
t_1
(if (<= z 3.2e-140)
(fma y (/ (- t x) a) x)
(if (<= z 6.2e+164) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, ((y - z) / (a - z)), x);
double t_2 = fma(x, ((y - a) / z), t);
double tmp;
if (z <= -9.5e+228) {
tmp = t_2;
} else if (z <= -2.75e-129) {
tmp = t_1;
} else if (z <= 3.2e-140) {
tmp = fma(y, ((t - x) / a), x);
} else if (z <= 6.2e+164) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(Float64(y - z) / Float64(a - z)), x) t_2 = fma(x, Float64(Float64(y - a) / z), t) tmp = 0.0 if (z <= -9.5e+228) tmp = t_2; elseif (z <= -2.75e-129) tmp = t_1; elseif (z <= 3.2e-140) tmp = fma(y, Float64(Float64(t - x) / a), x); elseif (z <= 6.2e+164) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -9.5e+228], t$95$2, If[LessEqual[z, -2.75e-129], t$95$1, If[LessEqual[z, 3.2e-140], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 6.2e+164], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \frac{y - z}{a - z}, x\right)\\
t_2 := \mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+228}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.75 \cdot 10^{-129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-140}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -9.50000000000000046e228 or 6.2000000000000003e164 < z Initial program 18.3%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified95.0%
Taylor expanded in x around inf
Simplified89.3%
if -9.50000000000000046e228 < z < -2.75000000000000012e-129 or 3.2000000000000001e-140 < z < 6.2000000000000003e164Initial program 73.1%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6491.7
Applied egg-rr91.7%
Taylor expanded in t around inf
Simplified79.9%
if -2.75000000000000012e-129 < z < 3.2000000000000001e-140Initial program 93.7%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6486.9
Simplified86.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma x (/ (- y a) z) t)))
(if (<= z -1.8e+117)
t_1
(if (<= z -2.65e-129)
(fma (- y z) (/ t a) x)
(if (<= z 2.9e+44) (fma y (/ (- t x) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(x, ((y - a) / z), t);
double tmp;
if (z <= -1.8e+117) {
tmp = t_1;
} else if (z <= -2.65e-129) {
tmp = fma((y - z), (t / a), x);
} else if (z <= 2.9e+44) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(x, Float64(Float64(y - a) / z), t) tmp = 0.0 if (z <= -1.8e+117) tmp = t_1; elseif (z <= -2.65e-129) tmp = fma(Float64(y - z), Float64(t / a), x); elseif (z <= 2.9e+44) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.8e+117], t$95$1, If[LessEqual[z, -2.65e-129], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 2.9e+44], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.65 \cdot 10^{-129}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+44}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.80000000000000006e117 or 2.9000000000000002e44 < z Initial program 34.6%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified83.5%
Taylor expanded in x around inf
Simplified76.7%
if -1.80000000000000006e117 < z < -2.64999999999999987e-129Initial program 87.5%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.2
Applied egg-rr96.2%
*-commutativeN/A
div-invN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.9
Applied egg-rr95.9%
Taylor expanded in t around inf
/-lowering-/.f64N/A
--lowering--.f6485.1
Simplified85.1%
Taylor expanded in a around inf
/-lowering-/.f6462.4
Simplified62.4%
if -2.64999999999999987e-129 < z < 2.9000000000000002e44Initial program 91.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6478.0
Simplified78.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma t (/ (- y z) (- a z)) x)))
(if (<= a -4.5e+20)
t_1
(if (<= a 2.35e-197) (fma (- x t) (/ (- y a) z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, ((y - z) / (a - z)), x);
double tmp;
if (a <= -4.5e+20) {
tmp = t_1;
} else if (a <= 2.35e-197) {
tmp = fma((x - t), ((y - a) / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(Float64(y - z) / Float64(a - z)), x) tmp = 0.0 if (a <= -4.5e+20) tmp = t_1; elseif (a <= 2.35e-197) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -4.5e+20], t$95$1, If[LessEqual[a, 2.35e-197], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \frac{y - z}{a - z}, x\right)\\
\mathbf{if}\;a \leq -4.5 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{-197}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.5e20 or 2.3500000000000001e-197 < a Initial program 67.6%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6488.7
Applied egg-rr88.7%
Taylor expanded in t around inf
Simplified80.3%
if -4.5e20 < a < 2.3500000000000001e-197Initial program 61.5%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified87.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma x (/ (- y a) z) t)))
(if (<= z -3.85e+114)
t_1
(if (<= z 3.25e+44) (fma y (/ (- t x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(x, ((y - a) / z), t);
double tmp;
if (z <= -3.85e+114) {
tmp = t_1;
} else if (z <= 3.25e+44) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(x, Float64(Float64(y - a) / z), t) tmp = 0.0 if (z <= -3.85e+114) tmp = t_1; elseif (z <= 3.25e+44) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -3.85e+114], t$95$1, If[LessEqual[z, 3.25e+44], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\
\mathbf{if}\;z \leq -3.85 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{+44}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.8500000000000001e114 or 3.25000000000000009e44 < z Initial program 34.6%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified83.5%
Taylor expanded in x around inf
Simplified76.7%
if -3.8500000000000001e114 < z < 3.25000000000000009e44Initial program 89.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6468.4
Simplified68.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma x (/ (- y a) z) t))) (if (<= z -2.05e+114) t_1 (if (<= z 5e+85) (fma y (/ t a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(x, ((y - a) / z), t);
double tmp;
if (z <= -2.05e+114) {
tmp = t_1;
} else if (z <= 5e+85) {
tmp = fma(y, (t / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(x, Float64(Float64(y - a) / z), t) tmp = 0.0 if (z <= -2.05e+114) tmp = t_1; elseif (z <= 5e+85) tmp = fma(y, Float64(t / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -2.05e+114], t$95$1, If[LessEqual[z, 5e+85], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.05e114 or 5.0000000000000001e85 < z Initial program 33.6%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified85.8%
Taylor expanded in x around inf
Simplified78.4%
if -2.05e114 < z < 5.0000000000000001e85Initial program 87.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6467.2
Simplified67.2%
Taylor expanded in t around inf
Simplified61.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.65e-14) (* t (- 1.0 (/ y z))) (if (<= z 2.15e+86) (fma y (/ t a) x) (fma a (/ (- t x) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.65e-14) {
tmp = t * (1.0 - (y / z));
} else if (z <= 2.15e+86) {
tmp = fma(y, (t / a), x);
} else {
tmp = fma(a, ((t - x) / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.65e-14) tmp = Float64(t * Float64(1.0 - Float64(y / z))); elseif (z <= 2.15e+86) tmp = fma(y, Float64(t / a), x); else tmp = fma(a, Float64(Float64(t - x) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.65e-14], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e+86], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{-14}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\end{array}
\end{array}
if z < -2.6500000000000001e-14Initial program 47.2%
Taylor expanded in a around 0
associate-/l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6451.7
Simplified51.7%
Taylor expanded in x around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6457.4
Simplified57.4%
if -2.6500000000000001e-14 < z < 2.1500000000000001e86Initial program 87.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6472.4
Simplified72.4%
Taylor expanded in t around inf
Simplified65.9%
if 2.1500000000000001e86 < z Initial program 37.9%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6439.4
Simplified39.4%
Taylor expanded in z around -inf
+-commutativeN/A
Simplified58.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* t (- 1.0 (/ y z))))) (if (<= z -4.2e-14) t_1 (if (<= z 5.5e+85) (fma y (/ t a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (1.0 - (y / z));
double tmp;
if (z <= -4.2e-14) {
tmp = t_1;
} else if (z <= 5.5e+85) {
tmp = fma(y, (t / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -4.2e-14) tmp = t_1; elseif (z <= 5.5e+85) tmp = fma(y, Float64(t / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e-14], t$95$1, If[LessEqual[z, 5.5e+85], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.1999999999999998e-14 or 5.50000000000000008e85 < z Initial program 42.9%
Taylor expanded in a around 0
associate-/l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6449.2
Simplified49.2%
Taylor expanded in x around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6455.7
Simplified55.7%
if -4.1999999999999998e-14 < z < 5.50000000000000008e85Initial program 87.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6472.4
Simplified72.4%
Taylor expanded in t around inf
Simplified65.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma t (/ a z) t))) (if (<= z -7.6e+118) t_1 (if (<= z 1.5e+86) (fma y (/ t a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (a / z), t);
double tmp;
if (z <= -7.6e+118) {
tmp = t_1;
} else if (z <= 1.5e+86) {
tmp = fma(y, (t / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(a / z), t) tmp = 0.0 if (z <= -7.6e+118) tmp = t_1; elseif (z <= 1.5e+86) tmp = fma(y, Float64(t / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(a / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -7.6e+118], t$95$1, If[LessEqual[z, 1.5e+86], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \frac{a}{z}, t\right)\\
\mathbf{if}\;z \leq -7.6 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.60000000000000033e118 or 1.49999999999999988e86 < z Initial program 33.6%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6450.7
Simplified50.7%
Taylor expanded in z around -inf
+-commutativeN/A
Simplified61.5%
Taylor expanded in t around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6454.9
Simplified54.9%
if -7.60000000000000033e118 < z < 1.49999999999999988e86Initial program 87.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6467.2
Simplified67.2%
Taylor expanded in t around inf
Simplified61.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma t (/ a z) t))) (if (<= z -1.05e+115) t_1 (if (<= z 1.65e+86) x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (a / z), t);
double tmp;
if (z <= -1.05e+115) {
tmp = t_1;
} else if (z <= 1.65e+86) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(a / z), t) tmp = 0.0 if (z <= -1.05e+115) tmp = t_1; elseif (z <= 1.65e+86) tmp = x; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(a / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.05e+115], t$95$1, If[LessEqual[z, 1.65e+86], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \frac{a}{z}, t\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+86}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.05000000000000002e115 or 1.65e86 < z Initial program 33.6%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6450.7
Simplified50.7%
Taylor expanded in z around -inf
+-commutativeN/A
Simplified61.5%
Taylor expanded in t around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6454.9
Simplified54.9%
if -1.05000000000000002e115 < z < 1.65e86Initial program 87.2%
Taylor expanded in a around inf
Simplified39.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -3e+114) x (if (<= a 1.45e+112) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3e+114) {
tmp = x;
} else if (a <= 1.45e+112) {
tmp = t;
} 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+114)) then
tmp = x
else if (a <= 1.45d+112) then
tmp = t
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+114) {
tmp = x;
} else if (a <= 1.45e+112) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3e+114: tmp = x elif a <= 1.45e+112: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3e+114) tmp = x; elseif (a <= 1.45e+112) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3e+114) tmp = x; elseif (a <= 1.45e+112) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3e+114], x, If[LessEqual[a, 1.45e+112], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+114}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+112}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3e114 or 1.4500000000000001e112 < a Initial program 69.6%
Taylor expanded in a around inf
Simplified59.6%
if -3e114 < a < 1.4500000000000001e112Initial program 63.0%
Taylor expanded in z around inf
Simplified37.8%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 65.2%
Taylor expanded in z around inf
Simplified29.2%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 65.2%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6439.0
Simplified39.0%
Taylor expanded in z around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lft2.8
Simplified2.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* (/ y z) (- t x)))))
(if (< z -1.2536131056095036e+188)
t_1
(if (< z 4.446702369113811e+64)
(+ x (/ (- y z) (/ (- a z) (- t x))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - 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 = t - ((y / z) * (t - x))
if (z < (-1.2536131056095036d+188)) then
tmp = t_1
else if (z < 4.446702369113811d+64) then
tmp = x + ((y - z) / ((a - z) / (t - 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 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - ((y / z) * (t - x)) tmp = 0 if z < -1.2536131056095036e+188: tmp = t_1 elif z < 4.446702369113811e+64: tmp = x + ((y - z) / ((a - z) / (t - x))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y / z) * Float64(t - x))) tmp = 0.0 if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - ((y / z) * (t - x)); tmp = 0.0; if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = x + ((y - z) / ((a - z) / (t - x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y / z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -1.2536131056095036e+188], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\
\mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024195
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))
(+ x (/ (* (- y z) (- t x)) (- a z))))