
(FPCore (x y z t) :precision binary64 :pre TRUE (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = (1) - (x / ((y - z) * (y - t))) END code
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 :pre TRUE (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = (1) - (x / ((y - z) * (y - t))) END code
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (- y (fmax z t))))
(if (<= (fmin z t) -1.2170721087613263e-101)
(+ 1.0 (/ x (* (fmin z t) t_1)))
(if (<= (fmin z t) 2.437884502839153e-254)
(- 1.0 (/ x (* y t_1)))
(+ 1.0 (/ x (* (fmax z t) (- y (fmin z t)))))))))double code(double x, double y, double z, double t) {
double t_1 = y - fmax(z, t);
double tmp;
if (fmin(z, t) <= -1.2170721087613263e-101) {
tmp = 1.0 + (x / (fmin(z, t) * t_1));
} else if (fmin(z, t) <= 2.437884502839153e-254) {
tmp = 1.0 - (x / (y * t_1));
} else {
tmp = 1.0 + (x / (fmax(z, t) * (y - fmin(z, t))));
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = y - fmax(z, t)
if (fmin(z, t) <= (-1.2170721087613263d-101)) then
tmp = 1.0d0 + (x / (fmin(z, t) * t_1))
else if (fmin(z, t) <= 2.437884502839153d-254) then
tmp = 1.0d0 - (x / (y * t_1))
else
tmp = 1.0d0 + (x / (fmax(z, t) * (y - fmin(z, t))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y - fmax(z, t);
double tmp;
if (fmin(z, t) <= -1.2170721087613263e-101) {
tmp = 1.0 + (x / (fmin(z, t) * t_1));
} else if (fmin(z, t) <= 2.437884502839153e-254) {
tmp = 1.0 - (x / (y * t_1));
} else {
tmp = 1.0 + (x / (fmax(z, t) * (y - fmin(z, t))));
}
return tmp;
}
def code(x, y, z, t): t_1 = y - fmax(z, t) tmp = 0 if fmin(z, t) <= -1.2170721087613263e-101: tmp = 1.0 + (x / (fmin(z, t) * t_1)) elif fmin(z, t) <= 2.437884502839153e-254: tmp = 1.0 - (x / (y * t_1)) else: tmp = 1.0 + (x / (fmax(z, t) * (y - fmin(z, t)))) return tmp
function code(x, y, z, t) t_1 = Float64(y - fmax(z, t)) tmp = 0.0 if (fmin(z, t) <= -1.2170721087613263e-101) tmp = Float64(1.0 + Float64(x / Float64(fmin(z, t) * t_1))); elseif (fmin(z, t) <= 2.437884502839153e-254) tmp = Float64(1.0 - Float64(x / Float64(y * t_1))); else tmp = Float64(1.0 + Float64(x / Float64(fmax(z, t) * Float64(y - fmin(z, t))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y - max(z, t); tmp = 0.0; if (min(z, t) <= -1.2170721087613263e-101) tmp = 1.0 + (x / (min(z, t) * t_1)); elseif (min(z, t) <= 2.437884502839153e-254) tmp = 1.0 - (x / (y * t_1)); else tmp = 1.0 + (x / (max(z, t) * (y - min(z, t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[Max[z, t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Min[z, t], $MachinePrecision], -1.2170721087613263e-101], N[(1.0 + N[(x / N[(N[Min[z, t], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[z, t], $MachinePrecision], 2.437884502839153e-254], N[(1.0 - N[(x / N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[Max[z, t], $MachinePrecision] * N[(y - N[Min[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET tmp = IF (z > t) THEN z ELSE t ENDIF IN LET t_1 = (y - tmp) IN LET tmp_3 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_4 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_6 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_7 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_8 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_5 = IF (tmp_6 <= (24378845028391531812843523149167703516932251762919079062499551223857997477293568191831472696722096814044183826995844108189191388496266977092953048533117143920333004559762982386755809987991026063988294584732620540802570242455489060884016396105910983592109702455954310031348103766072634884915713814151520565152700213815074975197144818563972314596025988251232956556194578045175829223443934164832921522457937184280877467646939547020255862443037030566987309390371058975464765545739974566899832108306565219805799644554107894180808645799822992217120909271266112466181384096117641244798320952165307979824892918585543810650051455013453960418701171875e-894)) THEN ((1) - (x / (y * t_1))) ELSE ((1) + (x / (tmp_7 * (y - tmp_8)))) ENDIF IN LET tmp_2 = IF (tmp_3 <= (-1217072108761326315112714921517868612612754321180725299552628158253299627296053008970766000641470020465601932454981186073667743175132625951995979544742755790531139713055389469772454373153080427539244447172547732601485035703561643606995460784969513567954635391288320533931255340576171875e-386)) THEN ((1) + (x / (tmp_4 * t_1))) ELSE tmp_5 ENDIF IN tmp_2 END code
\begin{array}{l}
t_1 := y - \mathsf{max}\left(z, t\right)\\
\mathbf{if}\;\mathsf{min}\left(z, t\right) \leq -1.2170721087613263 \cdot 10^{-101}:\\
\;\;\;\;1 + \frac{x}{\mathsf{min}\left(z, t\right) \cdot t\_1}\\
\mathbf{elif}\;\mathsf{min}\left(z, t\right) \leq 2.437884502839153 \cdot 10^{-254}:\\
\;\;\;\;1 - \frac{x}{y \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\mathsf{max}\left(z, t\right) \cdot \left(y - \mathsf{min}\left(z, t\right)\right)}\\
\end{array}
if z < -1.2170721087613263e-101Initial program 99.1%
Taylor expanded in z around inf
Applied rewrites78.4%
if -1.2170721087613263e-101 < z < 2.4378845028391532e-254Initial program 99.1%
Taylor expanded in z around 0
Applied rewrites72.7%
if 2.4378845028391532e-254 < z Initial program 99.1%
Taylor expanded in t around inf
Applied rewrites78.2%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (- y (fmin z t)))
(t_2 (- y (fmax z t)))
(t_3 (/ x (* t_1 t_2))))
(if (<= t_3 -1000000000.0)
(/ (/ x t_2) (fmin z t))
(if (<= t_3 2e-63) 1.0 (+ 1.0 (/ x (* (fmax z t) t_1)))))))double code(double x, double y, double z, double t) {
double t_1 = y - fmin(z, t);
double t_2 = y - fmax(z, t);
double t_3 = x / (t_1 * t_2);
double tmp;
if (t_3 <= -1000000000.0) {
tmp = (x / t_2) / fmin(z, t);
} else if (t_3 <= 2e-63) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (fmax(z, t) * t_1));
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y - fmin(z, t)
t_2 = y - fmax(z, t)
t_3 = x / (t_1 * t_2)
if (t_3 <= (-1000000000.0d0)) then
tmp = (x / t_2) / fmin(z, t)
else if (t_3 <= 2d-63) then
tmp = 1.0d0
else
tmp = 1.0d0 + (x / (fmax(z, t) * t_1))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y - fmin(z, t);
double t_2 = y - fmax(z, t);
double t_3 = x / (t_1 * t_2);
double tmp;
if (t_3 <= -1000000000.0) {
tmp = (x / t_2) / fmin(z, t);
} else if (t_3 <= 2e-63) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (fmax(z, t) * t_1));
}
return tmp;
}
def code(x, y, z, t): t_1 = y - fmin(z, t) t_2 = y - fmax(z, t) t_3 = x / (t_1 * t_2) tmp = 0 if t_3 <= -1000000000.0: tmp = (x / t_2) / fmin(z, t) elif t_3 <= 2e-63: tmp = 1.0 else: tmp = 1.0 + (x / (fmax(z, t) * t_1)) return tmp
function code(x, y, z, t) t_1 = Float64(y - fmin(z, t)) t_2 = Float64(y - fmax(z, t)) t_3 = Float64(x / Float64(t_1 * t_2)) tmp = 0.0 if (t_3 <= -1000000000.0) tmp = Float64(Float64(x / t_2) / fmin(z, t)); elseif (t_3 <= 2e-63) tmp = 1.0; else tmp = Float64(1.0 + Float64(x / Float64(fmax(z, t) * t_1))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y - min(z, t); t_2 = y - max(z, t); t_3 = x / (t_1 * t_2); tmp = 0.0; if (t_3 <= -1000000000.0) tmp = (x / t_2) / min(z, t); elseif (t_3 <= 2e-63) tmp = 1.0; else tmp = 1.0 + (x / (max(z, t) * t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[Min[z, t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y - N[Max[z, t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1000000000.0], N[(N[(x / t$95$2), $MachinePrecision] / N[Min[z, t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e-63], 1.0, N[(1.0 + N[(x / N[(N[Max[z, t], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET tmp = IF (z < t) THEN z ELSE t ENDIF IN LET t_1 = (y - tmp) IN LET tmp_1 = IF (z > t) THEN z ELSE t ENDIF IN LET t_2 = (y - tmp_1) IN LET t_3 = (x / (t_1 * t_2)) IN LET tmp_4 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_6 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_5 = IF (t_3 <= (2000000000000000133021678177119903333298574998945931908775685037230623945485502291414299026727586865040084503464621169551673706015300556161781136370521146290203662321260935641475953161716461181640625e-261)) THEN (1) ELSE ((1) + (x / (tmp_6 * t_1))) ENDIF IN LET tmp_3 = IF (t_3 <= (-1e9)) THEN ((x / t_2) / tmp_4) ELSE tmp_5 ENDIF IN tmp_3 END code
\begin{array}{l}
t_1 := y - \mathsf{min}\left(z, t\right)\\
t_2 := y - \mathsf{max}\left(z, t\right)\\
t_3 := \frac{x}{t\_1 \cdot t\_2}\\
\mathbf{if}\;t\_3 \leq -1000000000:\\
\;\;\;\;\frac{\frac{x}{t\_2}}{\mathsf{min}\left(z, t\right)}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-63}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\mathsf{max}\left(z, t\right) \cdot t\_1}\\
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < -1e9Initial program 99.1%
Taylor expanded in z around inf
Applied rewrites78.4%
Taylor expanded in z around 0
Applied rewrites77.4%
Taylor expanded in y around inf
Applied rewrites56.2%
Taylor expanded in x around inf
Applied rewrites17.0%
if -1e9 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < 2.0000000000000001e-63Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites74.6%
if 2.0000000000000001e-63 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) Initial program 99.1%
Taylor expanded in t around inf
Applied rewrites78.2%
(FPCore (x y z t) :precision binary64 :pre TRUE (if (<= (fmax z t) 1.0078886525156808e-141) (+ 1.0 (/ x (* (fmin z t) (- y (fmax z t))))) (+ 1.0 (/ x (* (fmax z t) (- y (fmin z t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (fmax(z, t) <= 1.0078886525156808e-141) {
tmp = 1.0 + (x / (fmin(z, t) * (y - fmax(z, t))));
} else {
tmp = 1.0 + (x / (fmax(z, t) * (y - fmin(z, t))));
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: tmp
if (fmax(z, t) <= 1.0078886525156808d-141) then
tmp = 1.0d0 + (x / (fmin(z, t) * (y - fmax(z, t))))
else
tmp = 1.0d0 + (x / (fmax(z, t) * (y - fmin(z, t))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (fmax(z, t) <= 1.0078886525156808e-141) {
tmp = 1.0 + (x / (fmin(z, t) * (y - fmax(z, t))));
} else {
tmp = 1.0 + (x / (fmax(z, t) * (y - fmin(z, t))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmax(z, t) <= 1.0078886525156808e-141: tmp = 1.0 + (x / (fmin(z, t) * (y - fmax(z, t)))) else: tmp = 1.0 + (x / (fmax(z, t) * (y - fmin(z, t)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (fmax(z, t) <= 1.0078886525156808e-141) tmp = Float64(1.0 + Float64(x / Float64(fmin(z, t) * Float64(y - fmax(z, t))))); else tmp = Float64(1.0 + Float64(x / Float64(fmax(z, t) * Float64(y - fmin(z, t))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (max(z, t) <= 1.0078886525156808e-141) tmp = 1.0 + (x / (min(z, t) * (y - max(z, t)))); else tmp = 1.0 + (x / (max(z, t) * (y - min(z, t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Max[z, t], $MachinePrecision], 1.0078886525156808e-141], N[(1.0 + N[(x / N[(N[Min[z, t], $MachinePrecision] * N[(y - N[Max[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[Max[z, t], $MachinePrecision] * N[(y - N[Min[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET tmp_3 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_4 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_5 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_6 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_7 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_2 = IF (tmp_3 <= (100788865251568084096471896180492855115826162464679217888017391142023499433420905899662669403570899924193771237924688605356638283865173068619569986507059640364248222840194812580112473978068623675909570516311315658962616614707688071059069366594768845425445574581953889203105039142973118457370114529737336590750729486854510945627492577529311749973128797819299506954848766326904296875e-521)) THEN ((1) + (x / (tmp_4 * (y - tmp_5)))) ELSE ((1) + (x / (tmp_6 * (y - tmp_7)))) ENDIF IN tmp_2 END code
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(z, t\right) \leq 1.0078886525156808 \cdot 10^{-141}:\\
\;\;\;\;1 + \frac{x}{\mathsf{min}\left(z, t\right) \cdot \left(y - \mathsf{max}\left(z, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\mathsf{max}\left(z, t\right) \cdot \left(y - \mathsf{min}\left(z, t\right)\right)}\\
\end{array}
if t < 1.0078886525156808e-141Initial program 99.1%
Taylor expanded in z around inf
Applied rewrites78.4%
if 1.0078886525156808e-141 < t Initial program 99.1%
Taylor expanded in t around inf
Applied rewrites78.2%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (- y (fmin z t)))
(t_2 (- y (fmax z t)))
(t_3 (/ x (* t_1 t_2))))
(if (<= t_3 -1000000000.0)
(/ (/ x t_2) (fmin z t))
(if (<= t_3 2e-6) 1.0 (/ x (* (fmax z t) t_1))))))double code(double x, double y, double z, double t) {
double t_1 = y - fmin(z, t);
double t_2 = y - fmax(z, t);
double t_3 = x / (t_1 * t_2);
double tmp;
if (t_3 <= -1000000000.0) {
tmp = (x / t_2) / fmin(z, t);
} else if (t_3 <= 2e-6) {
tmp = 1.0;
} else {
tmp = x / (fmax(z, t) * t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y - fmin(z, t)
t_2 = y - fmax(z, t)
t_3 = x / (t_1 * t_2)
if (t_3 <= (-1000000000.0d0)) then
tmp = (x / t_2) / fmin(z, t)
else if (t_3 <= 2d-6) then
tmp = 1.0d0
else
tmp = x / (fmax(z, t) * t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y - fmin(z, t);
double t_2 = y - fmax(z, t);
double t_3 = x / (t_1 * t_2);
double tmp;
if (t_3 <= -1000000000.0) {
tmp = (x / t_2) / fmin(z, t);
} else if (t_3 <= 2e-6) {
tmp = 1.0;
} else {
tmp = x / (fmax(z, t) * t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = y - fmin(z, t) t_2 = y - fmax(z, t) t_3 = x / (t_1 * t_2) tmp = 0 if t_3 <= -1000000000.0: tmp = (x / t_2) / fmin(z, t) elif t_3 <= 2e-6: tmp = 1.0 else: tmp = x / (fmax(z, t) * t_1) return tmp
function code(x, y, z, t) t_1 = Float64(y - fmin(z, t)) t_2 = Float64(y - fmax(z, t)) t_3 = Float64(x / Float64(t_1 * t_2)) tmp = 0.0 if (t_3 <= -1000000000.0) tmp = Float64(Float64(x / t_2) / fmin(z, t)); elseif (t_3 <= 2e-6) tmp = 1.0; else tmp = Float64(x / Float64(fmax(z, t) * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y - min(z, t); t_2 = y - max(z, t); t_3 = x / (t_1 * t_2); tmp = 0.0; if (t_3 <= -1000000000.0) tmp = (x / t_2) / min(z, t); elseif (t_3 <= 2e-6) tmp = 1.0; else tmp = x / (max(z, t) * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[Min[z, t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y - N[Max[z, t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1000000000.0], N[(N[(x / t$95$2), $MachinePrecision] / N[Min[z, t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e-6], 1.0, N[(x / N[(N[Max[z, t], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET tmp = IF (z < t) THEN z ELSE t ENDIF IN LET t_1 = (y - tmp) IN LET tmp_1 = IF (z > t) THEN z ELSE t ENDIF IN LET t_2 = (y - tmp_1) IN LET t_3 = (x / (t_1 * t_2)) IN LET tmp_4 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_6 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_5 = IF (t_3 <= (199999999999999990949622365177251737122787744738161563873291015625e-71)) THEN (1) ELSE (x / (tmp_6 * t_1)) ENDIF IN LET tmp_3 = IF (t_3 <= (-1e9)) THEN ((x / t_2) / tmp_4) ELSE tmp_5 ENDIF IN tmp_3 END code
\begin{array}{l}
t_1 := y - \mathsf{min}\left(z, t\right)\\
t_2 := y - \mathsf{max}\left(z, t\right)\\
t_3 := \frac{x}{t\_1 \cdot t\_2}\\
\mathbf{if}\;t\_3 \leq -1000000000:\\
\;\;\;\;\frac{\frac{x}{t\_2}}{\mathsf{min}\left(z, t\right)}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-6}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{max}\left(z, t\right) \cdot t\_1}\\
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < -1e9Initial program 99.1%
Taylor expanded in z around inf
Applied rewrites78.4%
Taylor expanded in z around 0
Applied rewrites77.4%
Taylor expanded in y around inf
Applied rewrites56.2%
Taylor expanded in x around inf
Applied rewrites17.0%
if -1e9 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < 1.9999999999999999e-6Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites74.6%
if 1.9999999999999999e-6 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) Initial program 99.1%
Taylor expanded in t around inf
Applied rewrites78.2%
Taylor expanded in t around 0
Applied rewrites77.3%
Taylor expanded in y around inf
Applied rewrites55.8%
Taylor expanded in x around inf
Applied rewrites17.5%
(FPCore (x y z t) :precision binary64 :pre TRUE (let* ((t_1 (/ x (* (- y z) (- y t)))) (t_2 (/ x (* t (- y z))))) (if (<= t_1 -2e+23) t_2 (if (<= t_1 2e-6) 1.0 t_2))))
double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (y - t));
double t_2 = x / (t * (y - z));
double tmp;
if (t_1 <= -2e+23) {
tmp = t_2;
} else if (t_1 <= 2e-6) {
tmp = 1.0;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / ((y - z) * (y - t))
t_2 = x / (t * (y - z))
if (t_1 <= (-2d+23)) then
tmp = t_2
else if (t_1 <= 2d-6) then
tmp = 1.0d0
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (y - t));
double t_2 = x / (t * (y - z));
double tmp;
if (t_1 <= -2e+23) {
tmp = t_2;
} else if (t_1 <= 2e-6) {
tmp = 1.0;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((y - z) * (y - t)) t_2 = x / (t * (y - z)) tmp = 0 if t_1 <= -2e+23: tmp = t_2 elif t_1 <= 2e-6: tmp = 1.0 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(y - z) * Float64(y - t))) t_2 = Float64(x / Float64(t * Float64(y - z))) tmp = 0.0 if (t_1 <= -2e+23) tmp = t_2; elseif (t_1 <= 2e-6) tmp = 1.0; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((y - z) * (y - t)); t_2 = x / (t * (y - z)); tmp = 0.0; if (t_1 <= -2e+23) tmp = t_2; elseif (t_1 <= 2e-6) tmp = 1.0; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+23], t$95$2, If[LessEqual[t$95$1, 2e-6], 1.0, t$95$2]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = (x / ((y - z) * (y - t))) IN LET t_2 = (x / (t * (y - z))) IN LET tmp_1 = IF (t_1 <= (199999999999999990949622365177251737122787744738161563873291015625e-71)) THEN (1) ELSE t_2 ENDIF IN LET tmp = IF (t_1 <= (-199999999999999983222784)) THEN t_2 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
t_2 := \frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-6}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < -1.9999999999999998e23 or 1.9999999999999999e-6 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) Initial program 99.1%
Taylor expanded in t around inf
Applied rewrites78.2%
Taylor expanded in t around 0
Applied rewrites77.3%
Taylor expanded in y around inf
Applied rewrites55.8%
Taylor expanded in x around inf
Applied rewrites17.5%
if -1.9999999999999998e23 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < 1.9999999999999999e-6Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites74.6%
(FPCore (x y z t) :precision binary64 :pre TRUE 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = 1 END code
1
Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites74.6%
herbie shell --seed 2026092
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
:precision binary64
(- 1.0 (/ x (* (- y z) (- y t)))))