
(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 (- t x) (/ (- y z) (- a z)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -5e-299) t_1 (if (<= t_2 0.0) (fma x (/ (- y a) z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t - x), ((y - z) / (a - z)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -5e-299) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma(x, ((y - a) / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t - x), Float64(Float64(y - z) / Float64(a - z)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -5e-299) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(x, 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[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-299], t$95$1, If[LessEqual[t$95$2, 0.0], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-299}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.99999999999999956e-299 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 75.2%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6491.2
Applied egg-rr91.2%
if -4.99999999999999956e-299 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 4.9%
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
Simplified99.9%
Taylor expanded in x around inf
Simplified99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -8.2e-5)
t_1
(if (<= a 6.2e-90) (+ t (* (- y a) (/ (- x t) z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / a), x);
double tmp;
if (a <= -8.2e-5) {
tmp = t_1;
} else if (a <= 6.2e-90) {
tmp = t + ((y - a) * ((x - t) / z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -8.2e-5) tmp = t_1; elseif (a <= 6.2e-90) tmp = Float64(t + Float64(Float64(y - a) * Float64(Float64(x - t) / z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -8.2e-5], t$95$1, If[LessEqual[a, 6.2e-90], N[(t + N[(N[(y - a), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{-90}:\\
\;\;\;\;t + \left(y - a\right) \cdot \frac{x - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.20000000000000009e-5 or 6.2000000000000003e-90 < a Initial program 72.7%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6475.9
Simplified75.9%
if -8.20000000000000009e-5 < a < 6.2000000000000003e-90Initial program 67.0%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6478.0
Applied egg-rr78.0%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6480.6
Simplified80.6%
Final simplification77.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -0.000108)
t_1
(if (<= a 1.1e-89) (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((y - z), ((t - x) / a), x);
double tmp;
if (a <= -0.000108) {
tmp = t_1;
} else if (a <= 1.1e-89) {
tmp = fma((x - t), ((y - a) / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -0.000108) tmp = t_1; elseif (a <= 1.1e-89) 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[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -0.000108], t$95$1, If[LessEqual[a, 1.1e-89], 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(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -0.000108:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-89}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.08e-4 or 1.10000000000000006e-89 < a Initial program 72.7%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6475.9
Simplified75.9%
if -1.08e-4 < a < 1.10000000000000006e-89Initial program 67.0%
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.1%
Final simplification79.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma x (/ (- y a) z) t)))
(if (<= z -7.4e+14)
t_1
(if (<= z 9.2e+93) (fma (- y z) (/ (- 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 <= -7.4e+14) {
tmp = t_1;
} else if (z <= 9.2e+93) {
tmp = fma((y - z), ((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 <= -7.4e+14) tmp = t_1; elseif (z <= 9.2e+93) tmp = fma(Float64(y - z), 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, -7.4e+14], t$95$1, If[LessEqual[z, 9.2e+93], N[(N[(y - z), $MachinePrecision] * 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 -7.4 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.4e14 or 9.2000000000000006e93 < z Initial program 37.9%
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
Simplified82.8%
Taylor expanded in x around inf
Simplified76.0%
if -7.4e14 < z < 9.2000000000000006e93Initial program 86.1%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6472.5
Simplified72.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma x (/ (- y a) z) t)))
(if (<= z -2120000000000.0)
t_1
(if (<= z 4.4e+19) (fma (- t x) (/ y 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 <= -2120000000000.0) {
tmp = t_1;
} else if (z <= 4.4e+19) {
tmp = fma((t - x), (y / 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 <= -2120000000000.0) tmp = t_1; elseif (z <= 4.4e+19) tmp = fma(Float64(t - x), Float64(y / 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, -2120000000000.0], t$95$1, If[LessEqual[z, 4.4e+19], N[(N[(t - x), $MachinePrecision] * N[(y / 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 -2120000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.12e12 or 4.4e19 < z Initial program 43.4%
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
Simplified79.5%
Taylor expanded in x around inf
Simplified71.1%
if -2.12e12 < z < 4.4e19Initial program 87.2%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6474.9
Simplified74.9%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f6471.1
Simplified71.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma x (/ (- y a) z) t)))
(if (<= z -27000000000000.0)
t_1
(if (<= z 1.05e+27) (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 <= -27000000000000.0) {
tmp = t_1;
} else if (z <= 1.05e+27) {
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 <= -27000000000000.0) tmp = t_1; elseif (z <= 1.05e+27) 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, -27000000000000.0], t$95$1, If[LessEqual[z, 1.05e+27], 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 -27000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.7e13 or 1.04999999999999997e27 < z Initial program 43.4%
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
Simplified79.5%
Taylor expanded in x around inf
Simplified71.1%
if -2.7e13 < z < 1.04999999999999997e27Initial program 87.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6471.0
Simplified71.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma x (/ (- y a) z) t)))
(if (<= z -24500000000.0)
t_1
(if (<= z 1.65e-32) (fma x (/ (- z y) 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 <= -24500000000.0) {
tmp = t_1;
} else if (z <= 1.65e-32) {
tmp = fma(x, ((z - y) / 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 <= -24500000000.0) tmp = t_1; elseif (z <= 1.65e-32) tmp = fma(x, Float64(Float64(z - y) / 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, -24500000000.0], t$95$1, If[LessEqual[z, 1.65e-32], N[(x * N[(N[(z - y), $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 -24500000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-32}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{z - y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.45e10 or 1.65000000000000013e-32 < z Initial program 45.9%
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
Simplified76.8%
Taylor expanded in x around inf
Simplified68.2%
if -2.45e10 < z < 1.65000000000000013e-32Initial program 89.6%
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--.f6465.5
Simplified65.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6461.3
Simplified61.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (/ (* x y) a)))) (if (<= a -2.4e+109) t_1 (if (<= a 6.4e-90) (fma x (/ (- y a) z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((x * y) / a);
double tmp;
if (a <= -2.4e+109) {
tmp = t_1;
} else if (a <= 6.4e-90) {
tmp = fma(x, ((y - a) / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(x * y) / a)) tmp = 0.0 if (a <= -2.4e+109) tmp = t_1; elseif (a <= 6.4e-90) tmp = fma(x, 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[(x - N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.4e+109], t$95$1, If[LessEqual[a, 6.4e-90], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{x \cdot y}{a}\\
\mathbf{if}\;a \leq -2.4 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.4 \cdot 10^{-90}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.39999999999999987e109 or 6.40000000000000014e-90 < a Initial program 76.4%
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--.f6463.9
Simplified63.9%
Taylor expanded in z around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6457.9
Simplified57.9%
if -2.39999999999999987e109 < a < 6.40000000000000014e-90Initial program 64.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
Simplified79.5%
Taylor expanded in x around inf
Simplified64.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- t (/ (* y t) z)))) (if (<= z -1.1e+85) t_1 (if (<= z 0.0185) (- x (/ (* x y) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y * t) / z);
double tmp;
if (z <= -1.1e+85) {
tmp = t_1;
} else if (z <= 0.0185) {
tmp = x - ((x * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t - ((y * t) / z)
if (z <= (-1.1d+85)) then
tmp = t_1
else if (z <= 0.0185d0) then
tmp = x - ((x * y) / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y * t) / z);
double tmp;
if (z <= -1.1e+85) {
tmp = t_1;
} else if (z <= 0.0185) {
tmp = x - ((x * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - ((y * t) / z) tmp = 0 if z <= -1.1e+85: tmp = t_1 elif z <= 0.0185: tmp = x - ((x * y) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y * t) / z)) tmp = 0.0 if (z <= -1.1e+85) tmp = t_1; elseif (z <= 0.0185) tmp = Float64(x - Float64(Float64(x * y) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - ((y * t) / z); tmp = 0.0; if (z <= -1.1e+85) tmp = t_1; elseif (z <= 0.0185) tmp = x - ((x * y) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+85], t$95$1, If[LessEqual[z, 0.0185], N[(x - N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y \cdot t}{z}\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.0185:\\
\;\;\;\;x - \frac{x \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.1000000000000001e85 or 0.0184999999999999991 < z Initial program 41.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6440.8
Simplified40.8%
Taylor expanded in a around 0
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
neg-lowering-neg.f6438.7
Simplified38.7%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6455.0
Simplified55.0%
if -1.1000000000000001e85 < z < 0.0184999999999999991Initial program 86.7%
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--.f6464.8
Simplified64.8%
Taylor expanded in z around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6453.0
Simplified53.0%
Final simplification53.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -75000000000000.0) x (if (<= a 1.7e+101) (- t (/ (* y t) z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -75000000000000.0) {
tmp = x;
} else if (a <= 1.7e+101) {
tmp = t - ((y * t) / z);
} 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 <= (-75000000000000.0d0)) then
tmp = x
else if (a <= 1.7d+101) then
tmp = t - ((y * t) / z)
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 <= -75000000000000.0) {
tmp = x;
} else if (a <= 1.7e+101) {
tmp = t - ((y * t) / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -75000000000000.0: tmp = x elif a <= 1.7e+101: tmp = t - ((y * t) / z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -75000000000000.0) tmp = x; elseif (a <= 1.7e+101) tmp = Float64(t - Float64(Float64(y * t) / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -75000000000000.0) tmp = x; elseif (a <= 1.7e+101) tmp = t - ((y * t) / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -75000000000000.0], x, If[LessEqual[a, 1.7e+101], N[(t - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -75000000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+101}:\\
\;\;\;\;t - \frac{y \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -7.5e13 or 1.70000000000000009e101 < a Initial program 70.8%
Taylor expanded in a around inf
Simplified57.5%
if -7.5e13 < a < 1.70000000000000009e101Initial program 69.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6444.2
Simplified44.2%
Taylor expanded in a around 0
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
neg-lowering-neg.f6436.7
Simplified36.7%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6443.9
Simplified43.9%
Final simplification49.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.1e+108) t (if (<= z 0.015) x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+108) {
tmp = t;
} else if (z <= 0.015) {
tmp = x;
} else {
tmp = t;
}
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 <= (-2.1d+108)) then
tmp = t
else if (z <= 0.015d0) then
tmp = x
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+108) {
tmp = t;
} else if (z <= 0.015) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.1e+108: tmp = t elif z <= 0.015: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.1e+108) tmp = t; elseif (z <= 0.015) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.1e+108) tmp = t; elseif (z <= 0.015) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.1e+108], t, If[LessEqual[z, 0.015], x, t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+108}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 0.015:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -2.1000000000000001e108 or 0.014999999999999999 < z Initial program 43.1%
Taylor expanded in z around inf
Simplified54.4%
if -2.1000000000000001e108 < z < 0.014999999999999999Initial program 85.2%
Taylor expanded in a around inf
Simplified40.6%
(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 70.3%
Taylor expanded in z around inf
Simplified25.1%
(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 70.3%
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--.f6447.1
Simplified47.1%
Taylor expanded in z around inf
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lft2.9
Simplified2.9%
(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 2024198
(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))))