
(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 18 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) (/ 1.0 (/ (- a z) (- y z))) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -5e-300)
t_1
(if (<= t_2 0.0) (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 - x), (1.0 / ((a - z) / (y - z))), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -5e-300) {
tmp = t_1;
} else if (t_2 <= 0.0) {
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(t - x), Float64(1.0 / Float64(Float64(a - z) / Float64(y - z))), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -5e-300) tmp = t_1; elseif (t_2 <= 0.0) 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[(t - x), $MachinePrecision] * N[(1.0 / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $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-300], t$95$1, If[LessEqual[t$95$2, 0.0], 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 - x, \frac{1}{\frac{a - z}{y - 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^{-300}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x - t, \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.99999999999999996e-300 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 66.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6489.6
Applied rewrites89.6%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6489.6
Applied rewrites89.6%
if -4.99999999999999996e-300 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 4.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
lower-fma.f64N/A
Applied rewrites99.9%
Final simplification90.4%
(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-300)
t_1
(if (<= t_2 0.0) (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 - x), ((y - z) / (a - z)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -5e-300) {
tmp = t_1;
} else if (t_2 <= 0.0) {
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(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-300) tmp = t_1; elseif (t_2 <= 0.0) 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[(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-300], t$95$1, If[LessEqual[t$95$2, 0.0], 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 - 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^{-300}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x - t, \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.99999999999999996e-300 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 66.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6489.6
Applied rewrites89.6%
if -4.99999999999999996e-300 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 4.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
lower-fma.f64N/A
Applied rewrites99.9%
Final simplification90.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x t) (/ (- y a) z) t)))
(if (<= z -1.02e+60)
t_1
(if (<= z 1.2e-247)
(fma (- t x) (/ (- y z) a) x)
(if (<= z 4e+110) (+ x (/ (* (- y z) t) (- a z))) 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 <= -1.02e+60) {
tmp = t_1;
} else if (z <= 1.2e-247) {
tmp = fma((t - x), ((y - z) / a), x);
} else if (z <= 4e+110) {
tmp = x + (((y - z) * t) / (a - z));
} 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 <= -1.02e+60) tmp = t_1; elseif (z <= 1.2e-247) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); elseif (z <= 4e+110) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); 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, -1.02e+60], t$95$1, If[LessEqual[z, 1.2e-247], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 4e+110], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $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 -1.02 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-247}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+110}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.0200000000000001e60 or 4.0000000000000001e110 < z Initial program 35.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
lower-fma.f64N/A
Applied rewrites80.2%
if -1.0200000000000001e60 < z < 1.20000000000000005e-247Initial program 84.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6495.7
Applied rewrites95.7%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6485.0
Applied rewrites85.0%
if 1.20000000000000005e-247 < z < 4.0000000000000001e110Initial program 81.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6477.6
Applied rewrites77.6%
Final simplification80.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ x z) t)))
(if (<= z -1.1e+56)
t_1
(if (<= z 2.5e-75)
(* t (/ y (- a z)))
(if (<= z 1.02e+110) (fma (- t) (/ y z) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (x / z), t);
double tmp;
if (z <= -1.1e+56) {
tmp = t_1;
} else if (z <= 2.5e-75) {
tmp = t * (y / (a - z));
} else if (z <= 1.02e+110) {
tmp = fma(-t, (y / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(x / z), t) tmp = 0.0 if (z <= -1.1e+56) tmp = t_1; elseif (z <= 2.5e-75) tmp = Float64(t * Float64(y / Float64(a - z))); elseif (z <= 1.02e+110) tmp = fma(Float64(-t), Float64(y / z), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.1e+56], t$95$1, If[LessEqual[z, 2.5e-75], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+110], N[((-t) * N[(y / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{x}{z}, t\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-75}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+110}:\\
\;\;\;\;\mathsf{fma}\left(-t, \frac{y}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.10000000000000008e56 or 1.02e110 < z Initial program 35.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
lower-fma.f64N/A
Applied rewrites79.5%
Taylor expanded in a around 0
Applied rewrites73.1%
Taylor expanded in x around inf
Applied rewrites68.1%
if -1.10000000000000008e56 < z < 2.49999999999999989e-75Initial program 86.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f6486.4
Applied rewrites86.4%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6441.0
Applied rewrites41.0%
Taylor expanded in y around inf
Applied rewrites37.8%
if 2.49999999999999989e-75 < z < 1.02e110Initial program 73.8%
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
lower-fma.f64N/A
Applied rewrites56.8%
Taylor expanded in y around inf
Applied rewrites52.9%
Taylor expanded in x around 0
Applied rewrites45.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ x z) t)))
(if (<= z -1.35e+20)
t_1
(if (<= z 2.9e-227)
(* t (/ y a))
(if (<= z 8.8e+91) (* y (/ (- x t) z)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (x / z), t);
double tmp;
if (z <= -1.35e+20) {
tmp = t_1;
} else if (z <= 2.9e-227) {
tmp = t * (y / a);
} else if (z <= 8.8e+91) {
tmp = y * ((x - t) / z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(x / z), t) tmp = 0.0 if (z <= -1.35e+20) tmp = t_1; elseif (z <= 2.9e-227) tmp = Float64(t * Float64(y / a)); elseif (z <= 8.8e+91) tmp = Float64(y * Float64(Float64(x - t) / z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.35e+20], t$95$1, If[LessEqual[z, 2.9e-227], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e+91], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{x}{z}, t\right)\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-227}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+91}:\\
\;\;\;\;y \cdot \frac{x - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.35e20 or 8.79999999999999998e91 < z Initial program 38.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
lower-fma.f64N/A
Applied rewrites73.9%
Taylor expanded in a around 0
Applied rewrites68.2%
Taylor expanded in x around inf
Applied rewrites63.0%
if -1.35e20 < z < 2.90000000000000011e-227Initial program 90.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f6490.2
Applied rewrites90.2%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.8
Applied rewrites40.8%
Taylor expanded in z around 0
Applied rewrites27.0%
Applied rewrites33.9%
if 2.90000000000000011e-227 < z < 8.79999999999999998e91Initial program 79.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
lower-fma.f64N/A
Applied rewrites52.2%
Taylor expanded in y around inf
Applied rewrites39.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -9.5e+130)
t_1
(if (<= a 4.6e-13) (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 <= -9.5e+130) {
tmp = t_1;
} else if (a <= 4.6e-13) {
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 <= -9.5e+130) tmp = t_1; elseif (a <= 4.6e-13) 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, -9.5e+130], t$95$1, If[LessEqual[a, 4.6e-13], 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 -9.5 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.5000000000000009e130 or 4.59999999999999958e-13 < a Initial program 63.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--.f6477.1
Applied rewrites77.1%
if -9.5000000000000009e130 < a < 4.59999999999999958e-13Initial program 61.2%
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
lower-fma.f64N/A
Applied rewrites78.3%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y z) (/ (- t x) a) x))) (if (<= a -9.5e+130) t_1 (if (<= a 8.5e-14) (fma (- x t) (/ y 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 <= -9.5e+130) {
tmp = t_1;
} else if (a <= 8.5e-14) {
tmp = fma((x - t), (y / 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 <= -9.5e+130) tmp = t_1; elseif (a <= 8.5e-14) tmp = fma(Float64(x - t), Float64(y / 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, -9.5e+130], t$95$1, If[LessEqual[a, 8.5e-14], N[(N[(x - t), $MachinePrecision] * N[(y / 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 -9.5 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.5000000000000009e130 or 8.50000000000000038e-14 < a Initial program 63.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--.f6477.1
Applied rewrites77.1%
if -9.5000000000000009e130 < a < 8.50000000000000038e-14Initial program 61.2%
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
lower-fma.f64N/A
Applied rewrites78.3%
Taylor expanded in y around inf
Applied rewrites76.3%
Applied rewrites76.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.7e+45) (fma (- x t) (/ y z) t) (if (<= z 2.15e-7) (fma (- t x) (/ y a) x) (fma y (/ (- x t) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+45) {
tmp = fma((x - t), (y / z), t);
} else if (z <= 2.15e-7) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = fma(y, ((x - t) / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e+45) tmp = fma(Float64(x - t), Float64(y / z), t); elseif (z <= 2.15e-7) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = fma(y, Float64(Float64(x - t) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e+45], N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 2.15e-7], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y}{z}, t\right)\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\end{array}
\end{array}
if z < -1.7e45Initial program 36.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
lower-fma.f64N/A
Applied rewrites77.0%
Taylor expanded in y around inf
Applied rewrites69.2%
Applied rewrites69.2%
if -1.7e45 < z < 2.1500000000000001e-7Initial program 84.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6493.3
Applied rewrites93.3%
Taylor expanded in z around 0
lower-/.f6475.4
Applied rewrites75.4%
if 2.1500000000000001e-7 < z Initial program 47.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
lower-fma.f64N/A
Applied rewrites74.6%
Taylor expanded in a around 0
Applied rewrites73.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ (- t x) a) x))) (if (<= a -2.1e+135) t_1 (if (<= a 4.6e-13) (fma (- x t) (/ y z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((t - x) / a), x);
double tmp;
if (a <= -2.1e+135) {
tmp = t_1;
} else if (a <= 4.6e-13) {
tmp = fma((x - t), (y / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -2.1e+135) tmp = t_1; elseif (a <= 4.6e-13) tmp = fma(Float64(x - t), Float64(y / z), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.1e+135], t$95$1, If[LessEqual[a, 4.6e-13], N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -2.1 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.1000000000000001e135 or 4.59999999999999958e-13 < a Initial program 63.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.4
Applied rewrites67.4%
if -2.1000000000000001e135 < a < 4.59999999999999958e-13Initial program 61.2%
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
lower-fma.f64N/A
Applied rewrites78.3%
Taylor expanded in y around inf
Applied rewrites76.3%
Applied rewrites76.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ (- x t) z) t))) (if (<= z -4.8e+45) t_1 (if (<= z 2.15e-7) (fma y (/ (- t x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((x - t) / z), t);
double tmp;
if (z <= -4.8e+45) {
tmp = t_1;
} else if (z <= 2.15e-7) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(x - t) / z), t) tmp = 0.0 if (z <= -4.8e+45) tmp = t_1; elseif (z <= 2.15e-7) 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[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -4.8e+45], t$95$1, If[LessEqual[z, 2.15e-7], 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(y, \frac{x - t}{z}, t\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.79999999999999979e45 or 2.1500000000000001e-7 < z Initial program 42.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
lower-fma.f64N/A
Applied rewrites75.7%
Taylor expanded in a around 0
Applied rewrites70.0%
if -4.79999999999999979e45 < z < 2.1500000000000001e-7Initial program 84.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6473.8
Applied rewrites73.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- x) (/ y a) x))) (if (<= a -2.9e+141) t_1 (if (<= a 4.6e-13) (fma y (/ (- x t) z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-x, (y / a), x);
double tmp;
if (a <= -2.9e+141) {
tmp = t_1;
} else if (a <= 4.6e-13) {
tmp = fma(y, ((x - t) / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-x), Float64(y / a), x) tmp = 0.0 if (a <= -2.9e+141) tmp = t_1; elseif (a <= 4.6e-13) tmp = fma(y, Float64(Float64(x - t) / z), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-x) * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.9e+141], t$95$1, If[LessEqual[a, 4.6e-13], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-x, \frac{y}{a}, x\right)\\
\mathbf{if}\;a \leq -2.9 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.90000000000000007e141 or 4.59999999999999958e-13 < a Initial program 63.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6492.9
Applied rewrites92.9%
Taylor expanded in z around 0
lower-/.f6467.6
Applied rewrites67.6%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6459.2
Applied rewrites59.2%
if -2.90000000000000007e141 < a < 4.59999999999999958e-13Initial program 61.1%
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
lower-fma.f64N/A
Applied rewrites78.0%
Taylor expanded in a around 0
Applied rewrites72.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ x z) t))) (if (<= z -1.35e+60) t_1 (if (<= z 4.7e+30) (+ x (/ (* y t) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (x / z), t);
double tmp;
if (z <= -1.35e+60) {
tmp = t_1;
} else if (z <= 4.7e+30) {
tmp = x + ((y * t) / a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(x / z), t) tmp = 0.0 if (z <= -1.35e+60) tmp = t_1; elseif (z <= 4.7e+30) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.35e+60], t$95$1, If[LessEqual[z, 4.7e+30], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{x}{z}, t\right)\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{+30}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.35e60 or 4.6999999999999999e30 < z Initial program 39.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
lower-fma.f64N/A
Applied rewrites78.0%
Taylor expanded in a around 0
Applied rewrites72.1%
Taylor expanded in x around inf
Applied rewrites65.3%
if -1.35e60 < z < 4.6999999999999999e30Initial program 84.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6463.8
Applied rewrites63.8%
Taylor expanded in t around inf
Applied rewrites56.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ x z) t))) (if (<= x -5.5e+25) t_1 (if (<= x 1.65e-72) (fma (- t) (/ y z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (x / z), t);
double tmp;
if (x <= -5.5e+25) {
tmp = t_1;
} else if (x <= 1.65e-72) {
tmp = fma(-t, (y / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(x / z), t) tmp = 0.0 if (x <= -5.5e+25) tmp = t_1; elseif (x <= 1.65e-72) tmp = fma(Float64(-t), Float64(y / z), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[x, -5.5e+25], t$95$1, If[LessEqual[x, 1.65e-72], N[((-t) * N[(y / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{x}{z}, t\right)\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-72}:\\
\;\;\;\;\mathsf{fma}\left(-t, \frac{y}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.50000000000000018e25 or 1.65e-72 < x Initial program 47.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
lower-fma.f64N/A
Applied rewrites56.6%
Taylor expanded in a around 0
Applied rewrites49.9%
Taylor expanded in x around inf
Applied rewrites46.8%
if -5.50000000000000018e25 < x < 1.65e-72Initial program 78.1%
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
lower-fma.f64N/A
Applied rewrites54.6%
Taylor expanded in y around inf
Applied rewrites54.7%
Taylor expanded in x around 0
Applied rewrites52.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ x z) t))) (if (<= z -1.35e+20) t_1 (if (<= z 5.8e-202) (* t (/ y a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (x / z), t);
double tmp;
if (z <= -1.35e+20) {
tmp = t_1;
} else if (z <= 5.8e-202) {
tmp = t * (y / a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(x / z), t) tmp = 0.0 if (z <= -1.35e+20) tmp = t_1; elseif (z <= 5.8e-202) tmp = Float64(t * Float64(y / a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.35e+20], t$95$1, If[LessEqual[z, 5.8e-202], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{x}{z}, t\right)\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-202}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.35e20 or 5.79999999999999976e-202 < z Initial program 50.7%
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
lower-fma.f64N/A
Applied rewrites67.6%
Taylor expanded in a around 0
Applied rewrites61.2%
Taylor expanded in x around inf
Applied rewrites51.8%
if -1.35e20 < z < 5.79999999999999976e-202Initial program 89.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f6489.9
Applied rewrites89.9%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6442.5
Applied rewrites42.5%
Taylor expanded in z around 0
Applied rewrites28.6%
Applied rewrites34.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- t x)))) (if (<= z -2e+37) t_1 (if (<= z 1.2e-18) (* t (/ y a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -2e+37) {
tmp = t_1;
} else if (z <= 1.2e-18) {
tmp = t * (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 = x + (t - x)
if (z <= (-2d+37)) then
tmp = t_1
else if (z <= 1.2d-18) then
tmp = t * (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 = x + (t - x);
double tmp;
if (z <= -2e+37) {
tmp = t_1;
} else if (z <= 1.2e-18) {
tmp = t * (y / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -2e+37: tmp = t_1 elif z <= 1.2e-18: tmp = t * (y / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -2e+37) tmp = t_1; elseif (z <= 1.2e-18) tmp = Float64(t * Float64(y / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -2e+37) tmp = t_1; elseif (z <= 1.2e-18) tmp = t * (y / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+37], t$95$1, If[LessEqual[z, 1.2e-18], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-18}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.99999999999999991e37 or 1.19999999999999997e-18 < z Initial program 42.5%
Taylor expanded in z around inf
lower--.f6434.6
Applied rewrites34.6%
if -1.99999999999999991e37 < z < 1.19999999999999997e-18Initial program 86.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f6486.7
Applied rewrites86.7%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6441.9
Applied rewrites41.9%
Taylor expanded in z around 0
Applied rewrites25.9%
Applied rewrites29.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* x y) z))) (if (<= x -440000.0) t_1 (if (<= x 6.2e+166) (+ x (- t x)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / z;
double tmp;
if (x <= -440000.0) {
tmp = t_1;
} else if (x <= 6.2e+166) {
tmp = x + (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 = (x * y) / z
if (x <= (-440000.0d0)) then
tmp = t_1
else if (x <= 6.2d+166) then
tmp = x + (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 = (x * y) / z;
double tmp;
if (x <= -440000.0) {
tmp = t_1;
} else if (x <= 6.2e+166) {
tmp = x + (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x * y) / z tmp = 0 if x <= -440000.0: tmp = t_1 elif x <= 6.2e+166: tmp = x + (t - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / z) tmp = 0.0 if (x <= -440000.0) tmp = t_1; elseif (x <= 6.2e+166) tmp = Float64(x + Float64(t - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x * y) / z; tmp = 0.0; if (x <= -440000.0) tmp = t_1; elseif (x <= 6.2e+166) tmp = x + (t - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[x, -440000.0], t$95$1, If[LessEqual[x, 6.2e+166], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{z}\\
\mathbf{if}\;x \leq -440000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+166}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.4e5 or 6.19999999999999966e166 < x Initial program 50.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
lower-fma.f64N/A
Applied rewrites49.3%
Taylor expanded in a around 0
Applied rewrites44.0%
Taylor expanded in x around inf
Applied rewrites25.2%
if -4.4e5 < x < 6.19999999999999966e166Initial program 69.7%
Taylor expanded in z around inf
lower--.f6431.6
Applied rewrites31.6%
(FPCore (x y z t a) :precision binary64 (+ x (- t x)))
double code(double x, double y, double z, double t, double a) {
return x + (t - x);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (t - x)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t - x);
}
def code(x, y, z, t, a): return x + (t - x)
function code(x, y, z, t, a) return Float64(x + Float64(t - x)) end
function tmp = code(x, y, z, t, a) tmp = x + (t - x); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - x\right)
\end{array}
Initial program 62.0%
Taylor expanded in z around inf
lower--.f6421.7
Applied rewrites21.7%
(FPCore (x y z t a) :precision binary64 (+ x (- x)))
double code(double x, double y, double z, double t, double a) {
return x + -x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + -x
end function
public static double code(double x, double y, double z, double t, double a) {
return x + -x;
}
def code(x, y, z, t, a): return x + -x
function code(x, y, z, t, a) return Float64(x + Float64(-x)) end
function tmp = code(x, y, z, t, a) tmp = x + -x; end
code[x_, y_, z_, t_, a_] := N[(x + (-x)), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-x\right)
\end{array}
Initial program 62.0%
Taylor expanded in z around inf
lower--.f6421.7
Applied rewrites21.7%
Taylor expanded in t around 0
Applied rewrites2.7%
(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 2024222
(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))))