
(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 16 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 (/ (- t x) z)))
(if (<= z -4.6e+114)
(fma t_1 (fma -1.0 y a) t)
(if (<= z 5.5e+170)
(fma (/ (- y z) (- a z)) (- t x) x)
(fma (+ (/ a z) 1.0) (* t_1 (fma -1.0 y a)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / z;
double tmp;
if (z <= -4.6e+114) {
tmp = fma(t_1, fma(-1.0, y, a), t);
} else if (z <= 5.5e+170) {
tmp = fma(((y - z) / (a - z)), (t - x), x);
} else {
tmp = fma(((a / z) + 1.0), (t_1 * fma(-1.0, y, a)), t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / z) tmp = 0.0 if (z <= -4.6e+114) tmp = fma(t_1, fma(-1.0, y, a), t); elseif (z <= 5.5e+170) tmp = fma(Float64(Float64(y - z) / Float64(a - z)), Float64(t - x), x); else tmp = fma(Float64(Float64(a / z) + 1.0), Float64(t_1 * fma(-1.0, y, a)), t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -4.6e+114], N[(t$95$1 * N[(-1.0 * y + a), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 5.5e+170], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(a / z), $MachinePrecision] + 1.0), $MachinePrecision] * N[(t$95$1 * N[(-1.0 * y + a), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{z}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \mathsf{fma}\left(-1, y, a\right), t\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+170}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{z} + 1, t\_1 \cdot \mathsf{fma}\left(-1, y, a\right), t\right)\\
\end{array}
\end{array}
if z < -4.6000000000000001e114Initial program 35.6%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
div-subN/A
distribute-lft-out--N/A
associate-/l*N/A
associate-*r*N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
distribute-rgt-out--N/A
lower-fma.f64N/A
Applied rewrites90.2%
if -4.6000000000000001e114 < z < 5.4999999999999999e170Initial program 83.9%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites89.4%
lift-/.f64N/A
lift-/.f64N/A
remove-double-div89.5
lift-fma.f64N/A
Applied rewrites92.7%
if 5.4999999999999999e170 < z Initial program 12.6%
Taylor expanded in z around inf
associate--l+N/A
+-commutativeN/A
Applied rewrites93.7%
Final simplification92.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- t x) a) y)) (t_2 (fma x (/ z a) x)))
(if (<= a -8.5e-6)
t_2
(if (<= a -3e-90)
t_1
(if (<= a 1.42e+19) t (if (<= a 9.6e+99) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - x) / a) * y;
double t_2 = fma(x, (z / a), x);
double tmp;
if (a <= -8.5e-6) {
tmp = t_2;
} else if (a <= -3e-90) {
tmp = t_1;
} else if (a <= 1.42e+19) {
tmp = t;
} else if (a <= 9.6e+99) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - x) / a) * y) t_2 = fma(x, Float64(z / a), x) tmp = 0.0 if (a <= -8.5e-6) tmp = t_2; elseif (a <= -3e-90) tmp = t_1; elseif (a <= 1.42e+19) tmp = t; elseif (a <= 9.6e+99) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -8.5e-6], t$95$2, If[LessEqual[a, -3e-90], t$95$1, If[LessEqual[a, 1.42e+19], t, If[LessEqual[a, 9.6e+99], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a} \cdot y\\
t_2 := \mathsf{fma}\left(x, \frac{z}{a}, x\right)\\
\mathbf{if}\;a \leq -8.5 \cdot 10^{-6}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -3 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.42 \cdot 10^{+19}:\\
\;\;\;\;t\\
\mathbf{elif}\;a \leq 9.6 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -8.4999999999999999e-6 or 9.6000000000000005e99 < a Initial program 71.0%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6477.7
Applied rewrites77.7%
Taylor expanded in t around 0
Applied rewrites60.6%
Taylor expanded in y around 0
Applied rewrites55.4%
if -8.4999999999999999e-6 < a < -3.0000000000000002e-90 or 1.42e19 < a < 9.6000000000000005e99Initial program 72.1%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6455.4
Applied rewrites55.4%
Taylor expanded in y around inf
Applied rewrites50.9%
if -3.0000000000000002e-90 < a < 1.42e19Initial program 62.6%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites67.7%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6422.7
Applied rewrites22.7%
Taylor expanded in z around inf
Applied rewrites45.8%
Final simplification50.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) z)))
(if (<= z -6.5e+15)
(fma t_1 (fma -1.0 y a) t)
(if (<= z -2.2e-76)
(+ x (/ (* (- y z) t) (- a z)))
(if (<= z 3.5e+74)
(+ x (* (/ (- y z) a) (- t x)))
(- t (* t_1 (- y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / z;
double tmp;
if (z <= -6.5e+15) {
tmp = fma(t_1, fma(-1.0, y, a), t);
} else if (z <= -2.2e-76) {
tmp = x + (((y - z) * t) / (a - z));
} else if (z <= 3.5e+74) {
tmp = x + (((y - z) / a) * (t - x));
} else {
tmp = t - (t_1 * (y - a));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / z) tmp = 0.0 if (z <= -6.5e+15) tmp = fma(t_1, fma(-1.0, y, a), t); elseif (z <= -2.2e-76) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); elseif (z <= 3.5e+74) tmp = Float64(x + Float64(Float64(Float64(y - z) / a) * Float64(t - x))); else tmp = Float64(t - Float64(t_1 * Float64(y - a))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -6.5e+15], N[(t$95$1 * N[(-1.0 * y + a), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, -2.2e-76], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+74], N[(x + N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(t$95$1 * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{z}\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \mathsf{fma}\left(-1, y, a\right), t\right)\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-76}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+74}:\\
\;\;\;\;x + \frac{y - z}{a} \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t - t\_1 \cdot \left(y - a\right)\\
\end{array}
\end{array}
if z < -6.5e15Initial program 49.0%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
div-subN/A
distribute-lft-out--N/A
associate-/l*N/A
associate-*r*N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
distribute-rgt-out--N/A
lower-fma.f64N/A
Applied rewrites84.8%
if -6.5e15 < z < -2.19999999999999999e-76Initial program 88.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6488.6
Applied rewrites88.6%
if -2.19999999999999999e-76 < z < 3.50000000000000014e74Initial program 87.3%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.4
Applied rewrites77.4%
if 3.50000000000000014e74 < z Initial program 29.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6457.9
Applied rewrites57.9%
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
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.3
Applied rewrites84.3%
Final simplification81.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* (/ (- t x) z) (- y a)))))
(if (<= z -6.5e+15)
t_1
(if (<= z -2.2e-76)
(+ x (/ (* (- y z) t) (- a z)))
(if (<= z 3.5e+74) (+ x (* (/ (- y z) a) (- t x))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (((t - x) / z) * (y - a));
double tmp;
if (z <= -6.5e+15) {
tmp = t_1;
} else if (z <= -2.2e-76) {
tmp = x + (((y - z) * t) / (a - z));
} else if (z <= 3.5e+74) {
tmp = x + (((y - z) / a) * (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 - (((t - x) / z) * (y - a))
if (z <= (-6.5d+15)) then
tmp = t_1
else if (z <= (-2.2d-76)) then
tmp = x + (((y - z) * t) / (a - z))
else if (z <= 3.5d+74) then
tmp = x + (((y - z) / a) * (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 - (((t - x) / z) * (y - a));
double tmp;
if (z <= -6.5e+15) {
tmp = t_1;
} else if (z <= -2.2e-76) {
tmp = x + (((y - z) * t) / (a - z));
} else if (z <= 3.5e+74) {
tmp = x + (((y - z) / a) * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (((t - x) / z) * (y - a)) tmp = 0 if z <= -6.5e+15: tmp = t_1 elif z <= -2.2e-76: tmp = x + (((y - z) * t) / (a - z)) elif z <= 3.5e+74: tmp = x + (((y - z) / a) * (t - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a))) tmp = 0.0 if (z <= -6.5e+15) tmp = t_1; elseif (z <= -2.2e-76) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); elseif (z <= 3.5e+74) tmp = Float64(x + Float64(Float64(Float64(y - z) / a) * Float64(t - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (((t - x) / z) * (y - a)); tmp = 0.0; if (z <= -6.5e+15) tmp = t_1; elseif (z <= -2.2e-76) tmp = x + (((y - z) * t) / (a - z)); elseif (z <= 3.5e+74) tmp = x + (((y - z) / a) * (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[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e+15], t$95$1, If[LessEqual[z, -2.2e-76], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+74], N[(x + N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{t - x}{z} \cdot \left(y - a\right)\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-76}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+74}:\\
\;\;\;\;x + \frac{y - z}{a} \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.5e15 or 3.50000000000000014e74 < z Initial program 39.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6459.1
Applied rewrites59.1%
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
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.6
Applied rewrites84.6%
if -6.5e15 < z < -2.19999999999999999e-76Initial program 88.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6488.6
Applied rewrites88.6%
if -2.19999999999999999e-76 < z < 3.50000000000000014e74Initial program 87.3%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.4
Applied rewrites77.4%
Final simplification81.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t x) z)))
(if (<= z -4.6e+114)
(fma t_1 (fma -1.0 y a) t)
(if (<= z 5.5e+170)
(fma (/ (- y z) (- a z)) (- t x) x)
(- t (* t_1 (- y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) / z;
double tmp;
if (z <= -4.6e+114) {
tmp = fma(t_1, fma(-1.0, y, a), t);
} else if (z <= 5.5e+170) {
tmp = fma(((y - z) / (a - z)), (t - x), x);
} else {
tmp = t - (t_1 * (y - a));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) / z) tmp = 0.0 if (z <= -4.6e+114) tmp = fma(t_1, fma(-1.0, y, a), t); elseif (z <= 5.5e+170) tmp = fma(Float64(Float64(y - z) / Float64(a - z)), Float64(t - x), x); else tmp = Float64(t - Float64(t_1 * Float64(y - a))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -4.6e+114], N[(t$95$1 * N[(-1.0 * y + a), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 5.5e+170], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(t - N[(t$95$1 * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{z}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \mathsf{fma}\left(-1, y, a\right), t\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+170}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t - t\_1 \cdot \left(y - a\right)\\
\end{array}
\end{array}
if z < -4.6000000000000001e114Initial program 35.6%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
div-subN/A
distribute-lft-out--N/A
associate-/l*N/A
associate-*r*N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
distribute-rgt-out--N/A
lower-fma.f64N/A
Applied rewrites90.2%
if -4.6000000000000001e114 < z < 5.4999999999999999e170Initial program 83.9%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites89.4%
lift-/.f64N/A
lift-/.f64N/A
remove-double-div89.5
lift-fma.f64N/A
Applied rewrites92.7%
if 5.4999999999999999e170 < z Initial program 12.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6445.7
Applied rewrites45.7%
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
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6493.7
Applied rewrites93.7%
Final simplification92.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.5e+15) (not (<= z 3.5e+74))) (- t (* (/ (- t x) z) (- y a))) (+ x (* (/ (- y z) a) (- t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.5e+15) || !(z <= 3.5e+74)) {
tmp = t - (((t - x) / z) * (y - a));
} else {
tmp = x + (((y - z) / a) * (t - 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 <= (-5.5d+15)) .or. (.not. (z <= 3.5d+74))) then
tmp = t - (((t - x) / z) * (y - a))
else
tmp = x + (((y - z) / a) * (t - 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 <= -5.5e+15) || !(z <= 3.5e+74)) {
tmp = t - (((t - x) / z) * (y - a));
} else {
tmp = x + (((y - z) / a) * (t - x));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.5e+15) or not (z <= 3.5e+74): tmp = t - (((t - x) / z) * (y - a)) else: tmp = x + (((y - z) / a) * (t - x)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.5e+15) || !(z <= 3.5e+74)) tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a))); else tmp = Float64(x + Float64(Float64(Float64(y - z) / a) * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.5e+15) || ~((z <= 3.5e+74))) tmp = t - (((t - x) / z) * (y - a)); else tmp = x + (((y - z) / a) * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e+15], N[Not[LessEqual[z, 3.5e+74]], $MachinePrecision]], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+15} \lor \neg \left(z \leq 3.5 \cdot 10^{+74}\right):\\
\;\;\;\;t - \frac{t - x}{z} \cdot \left(y - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - z}{a} \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -5.5e15 or 3.50000000000000014e74 < z Initial program 39.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6459.1
Applied rewrites59.1%
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
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.6
Applied rewrites84.6%
if -5.5e15 < z < 3.50000000000000014e74Initial program 87.5%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6474.9
Applied rewrites74.9%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.5e+15) (not (<= z 3.5e+74))) (- t (* (/ (- t x) z) (- y a))) (fma (- y z) (/ (- t x) a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.5e+15) || !(z <= 3.5e+74)) {
tmp = t - (((t - x) / z) * (y - a));
} else {
tmp = fma((y - z), ((t - x) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.5e+15) || !(z <= 3.5e+74)) tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a))); else tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e+15], N[Not[LessEqual[z, 3.5e+74]], $MachinePrecision]], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+15} \lor \neg \left(z \leq 3.5 \cdot 10^{+74}\right):\\
\;\;\;\;t - \frac{t - x}{z} \cdot \left(y - a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\end{array}
\end{array}
if z < -5.5e15 or 3.50000000000000014e74 < z Initial program 39.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6459.1
Applied rewrites59.1%
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
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.6
Applied rewrites84.6%
if -5.5e15 < z < 3.50000000000000014e74Initial program 87.5%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6473.8
Applied rewrites73.8%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.35e+34) (not (<= a 1.42e+19))) (fma (- y z) (/ (- t x) a) x) (* (/ (- y z) (- a z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.35e+34) || !(a <= 1.42e+19)) {
tmp = fma((y - z), ((t - x) / a), x);
} else {
tmp = ((y - z) / (a - z)) * t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.35e+34) || !(a <= 1.42e+19)) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); else tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.35e+34], N[Not[LessEqual[a, 1.42e+19]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+34} \lor \neg \left(a \leq 1.42 \cdot 10^{+19}\right):\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\end{array}
\end{array}
if a < -1.35e34 or 1.42e19 < a Initial program 69.9%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6478.6
Applied rewrites78.6%
if -1.35e34 < a < 1.42e19Initial program 65.4%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites70.2%
lift-/.f64N/A
lift-/.f64N/A
remove-double-div70.3
lift-fma.f64N/A
Applied rewrites74.9%
Taylor expanded in x around 0
associate-/l*N/A
div-subN/A
*-commutativeN/A
lower-*.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6465.2
Applied rewrites65.2%
Final simplification71.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.7e+46) (not (<= a 2.05e+19))) (fma (/ (- t x) a) y x) (* (/ (- y z) (- a z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.7e+46) || !(a <= 2.05e+19)) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = ((y - z) / (a - z)) * t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.7e+46) || !(a <= 2.05e+19)) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = Float64(Float64(Float64(y - z) / Float64(a - z)) * t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.7e+46], N[Not[LessEqual[a, 2.05e+19]], $MachinePrecision]], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.7 \cdot 10^{+46} \lor \neg \left(a \leq 2.05 \cdot 10^{+19}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t\\
\end{array}
\end{array}
if a < -3.6999999999999999e46 or 2.05e19 < a Initial program 70.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6475.9
Applied rewrites75.9%
if -3.6999999999999999e46 < a < 2.05e19Initial program 65.2%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites70.7%
lift-/.f64N/A
lift-/.f64N/A
remove-double-div70.7
lift-fma.f64N/A
Applied rewrites75.2%
Taylor expanded in x around 0
associate-/l*N/A
div-subN/A
*-commutativeN/A
lower-*.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6465.1
Applied rewrites65.1%
Final simplification69.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+39) (not (<= z 1.2e+140))) (* (- t) (/ z (- a z))) (fma (/ (- t x) a) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+39) || !(z <= 1.2e+140)) {
tmp = -t * (z / (a - z));
} else {
tmp = fma(((t - x) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+39) || !(z <= 1.2e+140)) tmp = Float64(Float64(-t) * Float64(z / Float64(a - z))); else tmp = fma(Float64(Float64(t - x) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+39], N[Not[LessEqual[z, 1.2e+140]], $MachinePrecision]], N[((-t) * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+39} \lor \neg \left(z \leq 1.2 \cdot 10^{+140}\right):\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\end{array}
\end{array}
if z < -1.1000000000000001e39 or 1.2e140 < z Initial program 34.7%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites56.1%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6428.0
Applied rewrites28.0%
Taylor expanded in x around 0
Applied rewrites62.9%
if -1.1000000000000001e39 < z < 1.2e140Initial program 84.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.5
Applied rewrites67.5%
Final simplification65.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.22e+78) (not (<= z 1.75e+140))) t (fma (- y z) (/ t a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.22e+78) || !(z <= 1.75e+140)) {
tmp = t;
} else {
tmp = fma((y - z), (t / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.22e+78) || !(z <= 1.75e+140)) tmp = t; else tmp = fma(Float64(y - z), Float64(t / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.22e+78], N[Not[LessEqual[z, 1.75e+140]], $MachinePrecision]], t, N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+78} \lor \neg \left(z \leq 1.75 \cdot 10^{+140}\right):\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\end{array}
\end{array}
if z < -1.22000000000000006e78 or 1.74999999999999995e140 < z Initial program 30.2%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites53.5%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6425.4
Applied rewrites25.4%
Taylor expanded in z around inf
Applied rewrites64.2%
if -1.22000000000000006e78 < z < 1.74999999999999995e140Initial program 84.6%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6468.6
Applied rewrites68.6%
Taylor expanded in x around 0
Applied rewrites58.5%
Final simplification60.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.9e+39) t (if (<= z 1.2e+140) (fma (/ (- t x) a) y x) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+39) {
tmp = t;
} else if (z <= 1.2e+140) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+39) tmp = t; elseif (z <= 1.2e+140) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+39], t, If[LessEqual[z, 1.2e+140], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+39}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.8999999999999999e39 or 1.2e140 < z Initial program 34.7%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites56.1%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6428.0
Applied rewrites28.0%
Taylor expanded in z around inf
Applied rewrites61.6%
if -1.8999999999999999e39 < z < 1.2e140Initial program 84.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.5
Applied rewrites67.5%
Final simplification65.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+39) (not (<= z 1.9e+111))) t (- x (* x (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+39) || !(z <= 1.9e+111)) {
tmp = t;
} else {
tmp = x - (x * (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 <= (-1.9d+39)) .or. (.not. (z <= 1.9d+111))) then
tmp = t
else
tmp = x - (x * (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 <= -1.9e+39) || !(z <= 1.9e+111)) {
tmp = t;
} else {
tmp = x - (x * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e+39) or not (z <= 1.9e+111): tmp = t else: tmp = x - (x * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e+39) || !(z <= 1.9e+111)) tmp = t; else tmp = Float64(x - Float64(x * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e+39) || ~((z <= 1.9e+111))) tmp = t; else tmp = x - (x * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e+39], N[Not[LessEqual[z, 1.9e+111]], $MachinePrecision]], t, N[(x - N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+39} \lor \neg \left(z \leq 1.9 \cdot 10^{+111}\right):\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.8999999999999999e39 or 1.89999999999999988e111 < z Initial program 34.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites57.5%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6426.5
Applied rewrites26.5%
Taylor expanded in z around inf
Applied rewrites58.2%
if -1.8999999999999999e39 < z < 1.89999999999999988e111Initial program 86.7%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6471.6
Applied rewrites71.6%
Taylor expanded in t around 0
Applied rewrites49.9%
Taylor expanded in y around inf
Applied rewrites49.9%
Final simplification53.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.4e+34) (not (<= a 1.9e+94))) (fma x (/ z a) x) t))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.4e+34) || !(a <= 1.9e+94)) {
tmp = fma(x, (z / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.4e+34) || !(a <= 1.9e+94)) tmp = fma(x, Float64(z / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.4e+34], N[Not[LessEqual[a, 1.9e+94]], $MachinePrecision]], N[(x * N[(z / a), $MachinePrecision] + x), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+34} \lor \neg \left(a \leq 1.9 \cdot 10^{+94}\right):\\
\;\;\;\;\mathsf{fma}\left(x, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if a < -1.40000000000000004e34 or 1.8999999999999998e94 < a Initial program 72.2%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in t around 0
Applied rewrites63.9%
Taylor expanded in y around 0
Applied rewrites58.2%
if -1.40000000000000004e34 < a < 1.8999999999999998e94Initial program 64.4%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites70.6%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6424.0
Applied rewrites24.0%
Taylor expanded in z around inf
Applied rewrites39.1%
Final simplification46.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7e-7) (not (<= a 5.2e+109))) (/ (* x a) a) t))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7e-7) || !(a <= 5.2e+109)) {
tmp = (x * a) / a;
} 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 ((a <= (-7d-7)) .or. (.not. (a <= 5.2d+109))) then
tmp = (x * a) / a
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 ((a <= -7e-7) || !(a <= 5.2e+109)) {
tmp = (x * a) / a;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7e-7) or not (a <= 5.2e+109): tmp = (x * a) / a else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7e-7) || !(a <= 5.2e+109)) tmp = Float64(Float64(x * a) / a); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -7e-7) || ~((a <= 5.2e+109))) tmp = (x * a) / a; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7e-7], N[Not[LessEqual[a, 5.2e+109]], $MachinePrecision]], N[(N[(x * a), $MachinePrecision] / a), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{-7} \lor \neg \left(a \leq 5.2 \cdot 10^{+109}\right):\\
\;\;\;\;\frac{x \cdot a}{a}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if a < -6.99999999999999968e-7 or 5.1999999999999997e109 < a Initial program 70.7%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6477.5
Applied rewrites77.5%
Taylor expanded in a around 0
Applied rewrites56.5%
Taylor expanded in a around inf
Applied rewrites41.1%
if -6.99999999999999968e-7 < a < 5.1999999999999997e109Initial program 65.1%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites69.7%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6423.1
Applied rewrites23.1%
Taylor expanded in z around inf
Applied rewrites39.7%
Final simplification40.3%
(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 67.4%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
Applied rewrites77.7%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.7
Applied rewrites38.7%
Taylor expanded in z around inf
Applied rewrites28.3%
(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 2024324
(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))))