
(FPCore (x y z t a) :precision binary64 :pre TRUE (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = x + ((y * (z - t)) / (a - t)) END code
x + \frac{y \cdot \left(z - t\right)}{a - t}
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 :pre TRUE (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = x + ((y * (z - t)) / (a - t)) END code
x + \frac{y \cdot \left(z - t\right)}{a - t}
(FPCore (x y z t a) :precision binary64 :pre TRUE (fma (- t z) (/ y (- t a)) x))
double code(double x, double y, double z, double t, double a) {
return fma((t - z), (y / (t - a)), x);
}
function code(x, y, z, t, a) return fma(Float64(t - z), Float64(y / Float64(t - a)), x) end
code[x_, y_, z_, t_, a_] := N[(N[(t - z), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = ((t - z) * (y / (t - a))) + x END code
\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)
Initial program 85.6%
Applied rewrites95.8%
(FPCore (x y z t a) :precision binary64 :pre TRUE (fma y (/ (- t z) (- t a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((t - z) / (t - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(t - z) / Float64(t - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = (y * ((t - z) / (t - a))) + x END code
\mathsf{fma}\left(y, \frac{t - z}{t - a}, x\right)
Initial program 85.6%
Applied rewrites98.1%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(if (<= t -5.4571549521241516e-14)
(fma y (- 1.0 (/ z t)) x)
(if (<= t 3.260484372634548e-40)
(+ x (/ (* y z) (- a t)))
(fma y (/ t (- t a)) x))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.4571549521241516e-14) {
tmp = fma(y, (1.0 - (z / t)), x);
} else if (t <= 3.260484372634548e-40) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = fma(y, (t / (t - a)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.4571549521241516e-14) tmp = fma(y, Float64(1.0 - Float64(z / t)), x); elseif (t <= 3.260484372634548e-40) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = fma(y, Float64(t / Float64(t - a)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.4571549521241516e-14], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 3.260484372634548e-40], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (t <= (326048437263454803195331966268701919940038645673851321628990153669150920666324305786086649677313169248815682976783136837184429168701171875e-177)) THEN (x + ((y * z) / (a - t))) ELSE ((y * (t / (t - a))) + x) ENDIF IN LET tmp = IF (t <= (-54571549521241515535920819635449088562287149606344627272846992127597332000732421875e-96)) THEN ((y * ((1) - (z / t))) + x) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;t \leq -5.4571549521241516 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{elif}\;t \leq 3.260484372634548 \cdot 10^{-40}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{t - a}, x\right)\\
\end{array}
if t < -5.4571549521241516e-14Initial program 85.6%
Applied rewrites98.1%
Taylor expanded in a around 0
Applied rewrites67.0%
Applied rewrites67.0%
if -5.4571549521241516e-14 < t < 3.260484372634548e-40Initial program 85.6%
Taylor expanded in z around inf
Applied rewrites73.9%
if 3.260484372634548e-40 < t Initial program 85.6%
Applied rewrites98.1%
Taylor expanded in z around 0
Applied rewrites72.0%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(if (<= t -2.677882717229924e-15)
(fma y (- 1.0 (/ z t)) x)
(if (<= t 2.0275327203029445e-52)
(fma (- z t) (/ y a) x)
(fma y (/ t (- t a)) x))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.677882717229924e-15) {
tmp = fma(y, (1.0 - (z / t)), x);
} else if (t <= 2.0275327203029445e-52) {
tmp = fma((z - t), (y / a), x);
} else {
tmp = fma(y, (t / (t - a)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.677882717229924e-15) tmp = fma(y, Float64(1.0 - Float64(z / t)), x); elseif (t <= 2.0275327203029445e-52) tmp = fma(Float64(z - t), Float64(y / a), x); else tmp = fma(y, Float64(t / Float64(t - a)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.677882717229924e-15], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 2.0275327203029445e-52], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (t <= (2027532720302944540217881058725914008137919835616601502313229083201171874413302625428451282710804074817306513566255398441255729073684488383833013358525931835174560546875e-220)) THEN (((z - t) * (y / a)) + x) ELSE ((y * (t / (t - a))) + x) ENDIF IN LET tmp = IF (t <= (-26778827172299239476305609360241898358304698905818508336551531101576983928680419921875e-100)) THEN ((y * ((1) - (z / t))) + x) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;t \leq -2.677882717229924 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{elif}\;t \leq 2.0275327203029445 \cdot 10^{-52}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{t - a}, x\right)\\
\end{array}
if t < -2.6778827172299239e-15Initial program 85.6%
Applied rewrites98.1%
Taylor expanded in a around 0
Applied rewrites67.0%
Applied rewrites67.0%
if -2.6778827172299239e-15 < t < 2.0275327203029445e-52Initial program 85.6%
Taylor expanded in t around 0
Applied rewrites57.4%
Applied rewrites61.1%
if 2.0275327203029445e-52 < t Initial program 85.6%
Applied rewrites98.1%
Taylor expanded in z around 0
Applied rewrites72.0%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(if (<= t -2.8391169769943698e-15)
(fma y (- 1.0 (/ z t)) x)
(if (<= t 2.8638456223567507e-121)
(+ x (* z (/ y a)))
(fma t (/ y (- t a)) x))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8391169769943698e-15) {
tmp = fma(y, (1.0 - (z / t)), x);
} else if (t <= 2.8638456223567507e-121) {
tmp = x + (z * (y / a));
} else {
tmp = fma(t, (y / (t - a)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.8391169769943698e-15) tmp = fma(y, Float64(1.0 - Float64(z / t)), x); elseif (t <= 2.8638456223567507e-121) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = fma(t, Float64(y / Float64(t - a)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.8391169769943698e-15], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 2.8638456223567507e-121], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (t <= (286384562235675071580504820202616686807309994331158217926948394783820180384218896537029689973027625062122225152814927656394975676578400974255165222693263127968096319600328883893458430223736203563812228072756324791133831472285030586526340700078912304022621663526679646372620939634979679179319946025206178319422178901731967926025390625e-453)) THEN (x + (z * (y / a))) ELSE ((t * (y / (t - a))) + x) ENDIF IN LET tmp = IF (t <= (-28391169769943697668438335491106141511284438778972560868396612931974232196807861328125e-100)) THEN ((y * ((1) - (z / t))) + x) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;t \leq -2.8391169769943698 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{elif}\;t \leq 2.8638456223567507 \cdot 10^{-121}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{t - a}, x\right)\\
\end{array}
if t < -2.8391169769943698e-15Initial program 85.6%
Applied rewrites98.1%
Taylor expanded in a around 0
Applied rewrites67.0%
Applied rewrites67.0%
if -2.8391169769943698e-15 < t < 2.8638456223567507e-121Initial program 85.6%
Taylor expanded in t around 0
Applied rewrites60.5%
Applied rewrites62.1%
if 2.8638456223567507e-121 < t Initial program 85.6%
Applied rewrites95.8%
Taylor expanded in z around 0
Applied rewrites70.8%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(if (<= t -2.8391169769943698e-15)
(fma y (/ (- t z) t) x)
(if (<= t 2.8638456223567507e-121)
(+ x (* z (/ y a)))
(fma t (/ y (- t a)) x))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8391169769943698e-15) {
tmp = fma(y, ((t - z) / t), x);
} else if (t <= 2.8638456223567507e-121) {
tmp = x + (z * (y / a));
} else {
tmp = fma(t, (y / (t - a)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.8391169769943698e-15) tmp = fma(y, Float64(Float64(t - z) / t), x); elseif (t <= 2.8638456223567507e-121) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = fma(t, Float64(y / Float64(t - a)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.8391169769943698e-15], N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 2.8638456223567507e-121], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (t <= (286384562235675071580504820202616686807309994331158217926948394783820180384218896537029689973027625062122225152814927656394975676578400974255165222693263127968096319600328883893458430223736203563812228072756324791133831472285030586526340700078912304022621663526679646372620939634979679179319946025206178319422178901731967926025390625e-453)) THEN (x + (z * (y / a))) ELSE ((t * (y / (t - a))) + x) ENDIF IN LET tmp = IF (t <= (-28391169769943697668438335491106141511284438778972560868396612931974232196807861328125e-100)) THEN ((y * ((t - z) / t)) + x) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;t \leq -2.8391169769943698 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - z}{t}, x\right)\\
\mathbf{elif}\;t \leq 2.8638456223567507 \cdot 10^{-121}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{t - a}, x\right)\\
\end{array}
if t < -2.8391169769943698e-15Initial program 85.6%
Applied rewrites98.1%
Taylor expanded in a around 0
Applied rewrites67.0%
if -2.8391169769943698e-15 < t < 2.8638456223567507e-121Initial program 85.6%
Taylor expanded in t around 0
Applied rewrites60.5%
Applied rewrites62.1%
if 2.8638456223567507e-121 < t Initial program 85.6%
Applied rewrites95.8%
Taylor expanded in z around 0
Applied rewrites70.8%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(if (<= t -2.8391169769943698e-15)
(fma y (/ (- t z) t) x)
(if (<= t 2.4961977514465657e-52)
(+ x (* z (/ y a)))
(fma y (/ t (- t a)) x))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8391169769943698e-15) {
tmp = fma(y, ((t - z) / t), x);
} else if (t <= 2.4961977514465657e-52) {
tmp = x + (z * (y / a));
} else {
tmp = fma(y, (t / (t - a)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.8391169769943698e-15) tmp = fma(y, Float64(Float64(t - z) / t), x); elseif (t <= 2.4961977514465657e-52) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = fma(y, Float64(t / Float64(t - a)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.8391169769943698e-15], N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 2.4961977514465657e-52], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (t <= (249619775144656569669740825459633311902825249617630238395163005329547159697583457937845930714331145659362726404163422856530879143620305082862387280329130589962005615234375e-222)) THEN (x + (z * (y / a))) ELSE ((y * (t / (t - a))) + x) ENDIF IN LET tmp = IF (t <= (-28391169769943697668438335491106141511284438778972560868396612931974232196807861328125e-100)) THEN ((y * ((t - z) / t)) + x) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;t \leq -2.8391169769943698 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - z}{t}, x\right)\\
\mathbf{elif}\;t \leq 2.4961977514465657 \cdot 10^{-52}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{t - a}, x\right)\\
\end{array}
if t < -2.8391169769943698e-15Initial program 85.6%
Applied rewrites98.1%
Taylor expanded in a around 0
Applied rewrites67.0%
if -2.8391169769943698e-15 < t < 2.4961977514465657e-52Initial program 85.6%
Taylor expanded in t around 0
Applied rewrites60.5%
Applied rewrites62.1%
if 2.4961977514465657e-52 < t Initial program 85.6%
Applied rewrites98.1%
Taylor expanded in z around 0
Applied rewrites72.0%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (fma y (/ (- t z) t) x)))
(if (<= t -2.8391169769943698e-15)
t_1
(if (<= t 2.830958487977724e-52) (+ x (* z (/ y a))) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((t - z) / t), x);
double tmp;
if (t <= -2.8391169769943698e-15) {
tmp = t_1;
} else if (t <= 2.830958487977724e-52) {
tmp = x + (z * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(t - z) / t), x) tmp = 0.0 if (t <= -2.8391169769943698e-15) tmp = t_1; elseif (t <= 2.830958487977724e-52) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -2.8391169769943698e-15], t$95$1, If[LessEqual[t, 2.830958487977724e-52], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET t_1 = ((y * ((t - z) / t)) + x) IN LET tmp_1 = IF (t <= (28309584879777238245773341382504061581671441771892107294461212644110143610793170715248081858363606863186599168044092873541575132380516965913130889020976610481739044189453125e-224)) THEN (x + (z * (y / a))) ELSE t_1 ENDIF IN LET tmp = IF (t <= (-28391169769943697668438335491106141511284438778972560868396612931974232196807861328125e-100)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{t - z}{t}, x\right)\\
\mathbf{if}\;t \leq -2.8391169769943698 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.830958487977724 \cdot 10^{-52}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -2.8391169769943698e-15 or 2.8309584879777238e-52 < t Initial program 85.6%
Applied rewrites98.1%
Taylor expanded in a around 0
Applied rewrites67.0%
if -2.8391169769943698e-15 < t < 2.8309584879777238e-52Initial program 85.6%
Taylor expanded in t around 0
Applied rewrites60.5%
Applied rewrites62.1%
(FPCore (x y z t a) :precision binary64 :pre TRUE (if (<= t -4.7662824425608525e-14) (+ x y) (if (<= t 2.4961977514465657e-52) (+ x (* z (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.7662824425608525e-14) {
tmp = x + y;
} else if (t <= 2.4961977514465657e-52) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 (t <= (-4.7662824425608525d-14)) then
tmp = x + y
else if (t <= 2.4961977514465657d-52) then
tmp = x + (z * (y / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.7662824425608525e-14) {
tmp = x + y;
} else if (t <= 2.4961977514465657e-52) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.7662824425608525e-14: tmp = x + y elif t <= 2.4961977514465657e-52: tmp = x + (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.7662824425608525e-14) tmp = Float64(x + y); elseif (t <= 2.4961977514465657e-52) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.7662824425608525e-14) tmp = x + y; elseif (t <= 2.4961977514465657e-52) tmp = x + (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.7662824425608525e-14], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.4961977514465657e-52], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (t <= (249619775144656569669740825459633311902825249617630238395163005329547159697583457937845930714331145659362726404163422856530879143620305082862387280329130589962005615234375e-222)) THEN (x + (z * (y / a))) ELSE (x + y) ENDIF IN LET tmp = IF (t <= (-4766282442560852502077537738280695218950899771925833192653954029083251953125e-89)) THEN (x + y) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;t \leq -4.7662824425608525 \cdot 10^{-14}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.4961977514465657 \cdot 10^{-52}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if t < -4.7662824425608525e-14 or 2.4961977514465657e-52 < t Initial program 85.6%
Taylor expanded in t around inf
Applied rewrites61.3%
if -4.7662824425608525e-14 < t < 2.4961977514465657e-52Initial program 85.6%
Taylor expanded in t around 0
Applied rewrites60.5%
Applied rewrites62.1%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (fma t (/ y t) x)))
(if (<= a -2.803375420246256e+161)
(* x 1.0)
(if (<= a -1.316894047366868e-268)
t_1
(if (<= a 1.6050336491349997e-278)
(/ (* y (- t z)) t)
(if (<= a 1.9720017373547914e+106) t_1 (* x 1.0)))))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (y / t), x);
double tmp;
if (a <= -2.803375420246256e+161) {
tmp = x * 1.0;
} else if (a <= -1.316894047366868e-268) {
tmp = t_1;
} else if (a <= 1.6050336491349997e-278) {
tmp = (y * (t - z)) / t;
} else if (a <= 1.9720017373547914e+106) {
tmp = t_1;
} else {
tmp = x * 1.0;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(y / t), x) tmp = 0.0 if (a <= -2.803375420246256e+161) tmp = Float64(x * 1.0); elseif (a <= -1.316894047366868e-268) tmp = t_1; elseif (a <= 1.6050336491349997e-278) tmp = Float64(Float64(y * Float64(t - z)) / t); elseif (a <= 1.9720017373547914e+106) tmp = t_1; else tmp = Float64(x * 1.0); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / t), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.803375420246256e+161], N[(x * 1.0), $MachinePrecision], If[LessEqual[a, -1.316894047366868e-268], t$95$1, If[LessEqual[a, 1.6050336491349997e-278], N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 1.9720017373547914e+106], t$95$1, N[(x * 1.0), $MachinePrecision]]]]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET t_1 = ((t * (y / t)) + x) IN LET tmp_3 = IF (a <= (19720017373547913738974786793130590873398222113986135146369594783732800465675538875672716716696974309457920)) THEN t_1 ELSE (x * (1)) ENDIF IN LET tmp_2 = IF (a <= (1605033649134999737813388523917831301769786873361452095428425072607556141745548770684512854450685413552610192990149106179745006342256291837868647616743877355045313553197242073343074865726454111312146364048364206706241059674706362021461666922178110491963402205481376713971307233788425979764336697458053209844939400534349716989472585206018872693953155898158954779967934131816871062890472894112361601140896608787876656530776241406712910091162988312197328767892925874990752121436697520809607664968153624473428127621288563919325874975463455618243439128202640859074049235928894750897953193385952154497493953207937910571457434039685646899938035919577273042223980979714692551851840107701718807220458984375e-974)) THEN ((y * (t - z)) / t) ELSE tmp_3 ENDIF IN LET tmp_1 = IF (a <= (-131689404736686795539013537409198416331873781586321037554247048437898289917443321392924031133313155113045413882240520504750292313687977180357856200219071336891428591710421307917025523890568825396542460871365842764854791910004763441194124536160002667256094448032663198901490030025430479989277341100488188418883082666551496816231126014563661129983007750720220546956436736155227987413199606171366914355604089038863512293651509610779453032458764528845312280990623687281540375184570806132222252958521470304332660974388828883542150046501241967315446195271819965680503307444710261771084652840678306579303090171302879525909648595534428595910103609867292107082903385162353515625e-936)) THEN t_1 ELSE tmp_2 ENDIF IN LET tmp = IF (a <= (-280337542024625624693651066497335093453761970279776419790132214526074812119086978961118586694716000330608302937522322130839813562701241903729275664649615013052416)) THEN (x * (1)) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \frac{y}{t}, x\right)\\
\mathbf{if}\;a \leq -2.803375420246256 \cdot 10^{+161}:\\
\;\;\;\;x \cdot 1\\
\mathbf{elif}\;a \leq -1.316894047366868 \cdot 10^{-268}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.6050336491349997 \cdot 10^{-278}:\\
\;\;\;\;\frac{y \cdot \left(t - z\right)}{t}\\
\mathbf{elif}\;a \leq 1.9720017373547914 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 1\\
\end{array}
if a < -2.8033754202462562e161 or 1.9720017373547914e106 < a Initial program 85.6%
Taylor expanded in x around inf
Applied rewrites79.3%
Taylor expanded in x around inf
Applied rewrites51.3%
if -2.8033754202462562e161 < a < -1.316894047366868e-268 or 1.6050336491349997e-278 < a < 1.9720017373547914e106Initial program 85.6%
Applied rewrites95.8%
Taylor expanded in t around inf
Applied rewrites65.4%
Taylor expanded in z around 0
Applied rewrites60.2%
if -1.316894047366868e-268 < a < 1.6050336491349997e-278Initial program 85.6%
Taylor expanded in y around inf
Applied rewrites48.8%
Applied rewrites48.7%
Taylor expanded in a around 0
Applied rewrites24.1%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (* z (/ y (- a t)))))
(if (<= z -2.5041685250512675e+119)
t_1
(if (<= z 1.8793295931340427e+90) (+ x y) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / (a - t));
double tmp;
if (z <= -2.5041685250512675e+119) {
tmp = t_1;
} else if (z <= 1.8793295931340427e+90) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 = z * (y / (a - t))
if (z <= (-2.5041685250512675d+119)) then
tmp = t_1
else if (z <= 1.8793295931340427d+90) then
tmp = x + y
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 = z * (y / (a - t));
double tmp;
if (z <= -2.5041685250512675e+119) {
tmp = t_1;
} else if (z <= 1.8793295931340427e+90) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / (a - t)) tmp = 0 if z <= -2.5041685250512675e+119: tmp = t_1 elif z <= 1.8793295931340427e+90: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / Float64(a - t))) tmp = 0.0 if (z <= -2.5041685250512675e+119) tmp = t_1; elseif (z <= 1.8793295931340427e+90) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / (a - t)); tmp = 0.0; if (z <= -2.5041685250512675e+119) tmp = t_1; elseif (z <= 1.8793295931340427e+90) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5041685250512675e+119], t$95$1, If[LessEqual[z, 1.8793295931340427e+90], N[(x + y), $MachinePrecision], t$95$1]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET t_1 = (z * (y / (a - t))) IN LET tmp_1 = IF (z <= (1879329593134042723717887216607391831273627632221002891386801269637503640284666951117045760)) THEN (x + y) ELSE t_1 ENDIF IN LET tmp = IF (z <= (-250416852505126753522150493918095262396822526547809660521366021611686595593662031864695868179652100189992839617510899712)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := z \cdot \frac{y}{a - t}\\
\mathbf{if}\;z \leq -2.5041685250512675 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8793295931340427 \cdot 10^{+90}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.5041685250512675e119 or 1.8793295931340427e90 < z Initial program 85.6%
Taylor expanded in x around 0
Applied rewrites39.1%
Taylor expanded in z around inf
Applied rewrites26.2%
Applied rewrites28.3%
if -2.5041685250512675e119 < z < 1.8793295931340427e90Initial program 85.6%
Taylor expanded in t around inf
Applied rewrites61.3%
(FPCore (x y z t a) :precision binary64 :pre TRUE (if (<= a -2.803375420246256e+161) (* x 1.0) (if (<= a 1.9720017373547914e+106) (fma t (/ y t) x) (* x 1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.803375420246256e+161) {
tmp = x * 1.0;
} else if (a <= 1.9720017373547914e+106) {
tmp = fma(t, (y / t), x);
} else {
tmp = x * 1.0;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.803375420246256e+161) tmp = Float64(x * 1.0); elseif (a <= 1.9720017373547914e+106) tmp = fma(t, Float64(y / t), x); else tmp = Float64(x * 1.0); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.803375420246256e+161], N[(x * 1.0), $MachinePrecision], If[LessEqual[a, 1.9720017373547914e+106], N[(t * N[(y / t), $MachinePrecision] + x), $MachinePrecision], N[(x * 1.0), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (a <= (19720017373547913738974786793130590873398222113986135146369594783732800465675538875672716716696974309457920)) THEN ((t * (y / t)) + x) ELSE (x * (1)) ENDIF IN LET tmp = IF (a <= (-280337542024625624693651066497335093453761970279776419790132214526074812119086978961118586694716000330608302937522322130839813562701241903729275664649615013052416)) THEN (x * (1)) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;a \leq -2.803375420246256 \cdot 10^{+161}:\\
\;\;\;\;x \cdot 1\\
\mathbf{elif}\;a \leq 1.9720017373547914 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 1\\
\end{array}
if a < -2.8033754202462562e161 or 1.9720017373547914e106 < a Initial program 85.6%
Taylor expanded in x around inf
Applied rewrites79.3%
Taylor expanded in x around inf
Applied rewrites51.3%
if -2.8033754202462562e161 < a < 1.9720017373547914e106Initial program 85.6%
Applied rewrites95.8%
Taylor expanded in t around inf
Applied rewrites65.4%
Taylor expanded in z around 0
Applied rewrites60.2%
(FPCore (x y z t a) :precision binary64 :pre TRUE (if (<= t -2.7643020932137052e-27) (+ x y) (if (<= t 6.243433878926949e-93) (* x 1.0) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.7643020932137052e-27) {
tmp = x + y;
} else if (t <= 6.243433878926949e-93) {
tmp = x * 1.0;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 (t <= (-2.7643020932137052d-27)) then
tmp = x + y
else if (t <= 6.243433878926949d-93) then
tmp = x * 1.0d0
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.7643020932137052e-27) {
tmp = x + y;
} else if (t <= 6.243433878926949e-93) {
tmp = x * 1.0;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.7643020932137052e-27: tmp = x + y elif t <= 6.243433878926949e-93: tmp = x * 1.0 else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.7643020932137052e-27) tmp = Float64(x + y); elseif (t <= 6.243433878926949e-93) tmp = Float64(x * 1.0); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.7643020932137052e-27) tmp = x + y; elseif (t <= 6.243433878926949e-93) tmp = x * 1.0; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.7643020932137052e-27], N[(x + y), $MachinePrecision], If[LessEqual[t, 6.243433878926949e-93], N[(x * 1.0), $MachinePrecision], N[(x + y), $MachinePrecision]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_1 = IF (t <= (62434338789269486655428326929253601212393091949463781487715916825132628870879348982251113950616459077413656525594774240749660902303432713359573261837980573003883533447189525816162902145627152428413858067211718465836521572173527239169033009602571837604045867919921875e-358)) THEN (x * (1)) ELSE (x + y) ENDIF IN LET tmp = IF (t <= (-2764302093213705231947701562323418861007341667710571802926353310155007888572475938104844317422248423099517822265625e-141)) THEN (x + y) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
\mathbf{if}\;t \leq -2.7643020932137052 \cdot 10^{-27}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 6.243433878926949 \cdot 10^{-93}:\\
\;\;\;\;x \cdot 1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
if t < -2.7643020932137052e-27 or 6.2434338789269487e-93 < t Initial program 85.6%
Taylor expanded in t around inf
Applied rewrites61.3%
if -2.7643020932137052e-27 < t < 6.2434338789269487e-93Initial program 85.6%
Taylor expanded in x around inf
Applied rewrites79.3%
Taylor expanded in x around inf
Applied rewrites51.3%
(FPCore (x y z t a) :precision binary64 :pre TRUE (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = x + y END code
x + y
Initial program 85.6%
Taylor expanded in t around inf
Applied rewrites61.3%
(FPCore (x y z t a) :precision binary64 :pre TRUE y)
double code(double x, double y, double z, double t, double a) {
return y;
}
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = y
end function
public static double code(double x, double y, double z, double t, double a) {
return y;
}
def code(x, y, z, t, a): return y
function code(x, y, z, t, a) return y end
function tmp = code(x, y, z, t, a) tmp = y; end
code[x_, y_, z_, t_, a_] := y
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = y END code
y
Initial program 85.6%
Taylor expanded in t around inf
Applied rewrites61.3%
Taylor expanded in x around 0
Applied rewrites18.7%
herbie shell --seed 2026092
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
(+ x (/ (* y (- z t)) (- a t))))